Changeset 16d71f41 in mainline
- Timestamp:
- 2006-10-27T12:27:24Z (18 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8607db8
- Parents:
- cea12e9
- Location:
- kernel
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ia32/include/interrupt.h
rcea12e9 r16d71f41 53 53 #define IRQ_PIC1 2 54 54 #define IRQ_PIC_SPUR 7 55 #define IRQ_MOUSE 12 55 56 56 57 /* this one must have four least significant bits set to ones */ -
kernel/arch/ia32/src/ia32.c
rcea12e9 r16d71f41 129 129 { 130 130 /* keyboard controller */ 131 i8042_init(device_assign_devno(), IRQ_KBD );131 i8042_init(device_assign_devno(), IRQ_KBD, device_assign_devno(), IRQ_MOUSE); 132 132 } 133 133 -
kernel/genarch/include/kbd/i8042.h
rcea12e9 r16d71f41 38 38 #include <typedefs.h> 39 39 40 extern void i8042_init(devno_t devno, inr_tinr);40 extern void i8042_init(devno_t kbd_devno, inr_t kbd_inr, devno_t mouse_devno, inr_t mouse_inr); 41 41 extern void i8042_poll(void); 42 42 extern void i8042_grab(void); -
kernel/genarch/src/kbd/i8042.c
rcea12e9 r16d71f41 89 89 90 90 /** Structure for i8042's IRQ. */ 91 static irq_t i8042_irq; 91 static irq_t i8042_kbd_irq; 92 static irq_t i8042_mouse_irq; 92 93 93 94 /** Wait until the controller reads its data. */ … … 108 109 i8042_wait(); 109 110 110 spinlock_lock(&i8042_irq.lock); 111 i8042_irq.notif_cfg.notify = false; 112 spinlock_unlock(&i8042_irq.lock); 111 spinlock_lock(&i8042_kbd_irq.lock); 112 i8042_kbd_irq.notif_cfg.notify = false; 113 spinlock_unlock(&i8042_kbd_irq.lock); 114 115 spinlock_lock(&i8042_mouse_irq.lock); 116 i8042_mouse_irq.notif_cfg.notify = false; 117 spinlock_unlock(&i8042_mouse_irq.lock); 118 113 119 interrupts_restore(ipl); 114 120 } … … 117 123 { 118 124 ipl_t ipl = interrupts_disable(); 119 spinlock_lock(&i8042_irq.lock); 120 if (i8042_irq.notif_cfg.answerbox) 121 i8042_irq.notif_cfg.notify = true; 122 spinlock_unlock(&i8042_irq.lock); 125 126 spinlock_lock(&i8042_kbd_irq.lock); 127 if (i8042_kbd_irq.notif_cfg.answerbox) 128 i8042_kbd_irq.notif_cfg.notify = true; 129 spinlock_unlock(&i8042_kbd_irq.lock); 130 131 spinlock_lock(&i8042_mouse_irq.lock); 132 if (i8042_mouse_irq.notif_cfg.answerbox) 133 i8042_mouse_irq.notif_cfg.notify = true; 134 spinlock_unlock(&i8042_mouse_irq.lock); 135 123 136 interrupts_restore(ipl); 124 137 } … … 129 142 } 130 143 131 static void i8042_ irq_handler(irq_t *irq, void *arg, ...)144 static void i8042_kbd_irq_handler(irq_t *irq, void *arg, ...) 132 145 { 133 146 if (irq->notif_cfg.notify && irq->notif_cfg.answerbox) … … 151 164 } 152 165 166 static void i8042_mouse_irq_handler(irq_t *irq, void *arg, ...) 167 { 168 if (irq->notif_cfg.notify && irq->notif_cfg.answerbox) 169 ipc_irq_send_notif(irq); 170 } 171 153 172 /** Initialize i8042. */ 154 void i8042_init(devno_t devno, inr_tinr)173 void i8042_init(devno_t kbd_devno, inr_t kbd_inr, devno_t mouse_devno, inr_t mouse_inr) 155 174 { 156 175 chardev_initialize("i8042_kbd", &kbrd, &ops); 157 176 stdin = &kbrd; 158 177 159 irq_initialize(&i8042_irq); 160 i8042_irq.devno = devno; 161 i8042_irq.inr = inr; 162 i8042_irq.claim = i8042_claim; 163 i8042_irq.handler = i8042_irq_handler; 164 irq_register(&i8042_irq); 165 166 trap_virtual_enable_irqs(1 << inr); 178 irq_initialize(&i8042_kbd_irq); 179 i8042_kbd_irq.devno = kbd_devno; 180 i8042_kbd_irq.inr = kbd_inr; 181 i8042_kbd_irq.claim = i8042_claim; 182 i8042_kbd_irq.handler = i8042_kbd_irq_handler; 183 irq_register(&i8042_kbd_irq); 184 185 irq_initialize(&i8042_mouse_irq); 186 i8042_mouse_irq.devno = mouse_devno; 187 i8042_mouse_irq.inr = mouse_inr; 188 i8042_mouse_irq.claim = i8042_claim; 189 i8042_mouse_irq.handler = i8042_mouse_irq_handler; 190 irq_register(&i8042_mouse_irq); 191 192 trap_virtual_enable_irqs(1 << kbd_inr); 193 trap_virtual_enable_irqs(1 << mouse_inr); 167 194 168 195 /* … … 176 203 177 204 sysinfo_set_item_val("kbd", NULL, true); 178 sysinfo_set_item_val("kbd.devno", NULL, devno); 179 sysinfo_set_item_val("kbd.inr", NULL, inr); 205 sysinfo_set_item_val("kbd.devno", NULL, kbd_devno); 206 sysinfo_set_item_val("kbd.inr", NULL, kbd_inr); 207 208 sysinfo_set_item_val("mouse", NULL, true); 209 sysinfo_set_item_val("mouse.devno", NULL, mouse_devno); 210 sysinfo_set_item_val("mouse.inr", NULL, mouse_inr); 180 211 181 212 i8042_grab();
Note:
See TracChangeset
for help on using the changeset viewer.