/trunk/kernel/genarch/src/kbd/ns16550.c |
---|
80,19 → 80,28 |
/** Initialize keyboard and service interrupts using kernel routine */ |
void ns16550_grab(void) |
{ |
ipl_t ipl = interrupts_disable(); |
ns16550_ier_write(&ns16550, IER_ERBFI); /* enable receiver interrupt */ |
while (ns16550_lsr_read(&ns16550) & LSR_DATA_READY) |
(void) ns16550_rbr_read(&ns16550); |
spinlock_lock(&ns16550_irq.lock); |
ns16550_irq.notif_cfg.notify = false; |
spinlock_unlock(&ns16550_irq.lock); |
interrupts_restore(ipl); |
} |
/** Resume the former interrupt vector */ |
void ns16550_release(void) |
{ |
ipl_t ipl = interrupts_disable(); |
spinlock_lock(&ns16550_irq.lock); |
if (ns16550_irq.notif_cfg.answerbox) |
ns16550_irq.notif_cfg.notify = true; |
spinlock_unlock(&ns16550_irq.lock); |
interrupts_restore(ipl); |
} |
/** Initialize ns16550. |
/trunk/kernel/genarch/src/kbd/z8530.c |
---|
74,6 → 74,8 |
/** Initialize keyboard and service interrupts using kernel routine. */ |
void z8530_grab(void) |
{ |
ipl_t ipl = interrupts_disable(); |
(void) z8530_read_a(&z8530, RR8); |
/* |
89,14 → 91,21 |
z8530_write_a(&z8530, WR9, WR9_MIE); /* Master Interrupt Enable. */ |
spinlock_lock(&z8530_irq.lock); |
z8530_irq.notif_cfg.notify = false; |
spinlock_unlock(&z8530_irq.lock); |
interrupts_restore(ipl); |
} |
/** Resume the former IPC notification behavior. */ |
void z8530_release(void) |
{ |
ipl_t ipl = interrupts_disable(); |
spinlock_lock(&z8530_irq.lock); |
if (z8530_irq.notif_cfg.answerbox) |
z8530_irq.notif_cfg.notify = true; |
spinlock_unlock(&z8530_irq.lock); |
interrupts_restore(ipl); |
} |
/** Initialize z8530. */ |