Changeset af75db9 in mainline
- Timestamp:
- 2009-02-12T20:05:15Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 912ee7c
- Parents:
- 95b9963
- Location:
- kernel/genarch
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/genarch/Makefile.inc
r95b9963 raf75db9 34 34 genarch/src/acpi/madt.c 35 35 endif 36 36 37 ifeq ($(CONFIG_PAGE_PT),y) 37 38 GENARCH_SOURCES += \ … … 39 40 genarch/src/mm/as_pt.c 40 41 endif 42 41 43 ifeq ($(CONFIG_PAGE_HT),y) 42 44 GENARCH_SOURCES += \ … … 44 46 genarch/src/mm/as_ht.c 45 47 endif 48 46 49 ifeq ($(CONFIG_ASID),y) 47 50 GENARCH_SOURCES += \ 48 51 genarch/src/mm/asid.c 49 52 endif 53 50 54 ifeq ($(CONFIG_ASID_FIFO),y) 51 55 GENARCH_SOURCES += \ 52 56 genarch/src/mm/asid_fifo.c 53 57 endif 58 54 59 ifeq ($(CONFIG_SOFTINT),y) 55 60 GENARCH_SOURCES += \ … … 57 62 endif 58 63 59 ## Framebuffer60 64 ifeq ($(CONFIG_FB),y) 61 65 GENARCH_SOURCES += \ … … 63 67 genarch/src/fb/logo-196x66.c \ 64 68 genarch/src/fb/fb.c 65 DEFS += -DCONFIG_FB66 69 endif 67 70 68 ## i8042 controller69 71 ifeq ($(CONFIG_I8042),y) 70 72 GENARCH_SOURCES += \ … … 74 76 endif 75 77 76 ## Sun keyboard77 78 ifeq ($(CONFIG_SUN_KBD),y) 78 79 GENARCH_SOURCES += \ … … 81 82 endif 82 83 83 ## z8530 controller84 84 ifeq ($(CONFIG_Z8530),y) 85 85 GENARCH_SOURCES += \ … … 87 87 endif 88 88 89 ## ns16550 controller90 89 ifeq ($(CONFIG_NS16550),y) 91 90 GENARCH_SOURCES += \ … … 93 92 endif 94 93 95 96 ## OpenFirmware Device Tree97 94 ifeq ($(CONFIG_OFW_TREE), y) 98 95 GENARCH_SOURCES += \ … … 105 102 endif 106 103 107 ## EGA108 104 ifeq ($(CONFIG_EGA), y) 109 105 GENARCH_SOURCES += \ -
kernel/genarch/src/kbd/i8042.c
r95b9963 raf75db9 38 38 39 39 #include <genarch/kbd/i8042.h> 40 #ifdef ia6441 40 #include <arch/drivers/kbd.h> 42 #endif43 41 #include <genarch/kbd/key.h> 44 42 #include <genarch/kbd/scanc.h> … … 172 170 i8042_mouse_irq.handler = i8042_irq_handler; 173 171 irq_register(&i8042_mouse_irq); 174 #ifndef ia64172 175 173 trap_virtual_enable_irqs(1 << kbd_inr); 176 174 trap_virtual_enable_irqs(1 << mouse_inr); 177 #endif175 178 176 /* 179 177 * Clear input buffer. … … 190 188 #ifdef KBD_LEGACY 191 189 sysinfo_set_item_val("kbd.type", NULL, KBD_LEGACY); 192 #endif 190 #endif 193 191 sysinfo_set_item_val("mouse", NULL, true); 194 192 sysinfo_set_item_val("mouse.devno", NULL, mouse_devno); … … 210 208 char i8042_key_read(chardev_t *d) 211 209 { 212 char ch; 213 214 while (!(ch = active_read_buff_read())) {210 char ch; 211 212 while (!(ch = active_read_buff_read())) { 215 213 uint8_t x; 216 while (!(i8042_status_read() & i8042_BUFFER_FULL_MASK)) 217 ; 214 215 while (!(i8042_status_read() & i8042_BUFFER_FULL_MASK)); 216 218 217 x = i8042_data_read(); 219 218 if (x & KEY_RELEASE) … … 232 231 { 233 232 uint8_t x; 234 233 235 234 while (((x = i8042_status_read() & i8042_BUFFER_FULL_MASK))) { 236 235 x = i8042_data_read(); -
kernel/genarch/src/kbd/key.c
r95b9963 raf75db9 41 41 #endif 42 42 43 #if (defined( sparc64))43 #if (defined(US)) || (defined(US3)) 44 44 #include <genarch/kbd/scanc_sun.h> 45 45 #endif -
kernel/genarch/src/kbd/ns16550.c
r95b9963 raf75db9 40 40 #include <genarch/kbd/scanc_sun.h> 41 41 #include <arch/drivers/kbd.h> 42 #ifndef ia6443 #include <arch/drivers/ns16550.h>44 #endif45 42 #include <ddi/irq.h> 46 43 #include <ipc/irq.h> … … 131 128 ns16550_irq.cir_arg = cir_arg; 132 129 irq_register(&ns16550_irq); 133 134 130 135 131 while ((ns16550_lsr_read(&ns16550) & LSR_DATA_READY)) 136 132 ns16550_rbr_read(&ns16550); 137 138 133 139 134 sysinfo_set_item_val("kbd", NULL, true); … … 143 138 sysinfo_set_item_val("kbd.address.virtual", NULL, port); 144 139 sysinfo_set_item_val("kbd.port", NULL, port); 145 140 146 141 #ifdef CONFIG_NS16550_INTERRUPT_DRIVEN 147 142 /* Enable interrupts */ 148 143 ns16550_ier_write(&ns16550, IER_ERBFI); 149 144 ns16550_mcr_write(&ns16550, MCR_OUT2); 150 145 #endif 151 152 #ifdef ia64 153 uint8_t c; 154 // This switches rbr & ier to mode when accept baudrate constant 155 c = ns16550_lcr_read(&ns16550); 156 ns16550_lcr_write(&ns16550, 0x80 | c); 157 ns16550_rbr_write(&ns16550, 0x0c); 158 ns16550_ier_write(&ns16550, 0x00); 159 ns16550_lcr_write(&ns16550, c); 160 #endif 146 147 uint8_t c; 148 // This switches rbr & ier to mode when accept baudrate constant 149 c = ns16550_lcr_read(&ns16550); 150 ns16550_lcr_write(&ns16550, 0x80 | c); 151 ns16550_rbr_write(&ns16550, 0x0c); 152 ns16550_ier_write(&ns16550, 0x00); 153 ns16550_lcr_write(&ns16550, c); 161 154 162 155 ns16550_grab(); … … 186 179 while(!(ch = active_read_buff_read())) { 187 180 uint8_t x; 188 while (!(ns16550_lsr_read(&ns16550) & LSR_DATA_READY)) 189 ;181 while (!(ns16550_lsr_read(&ns16550) & LSR_DATA_READY)); 182 190 183 x = ns16550_rbr_read(&ns16550); 191 #ifndef ia64 184 192 185 if (x != IGNORE_CODE) { 193 186 if (x & KEY_RELEASE) … … 196 189 active_read_key_pressed(x); 197 190 } 198 #else199 extern chardev_t kbrd;200 if(x != 0x0d) {201 if(x == 0x7f)202 x = '\b';203 chardev_push_character(&kbrd, x);204 }205 #endif206 207 191 } 208 192 return ch; … … 215 199 void ns16550_poll(void) 216 200 { 217 #ifndef CONFIG_NS16550_INTERRUPT_DRIVEN 201 #ifndef CONFIG_NS16550_INTERRUPT_DRIVEN 218 202 ipl_t ipl; 219 203 … … 241 225 242 226 x = ns16550_rbr_read(&ns16550); 243 #ifndef ia64 227 244 228 if (x != IGNORE_CODE) { 245 229 if (x & KEY_RELEASE) … … 248 232 key_pressed(x); 249 233 } 250 #else251 extern chardev_t kbrd;252 if(x != 0x0d) {253 if (x == 0x7f)254 x = '\b';255 chardev_push_character(&kbrd, x);256 }257 #endif258 259 234 } 260 235 }
Note:
See TracChangeset
for help on using the changeset viewer.