/trunk/kernel/genarch/src/kbd/ns16550.c |
---|
61,8 → 61,6 |
/** Structure for ns16550's IRQ. */ |
static irq_t ns16550_irq; |
static ipc_notif_cfg_t saved_notif_cfg; |
/* |
* These codes read from ns16550 data register are silently ignored. |
*/ |
87,20 → 85,14 |
while (ns16550_lsr_read(&ns16550) & LSR_DATA_READY) |
(void) ns16550_rbr_read(&ns16550); |
if (ns16550_irq.notif_cfg.answerbox) { |
saved_notif_cfg = ns16550_irq.notif_cfg; |
ns16550_irq.notif_cfg.answerbox = NULL; |
ns16550_irq.notif_cfg.code = NULL; |
ns16550_irq.notif_cfg.method = 0; |
ns16550_irq.notif_cfg.counter = 0; |
ns16550_irq.notif_cfg.notify = false; |
} |
} |
/** Resume the former interrupt vector */ |
void ns16550_release(void) |
{ |
if (saved_notif_cfg.answerbox) |
ns16550_irq.notif_cfg = saved_notif_cfg; |
if (ns16550_irq.notif_cfg.answerbox) |
ns16550_irq.notif_cfg.notify = true; |
} |
/** Initialize ns16550. |
183,7 → 175,7 |
spinlock_lock(&ns16550_irq.lock); |
if (ns16550_lsr_read(&ns16550) & LSR_DATA_READY) { |
if (ns16550_irq.notif_cfg.answerbox) { |
if (ns16550_irq.notif_cfg.notify && ns16550_irq.notif_cfg.answerbox) { |
/* |
* Send IPC notification. |
*/ |
/trunk/kernel/genarch/src/kbd/z8530.c |
---|
62,8 → 62,6 |
static z8530_t z8530; /**< z8530 device structure. */ |
static irq_t z8530_irq; /**< z8530's IRQ. */ |
static ipc_notif_cfg_t saved_notif_cfg; |
static void z8530_suspend(chardev_t *); |
static void z8530_resume(chardev_t *); |
91,20 → 89,14 |
z8530_write_a(&z8530, WR9, WR9_MIE); /* Master Interrupt Enable. */ |
if (z8530_irq.notif_cfg.answerbox) { |
saved_notif_cfg = z8530_irq.notif_cfg; |
z8530_irq.notif_cfg.answerbox = NULL; |
z8530_irq.notif_cfg.code = NULL; |
z8530_irq.notif_cfg.method = 0; |
z8530_irq.notif_cfg.counter = 0; |
z8530_irq.notif_cfg.notify = false; |
} |
} |
/** Resume the former IPC notification behavior. */ |
void z8530_release(void) |
{ |
if (saved_notif_cfg.answerbox) |
z8530_irq.notif_cfg = saved_notif_cfg; |
if (z8530_irq.notif_cfg.answerbox) |
z8530_irq.notif_cfg.notify = true; |
} |
/** Initialize z8530. */ |
204,7 → 196,7 |
* we cannot handle it by scheduling one of the level |
* interrupt traps. Process the interrupt directly. |
*/ |
if (irq->notif_cfg.answerbox) |
if (irq->notif_cfg.notify && irq->notif_cfg.answerbox) |
ipc_irq_send_notif(irq); |
else |
z8530_interrupt(); |