Changeset 05641a9e in mainline for kernel/generic/src


Ignore:
Timestamp:
2009-03-23T21:46:40Z (16 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c3ebc47
Parents:
a5e5030
Message:

Revive kernel notifications.

Location:
kernel/generic/src
Files:
1 added
6 edited

Legend:

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

    ra5e5030 r05641a9e  
    6565#include <ipc/ipc.h>
    6666#include <ipc/irq.h>
     67#include <event/event.h>
    6768#include <symtab.h>
    6869#include <errno.h>
     
    955956        release_console();
    956957       
    957         if ((kconsole_notify) && (kconsole_irq.notif_cfg.notify))
    958                 ipc_irq_send_msg_0(&kconsole_irq);
     958        event_notify_0(EVENT_KCONSOLE);
    959959       
    960960        return 1;
  • kernel/generic/src/console/console.c

    ra5e5030 r05641a9e  
    4242#include <ddi/irq.h>
    4343#include <ddi/ddi.h>
     44#include <event/event.h>
    4445#include <ipc/irq.h>
    4546#include <arch.h>
     
    100101        sysinfo_set_item_val("klog.faddr", NULL, (unative_t) faddr);
    101102        sysinfo_set_item_val("klog.pages", NULL, SIZE2FRAMES(KLOG_SIZE));
    102        
    103         //irq_initialize(&klog_irq);
    104         //klog_irq.devno = devno;
    105         //klog_irq.inr = KLOG_VIRT_INR;
    106         //klog_irq.claim = klog_claim;
    107         //irq_register(&klog_irq);
    108103       
    109104        spinlock_lock(&klog_lock);
     
    243238        spinlock_lock(&klog_lock);
    244239       
    245 //      if ((klog_inited) && (klog_irq.notif_cfg.notify) && (klog_uspace > 0)) {
    246 //              ipc_irq_send_msg_3(&klog_irq, klog_start, klog_len, klog_uspace);
    247 //              klog_uspace = 0;
    248 //      }
     240        if (klog_inited && event_is_subscribed(EVENT_KLOG) && klog_uspace > 0) {
     241                event_notify_3(EVENT_KLOG, klog_start, klog_len, klog_uspace);
     242                klog_uspace = 0;
     243        }
    249244       
    250245        spinlock_unlock(&klog_lock);
  • kernel/generic/src/console/kconsole.c

    ra5e5030 r05641a9e  
    8888static char history[KCONSOLE_HISTORY][MAX_CMDLINE] = {};
    8989
    90 /*
    91  * For now, we use 0 as INR.
    92  * However, it is therefore desirable to have architecture specific
    93  * definition of KCONSOLE_VIRT_INR in the future.
    94  */
    95 #define KCONSOLE_VIRT_INR  0
    96 
    97 bool kconsole_notify = false;
    98 irq_t kconsole_irq;
    99 
    100 
    101 /** Allways refuse IRQ ownership.
    102  *
    103  * This is not a real IRQ, so we always decline.
    104  *
    105  * @return Always returns IRQ_DECLINE.
    106  *
    107  */
    108 static irq_ownership_t kconsole_claim(irq_t *irq)
    109 {
    110         return IRQ_DECLINE;
    111 }
    112 
    113 
    11490/** Initialize kconsole data structures
    11591 *
     
    126102                history[i][0] = '\0';
    127103}
    128 
    129 
    130 /** Initialize kconsole notification mechanism
    131  *
    132  * Initialize the virtual IRQ notification mechanism.
    133  *
    134  */
    135 void kconsole_notify_init(void)
    136 {
    137         sysinfo_set_item_val("kconsole.present", NULL, true);
    138         sysinfo_set_item_val("kconsole.inr", NULL, KCONSOLE_VIRT_INR);
    139        
    140         irq_initialize(&kconsole_irq);
    141         kconsole_irq.devno = device_assign_devno();
    142         kconsole_irq.inr = KCONSOLE_VIRT_INR;
    143         kconsole_irq.claim = kconsole_claim;
    144         irq_register(&kconsole_irq);
    145        
    146         kconsole_notify = true;
    147 }
    148 
    149104
    150105/** Register kconsole command.
  • kernel/generic/src/ipc/ipc.c

    ra5e5030 r05641a9e  
    4545#include <ipc/ipc.h>
    4646#include <ipc/kbox.h>
     47#include <event/event.h>
    4748#include <errno.h>
    4849#include <mm/slab.h>
     
    5152#include <memstr.h>
    5253#include <debug.h>
     54
    5355
    5456#include <print.h>
     
    526528        for (i = 0; i < IPC_MAX_PHONES; i++)
    527529                ipc_phone_hangup(&TASK->phones[i]);
     530
     531        /* Unsubscribe from any event notifications. */
     532        event_cleanup_answerbox(&TASK->answerbox);
    528533
    529534        /* Disconnect all connected irqs */
  • kernel/generic/src/main/main.c

    ra5e5030 r05641a9e  
    8383#include <ddi/ddi.h>
    8484#include <main/main.h>
     85#include <event/event.h>
    8586
    8687/** Global configuration structure. */
     
    256257       
    257258        LOG_EXEC(ipc_init());
     259        LOG_EXEC(event_init());
    258260        LOG_EXEC(klog_init());
    259        
    260 #ifdef CONFIG_KCONSOLE
    261         LOG_EXEC(kconsole_notify_init());
    262 #endif
    263261       
    264262        /*
  • kernel/generic/src/syscall/syscall.c

    ra5e5030 r05641a9e  
    5050#include <synch/smc.h>
    5151#include <ddi/ddi.h>
     52#include <event/event.h>
    5253#include <security/cap.h>
    5354#include <sysinfo/sysinfo.h>
     
    127128        (syshandler_t) sys_ipc_register_irq,
    128129        (syshandler_t) sys_ipc_unregister_irq,
     130
     131        /* Event notification syscalls. */
     132        (syshandler_t) sys_event_subscribe,
    129133       
    130134        /* Capabilities related syscalls. */
Note: See TracChangeset for help on using the changeset viewer.