Changeset 5b0ae4be in mainline
- Timestamp:
- 2009-02-22T15:51:40Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 691eb52
- Parents:
- f9f9a13
- Location:
- kernel
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/amd64/src/amd64.c
rf9f9a13 r5b0ae4be 175 175 { 176 176 /* keyboard controller */ 177 i8042_init(device_assign_devno(), IRQ_KBD, device_assign_devno(), IRQ_MOUSE); 177 (void) i8042_init((i8042_t *) I8042_BASE, device_assign_devno(), 178 IRQ_KBD); 178 179 } 179 180 -
kernel/arch/ia32/src/ia32.c
rf9f9a13 r5b0ae4be 126 126 { 127 127 devno_t kbd = device_assign_devno(); 128 devno_t mouse = device_assign_devno();129 128 /* keyboard controller */ 130 i8042_init(kbd, IRQ_KBD, mouse, IRQ_MOUSE);129 (void) i8042_init((i8042_t *) I8042_BASE, kbd, IRQ_KBD); 131 130 } 132 131 -
kernel/arch/ia64/src/ia64.c
rf9f9a13 r5b0ae4be 167 167 NULL); 168 168 #else 169 devno_t mouse = device_assign_devno(); 170 i8042_init(kbd, IRQ_KBD, mouse, IRQ_MOUSE); 169 (void) i8042_init((i8042_t *)I8042_BASE, kbd, IRQ_KBD); 171 170 #endif 172 171 #endif … … 223 222 #ifdef SKI 224 223 ski_kbd_grab(); 225 #else226 #ifdef CONFIG_NS16550227 ns16550_grab();228 #else229 i8042_grab();230 #endif231 224 #endif 232 225 } … … 239 232 #ifdef SKI 240 233 ski_kbd_release(); 241 #else242 #ifdef CONFIG_NS16550243 ns16550_release();244 #else245 i8042_release();246 #endif247 234 #endif 248 235 } -
kernel/genarch/include/kbd/i8042.h
rf9f9a13 r5b0ae4be 36 36 #define KERN_I8042_H_ 37 37 38 #include <ddi/irq.h> 38 39 #include <arch/types.h> 39 40 #include <typedefs.h> … … 47 48 48 49 typedef struct i8042_instance { 50 devno_t devno; 51 irq_t irq; 49 52 i8042_t *i8042; 50 53 } i8042_instance_t; 51 54 52 extern void i8042_init(devno_t kbd_devno, inr_t kbd_inr, devno_t mouse_devno, inr_t mouse_inr);55 extern bool i8042_init(i8042_t *, devno_t, inr_t); 53 56 54 57 #endif -
kernel/genarch/src/kbd/i8042.c
rf9f9a13 r5b0ae4be 90 90 }; 91 91 92 /** Structure for i8042's IRQ. */93 static irq_t i8042_kbd_irq;94 static irq_t i8042_mouse_irq;95 96 92 static irq_ownership_t i8042_claim(irq_t *irq) 97 93 { … … 126 122 127 123 /** Initialize i8042. */ 128 void 129 i8042_init(devno_t kbd_devno, inr_t kbd_inr, devno_t mouse_devno, 130 inr_t mouse_inr) 124 bool 125 i8042_init(i8042_t *dev, devno_t devno, inr_t inr) 131 126 { 132 i8042_ t *dev = lgcy_i8042_instance.i8042;127 i8042_instance_t *instance; 133 128 134 129 chardev_initialize("i8042_kbd", &kbrd, &ops); 135 130 stdin = &kbrd; 136 131 137 irq_initialize(&i8042_kbd_irq); 138 i8042_kbd_irq.devno = kbd_devno; 139 i8042_kbd_irq.inr = kbd_inr; 140 i8042_kbd_irq.claim = i8042_claim; 141 i8042_kbd_irq.handler = i8042_irq_handler; 142 i8042_kbd_irq.instance = &lgcy_i8042_instance; 143 irq_register(&i8042_kbd_irq); 132 instance = malloc(sizeof(i8042_instance_t), FRAME_ATOMIC); 133 if (!instance) 134 return false; 144 135 145 irq_initialize(&i8042_mouse_irq); 146 i8042_mouse_irq.devno = mouse_devno; 147 i8042_mouse_irq.inr = mouse_inr; 148 i8042_mouse_irq.claim = i8042_claim; 149 i8042_mouse_irq.handler = i8042_irq_handler; 150 i8042_mouse_irq.instance = &lgcy_i8042_instance; 151 irq_register(&i8042_mouse_irq); 136 instance->devno = devno; 137 instance->i8042 = dev; 152 138 153 trap_virtual_enable_irqs(1 << kbd_inr); 154 trap_virtual_enable_irqs(1 << mouse_inr); 139 irq_initialize(&instance->irq); 140 instance->irq.devno = devno; 141 instance->irq.inr = inr; 142 instance->irq.claim = i8042_claim; 143 instance->irq.handler = i8042_irq_handler; 144 instance->irq.instance = instance; 145 irq_register(&instance->irq); 146 147 trap_virtual_enable_irqs(1 << inr); 155 148 156 149 /* … … 165 158 */ 166 159 sysinfo_set_item_val("kbd", NULL, true); 167 sysinfo_set_item_val("kbd.devno", NULL, kbd_devno);168 sysinfo_set_item_val("kbd.inr", NULL, kbd_inr);160 sysinfo_set_item_val("kbd.devno", NULL, devno); 161 sysinfo_set_item_val("kbd.inr", NULL, inr); 169 162 #ifdef KBD_LEGACY 170 163 sysinfo_set_item_val("kbd.type", NULL, KBD_LEGACY); 171 164 #endif 172 sysinfo_set_item_val("mouse", NULL, true); 173 sysinfo_set_item_val("mouse.devno", NULL, mouse_devno); 174 sysinfo_set_item_val("mouse.inr", NULL, mouse_inr); 165 166 return true; 175 167 } 176 168
Note:
See TracChangeset
for help on using the changeset viewer.