Changeset 2b017ba in mainline for kernel/generic/src/console/klog.c


Ignore:
Timestamp:
2006-10-16T20:51:55Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5f9b4d9a
Parents:
e3890b3f
Message:

Replace the old IRQ dispatcher and IPC notifier with new implementation.
Note that all architectures except for sparc64 are now broken
and don't even compile.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/console/klog.c

    re3890b3f r2b017ba  
    3737#include <console/klog.h>
    3838#include <print.h>
     39#include <ddi/device.h>
     40#include <ddi/irq.h>
    3941#include <ipc/irq.h>
    4042
    4143/* Order of frame to be allocated for klog communication */
    42 #define KLOG_ORDER 0
     44#define KLOG_ORDER      0
    4345
    4446static char *klog;
     
    4749
    4850SPINLOCK_INITIALIZE(klog_lock);
     51
     52static irq_t klog_irq;
     53
     54static irq_ownership_t klog_claim(void);
    4955
    5056/** Initialize kernel logging facility
     
    6470        klog = (char *)PA2KA(faddr);
    6571       
     72        devno_t devno = device_assign_devno();
     73       
    6674        sysinfo_set_item_val("klog.faddr", NULL, (unative_t)faddr);
    6775        sysinfo_set_item_val("klog.pages", NULL, 1 << KLOG_ORDER);
     76        sysinfo_set_item_val("klog.devno", NULL, devno);
     77        sysinfo_set_item_val("klog.inr", NULL, VIRT_INR_KLOG);
     78
     79        irq_initialize(&klog_irq);
     80        klog_irq.devno = devno;
     81        klog_irq.inr = VIRT_INR_KLOG;
     82        klog_irq.claim = klog_claim;
     83        irq_register(&klog_irq);
    6884
    6985        klogsize = PAGE_SIZE << KLOG_ORDER;
    7086        klogpos = 0;
     87}
     88
     89/** Allways refuse IRQ ownership.
     90 *
     91 * This is not a real IRQ, so we always decline.
     92 *
     93 * @return Always returns IRQ_DECLINE.
     94 */
     95irq_ownership_t klog_claim(void)
     96{
     97        return IRQ_DECLINE;
    7198}
    7299
     
    85112                        goto out;
    86113        }
    87         ipc_irq_send_msg(IPC_IRQ_KLOG, klogpos, ret, 0);
     114        ipc_irq_send_msg(&klog_irq, klogpos, ret, 0);
    88115        klogpos += ret;
    89116        if (klogpos >= klogsize)
Note: See TracChangeset for help on using the changeset viewer.