Changeset ac0cb2a in mainline
- Timestamp:
- 2005-12-08T00:29:53Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 944b15c
- Parents:
- 9d5e23c
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/mips32/include/drivers/arc.h
r9d5e23c rac0cb2a 178 178 long (*close)(__u32 fileid); 179 179 long (*read)(__u32 fileid,void *buf,__u32 n,__u32 *cnt); 180 long (*getreadstatus)( );180 long (*getreadstatus)(__u32 fileid); 181 181 long (*write)(__u32 fileid, void *buf,__u32 n,__u32 *cnt); 182 182 long (*seek)(void); /* ... */ … … 213 213 extern void arc_putchar(char ch); 214 214 extern void arc_print_devices(void); 215 215 extern int arc_getchar(void); 216 216 #endif -
arch/mips32/include/drivers/keyboard.h
r9d5e23c rac0cb2a 38 38 extern void keyboard_init(void); 39 39 extern void keyboard(void); 40 40 extern void keyboard_poll(void); 41 41 42 42 #endif -
arch/mips32/src/drivers/arc.c
r9d5e23c rac0cb2a 184 184 185 185 } 186 187 /** Try to get character, return character or -1 if not available */ 188 int arc_getchar(void) 189 { 190 char ch; 191 __u32 count; 192 long result; 193 194 if (arc_entry->getreadstatus(0)) 195 return -1; 196 result = arc_entry->read(0, &ch, 1, &count); 197 if (result || count!=1) { 198 cpu_halt(); 199 return -1; 200 } 201 if (ch == '\r') 202 return '\n'; 203 return ch; 204 } -
arch/mips32/src/drivers/keyboard.c
r9d5e23c rac0cb2a 36 36 #include <synch/waitq.h> 37 37 #include <typedefs.h> 38 #include <arch/drivers/arc.h> 38 39 39 40 static void keyboard_enable(void); 40 41 static void keyboard_disable(void); 42 static void arc_kb_disable(void); 43 static void arc_kb_enable(void); 41 44 42 45 static chardev_t kbrd; 43 static chardev_operations_t ops = { 46 47 static chardev_operations_t arc_ops = { 48 .resume = arc_kb_enable, 49 .suspend = arc_kb_disable 50 }; 51 52 static chardev_operations_t msim_ops = { 44 53 .resume = keyboard_enable, 45 54 .suspend = keyboard_disable 46 55 }; 47 56 57 static int arc_kb_enabled; 58 48 59 /** Initialize keyboard subsystem. */ 49 60 void keyboard_init(void) 50 61 { 51 cp0_unmask_int(KEYBOARD_IRQ); 52 chardev_initialize(&kbrd, &ops); 62 if (arc_enabled()) { 63 chardev_initialize(&kbrd, &arc_ops); 64 arc_kb_enabled = 1; 65 } else { 66 cp0_unmask_int(KEYBOARD_IRQ); 67 chardev_initialize(&kbrd, &msim_ops); 68 } 53 69 stdin = &kbrd; 54 70 } … … 74 90 cp0_mask_int(KEYBOARD_IRQ); 75 91 } 92 93 /*****************************/ 94 /* Arc keyboard */ 95 96 void keyboard_poll(void) 97 { 98 int ch; 99 100 if (!arc_enabled() || !arc_kb_enabled) 101 return; 102 while ((ch = arc_getchar()) != -1) 103 chardev_push_character(&kbrd, ch); 104 } 105 106 static void arc_kb_enable(void) 107 { 108 arc_kb_enabled = 1; 109 } 110 111 /* Called from getc(). */ 112 static void arc_kb_disable(void) 113 { 114 arc_kb_enabled = 0; 115 } -
arch/mips32/src/interrupt.c
r9d5e23c rac0cb2a 126 126 cp0_compare_write(cp0_count_read() + cp0_compare_value); 127 127 clock(); 128 keyboard_poll(); 128 129 break; 129 130 } -
tools/config.py
r9d5e23c rac0cb2a 189 189 if defopt: 190 190 kw['default-item'] = choices[defopt][0] 191 res,data = self.calldlg('--extra-label',button[1], 191 res,data = self.calldlg('--ok-label','Change', 192 '--extra-label',button[1], 192 193 '--extra-button', 193 194 '--menu',text,height,width,
Note:
See TracChangeset
for help on using the changeset viewer.