Changeset 8d2760f in mainline for kernel/genarch/src/kbd
- Timestamp:
- 2008-11-29T20:24:47Z (17 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 57e76cb
- Parents:
- dfd77382
- Location:
- kernel/genarch/src/kbd
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/genarch/src/kbd/ns16550.c
rdfd77382 r8d2760f 108 108 /** Initialize ns16550. 109 109 * 110 * @param devno Device number. 111 * @param inr Interrupt number. 112 * @param vaddr Virtual address of device's registers. 113 */ 114 void ns16550_init(devno_t devno, inr_t inr, ioport_t port) 110 * @param devno Device number. 111 * @param port Virtual/IO address of device's registers. 112 * @param inr Interrupt number. 113 * @param cir Clear interrupt function. 114 * @param cir_arg First argument to cir. 115 */ 116 void 117 ns16550_init(devno_t devno, ioport_t port, inr_t inr, cir_t cir, void *cir_arg) 115 118 { 116 119 chardev_initialize("ns16550_kbd", &kbrd, &ops); … … 125 128 ns16550_irq.claim = ns16550_claim; 126 129 ns16550_irq.handler = ns16550_irq_handler; 130 ns16550_irq.cir = cir; 131 ns16550_irq.cir_arg = cir_arg; 127 132 irq_register(&ns16550_irq); 128 133 -
kernel/genarch/src/kbd/z8530.c
rdfd77382 r8d2760f 44 44 #include <arch/interrupt.h> 45 45 #include <arch/drivers/kbd.h> 46 #include <arch/drivers/fhc.h>47 46 #include <cpu.h> 48 47 #include <arch/asm.h> … … 84 83 z8530_write_a(&z8530, WR0, WR0_TX_IP_RST); 85 84 86 z8530_write_a(&z8530, WR1, WR1_IARCSC); /* interrupt on all characters */ 85 /* interrupt on all characters */ 86 z8530_write_a(&z8530, WR1, WR1_IARCSC); 87 87 88 88 /* 8 bits per character and enable receiver */ 89 89 z8530_write_a(&z8530, WR3, WR3_RX8BITSCH | WR3_RX_ENABLE); 90 90 91 z8530_write_a(&z8530, WR9, WR9_MIE); /* Master Interrupt Enable. */ 91 /* Master Interrupt Enable. */ 92 z8530_write_a(&z8530, WR9, WR9_MIE); 92 93 93 94 spinlock_lock(&z8530_irq.lock); … … 109 110 110 111 /** Initialize z8530. */ 111 void z8530_init(devno_t devno, inr_t inr, uintptr_t vaddr) 112 void 113 z8530_init(devno_t devno, uintptr_t vaddr, inr_t inr, cir_t cir, void *cir_arg) 112 114 { 113 115 chardev_initialize("z8530_kbd", &kbrd, &ops); … … 122 124 z8530_irq.claim = z8530_claim; 123 125 z8530_irq.handler = z8530_irq_handler; 126 z8530_irq.cir = cir; 127 z8530_irq.cir_arg = cir_arg; 124 128 irq_register(&z8530_irq); 125 129 … … 198 202 void z8530_irq_handler(irq_t *irq, void *arg, ...) 199 203 { 200 /*201 * So far, we know we got this interrupt through the FHC.202 * Since we don't have enough documentation about the FHC203 * and because the interrupt looks like level sensitive,204 * we cannot handle it by scheduling one of the level205 * interrupt traps. Process the interrupt directly.206 */207 204 if (irq->notif_cfg.notify && irq->notif_cfg.answerbox) 208 205 ipc_irq_send_notif(irq); 209 206 else 210 207 z8530_interrupt(); 211 fhc_clear_interrupt(central_fhc, irq->inr);212 208 } 213 209
Note:
See TracChangeset
for help on using the changeset viewer.
