Changeset 4874c2d in mainline for kernel/genarch


Ignore:
Timestamp:
2006-10-17T20:32:35Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b14e35f2
Parents:
8513ad7
Message:

Do not copy notification config out of the IRQ structure.
Add the notify member, that toggles notifications on and off instead.
This is good for preventing other tasks from registering the notification
while the notification config is stored outside the IRQ structure.
It should also help to implement the cleanup code.

Location:
kernel/genarch/src/kbd
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • kernel/genarch/src/kbd/ns16550.c

    r8513ad7 r4874c2d  
    6262static irq_t ns16550_irq;
    6363
    64 static ipc_notif_cfg_t saved_notif_cfg;
    65 
    6664/*
    6765 * These codes read from ns16550 data register are silently ignored.
     
    8886                (void) ns16550_rbr_read(&ns16550);
    8987
    90         if (ns16550_irq.notif_cfg.answerbox) {
    91                 saved_notif_cfg = ns16550_irq.notif_cfg;
    92                 ns16550_irq.notif_cfg.answerbox = NULL;
    93                 ns16550_irq.notif_cfg.code = NULL;
    94                 ns16550_irq.notif_cfg.method = 0;
    95                 ns16550_irq.notif_cfg.counter = 0;
    96         }
     88        ns16550_irq.notif_cfg.notify = false;
    9789}
    9890
     
    10092void ns16550_release(void)
    10193{
    102         if (saved_notif_cfg.answerbox)
    103                 ns16550_irq.notif_cfg = saved_notif_cfg;
     94        if (ns16550_irq.notif_cfg.answerbox)
     95                ns16550_irq.notif_cfg.notify = true;
    10496}
    10597
     
    184176
    185177        if (ns16550_lsr_read(&ns16550) & LSR_DATA_READY) {
    186                 if (ns16550_irq.notif_cfg.answerbox) {
     178                if (ns16550_irq.notif_cfg.notify && ns16550_irq.notif_cfg.answerbox) {
    187179                        /*
    188180                         * Send IPC notification.
  • kernel/genarch/src/kbd/z8530.c

    r8513ad7 r4874c2d  
    6363static irq_t z8530_irq;         /**< z8530's IRQ. */
    6464
    65 static ipc_notif_cfg_t saved_notif_cfg;
    66 
    6765static void z8530_suspend(chardev_t *);
    6866static void z8530_resume(chardev_t *);
     
    9290        z8530_write_a(&z8530, WR9, WR9_MIE);            /* Master Interrupt Enable. */
    9391       
    94         if (z8530_irq.notif_cfg.answerbox) {
    95                 saved_notif_cfg = z8530_irq.notif_cfg;
    96                 z8530_irq.notif_cfg.answerbox = NULL;
    97                 z8530_irq.notif_cfg.code = NULL;
    98                 z8530_irq.notif_cfg.method = 0;
    99                 z8530_irq.notif_cfg.counter = 0;
    100         }
     92        z8530_irq.notif_cfg.notify = false;
    10193}
    10294
     
    10496void z8530_release(void)
    10597{
    106         if (saved_notif_cfg.answerbox)
    107                 z8530_irq.notif_cfg = saved_notif_cfg;
     98        if (z8530_irq.notif_cfg.answerbox)
     99                z8530_irq.notif_cfg.notify = true;
    108100}
    109101
     
    205197         * interrupt traps. Process the interrupt directly.
    206198         */
    207         if (irq->notif_cfg.answerbox)
     199        if (irq->notif_cfg.notify && irq->notif_cfg.answerbox)
    208200                ipc_irq_send_notif(irq);
    209201        else
Note: See TracChangeset for help on using the changeset viewer.