Changeset 26e51609 in mainline
- Timestamp:
- 2009-02-21T21:53:25Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e7abb0e
- Parents:
- d063365
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/genarch/src/kbd/ns16550.c
rd063365 r26e51609 41 41 #include <arch/drivers/kbd.h> 42 42 #include <ddi/irq.h> 43 #include <ipc/irq.h>44 43 #include <cpu.h> 45 44 #include <arch/asm.h> … … 55 54 #define LSR_DATA_READY 0x01 56 55 57 static irq_t *ns16550_irq;58 59 56 /* 60 57 * These codes read from ns16550 data register are silently ignored. … … 69 66 .resume = ns16550_resume, 70 67 }; 71 72 /** Initialize keyboard and service interrupts using kernel routine */73 void ns16550_grab(void)74 {75 ipl_t ipl = interrupts_disable();76 spinlock_lock(&ns16550_irq->lock);77 ns16550_irq->notif_cfg.notify = false;78 spinlock_unlock(&ns16550_irq->lock);79 interrupts_restore(ipl);80 }81 82 /** Resume the former interrupt vector */83 void ns16550_release(void)84 {85 ipl_t ipl = interrupts_disable();86 spinlock_lock(&ns16550_irq->lock);87 if (ns16550_irq->notif_cfg.answerbox)88 ns16550_irq->notif_cfg.notify = true;89 spinlock_unlock(&ns16550_irq->lock);90 interrupts_restore(ipl);91 }92 68 93 69 /** Initialize ns16550. … … 126 102 irq_register(&instance->irq); 127 103 128 ns16550_irq = &instance->irq; /* TODO: remove me soon */129 130 104 while ((pio_read_8(&dev->lsr) & LSR_DATA_READY)) 131 105 (void) pio_read_8(&dev->rbr); 132 106 107 /* 108 * This is the necessary evil until the userspace driver is entirely 109 * self-sufficient. 110 */ 133 111 sysinfo_set_item_val("kbd", NULL, true); 134 112 sysinfo_set_item_val("kbd.type", NULL, KBD_NS16550); … … 141 119 pio_write_8(&dev->ier, IER_ERBFI); 142 120 pio_write_8(&dev->mcr, MCR_OUT2); 143 144 ns16550_grab();145 121 146 122 return true; … … 170 146 void ns16550_irq_handler(irq_t *irq) 171 147 { 172 if (irq->notif_cfg.notify && irq->notif_cfg.answerbox) {173 /*174 * This will hopefully go to the IRQ dispatch code soon.175 */176 ipc_irq_send_notif(irq);177 return;178 }179 180 148 ns16550_instance_t *ns16550_instance = irq->instance; 181 149 ns16550_t *dev = ns16550_instance->ns16550;
Note:
See TracChangeset
for help on using the changeset viewer.