Changeset d667767 in mainline
- Timestamp:
- 2006-06-07T00:13:07Z (18 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 590cb380
- Parents:
- ae971b3e
- Location:
- arch/ppc32
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/ppc32/include/drivers/cuda.h
rae971b3e rd667767 36 36 37 37 extern void cuda_init(__address base, size_t size); 38 extern __u8cuda_get_scancode(void);38 extern int cuda_get_scancode(void); 39 39 40 40 #endif -
arch/ppc32/src/drivers/cuda.c
rae971b3e rd667767 36 36 #include <stdarg.h> 37 37 38 #define SPECIAL '?' 39 38 40 #define PACKET_ADB 0x00 39 41 #define PACKET_CUDA 0x01 … … 56 58 57 59 static char lchars[0x80] = { 58 'a', 's', 'd', 'f', 'h', 'g', 'z', 'x', 'c', 'v', 0, 'b', 'q', 'w', 'e', 'r', 59 'y', 't', '1', '2', '3', '4', '6', '5', '=', '9', '7', '-', '8', '0', ']', 'o', 60 'u', '[', 'i', 'p', 13, 'l', 'j', '\'', 'k', ';', '\\', ',', '/', 'n', 'm', '.', 61 9, 32, '`', 8, 0, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62 0, '.', 0, '*', 0, '+', 0, 0, 0, 0, 0, '/', 13, 0, '-', 0, 63 0, 0, '0', '1', '2', '3', '4', '5', '6', '7', 0, '8', '9', 0, 0, 0, 64 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 60 'a', 61 's', 62 'd', 63 'f', 64 'h', 65 'g', 66 'z', 67 'x', 68 'c', 69 'v', 70 SPECIAL, 71 'b', 72 'q', 73 'w', 74 'e', 75 'r', 76 'y', 77 't', 78 '1', 79 '2', 80 '3', 81 '4', 82 '6', 83 '5', 84 '=', 85 '9', 86 '7', 87 '-', 88 '8', 89 '0', 90 ']', 91 'o', 92 'u', 93 '[', 94 'i', 95 'p', 96 '\n', /* Enter */ 97 'l', 98 'j', 99 '\'', 100 'k', 101 ';', 102 '\\', 103 ',', 104 '/', 105 'n', 106 'm', 107 '.', 108 '\t', /* Tab */ 109 ' ', 110 '`', 111 '\b', /* Backspace */ 112 SPECIAL, 113 SPECIAL, /* Escape */ 114 SPECIAL, /* Ctrl */ 115 SPECIAL, /* Alt */ 116 SPECIAL, /* Shift */ 117 SPECIAL, /* Caps-Lock */ 118 SPECIAL, /* RAlt */ 119 SPECIAL, /* Left */ 120 SPECIAL, /* Right */ 121 SPECIAL, /* Down */ 122 SPECIAL, /* Up */ 123 SPECIAL, 124 SPECIAL, 125 '.', /* Keypad . */ 126 SPECIAL, 127 '*', /* Keypad * */ 128 SPECIAL, 129 '+', /* Keypad + */ 130 SPECIAL, 131 SPECIAL, /* NumLock */ 132 SPECIAL, 133 SPECIAL, 134 SPECIAL, 135 '/', /* Keypad / */ 136 '\n', /* Keypad Enter */ 137 SPECIAL, 138 '-', /* Keypad - */ 139 SPECIAL, 140 SPECIAL, 141 SPECIAL, 142 '0', /* Keypad 0 */ 143 '1', /* Keypad 1 */ 144 '2', /* Keypad 2 */ 145 '3', /* Keypad 3 */ 146 '4', /* Keypad 4 */ 147 '5', /* Keypad 5 */ 148 '6', /* Keypad 6 */ 149 '7', /* Keypad 7 */ 150 SPECIAL, 151 '8', /* Keypad 8 */ 152 '9', /* Keypad 9 */ 153 SPECIAL, 154 SPECIAL, 155 SPECIAL, 156 SPECIAL, /* F5 */ 157 SPECIAL, /* F6 */ 158 SPECIAL, /* F7 */ 159 SPECIAL, /* F3 */ 160 SPECIAL, /* F8 */ 161 SPECIAL, /* F9 */ 162 SPECIAL, 163 SPECIAL, /* F11 */ 164 SPECIAL, 165 SPECIAL, /* F13 */ 166 SPECIAL, 167 SPECIAL, /* ScrollLock */ 168 SPECIAL, 169 SPECIAL, /* F10 */ 170 SPECIAL, 171 SPECIAL, /* F12 */ 172 SPECIAL, 173 SPECIAL, /* Pause */ 174 SPECIAL, /* Insert */ 175 SPECIAL, /* Home */ 176 SPECIAL, /* PageUp */ 177 SPECIAL, /* Delete */ 178 SPECIAL, /* F4 */ 179 SPECIAL, /* End */ 180 SPECIAL, /* F2 */ 181 SPECIAL, /* PageDown */ 182 SPECIAL /* F1 */ 66 183 }; 67 184 … … 112 229 113 230 114 __u8cuda_get_scancode(void)231 int cuda_get_scancode(void) 115 232 { 116 233 __u8 kind; … … 122 239 return data[2]; 123 240 124 return 0; 125 } 126 241 return -1; 242 } 127 243 128 244 static void cuda_irq(int n, istate_t *istate) 129 245 { 130 __u8 scancode = cuda_get_scancode(); 131 132 if ((scancode != 0) && ((scancode & 0x80) != 0x80)) 133 chardev_push_character(&kbrd, lchars[scancode & 0x7f]); 246 int scan_code = cuda_get_scancode(); 247 248 if (scan_code != -1) { 249 __u8 scancode = (__u8) scan_code; 250 if ((scancode & 0x80) != 0x80) 251 chardev_push_character(&kbrd, lchars[scancode & 0x7f]); 252 } 134 253 } 135 254
Note:
See TracChangeset
for help on using the changeset viewer.