1 /* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 * or http://www.opensolaris.org/os/licensing. 10 * See the License for the specific language governing permissions 11 * and limitations under the License. 12 * 13 * When distributing Covered Code, include this CDDL HEADER in each 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 * If applicable, add the following below this CDDL HEADER, with the 16 * fields enclosed by brackets "[]" replaced with your own identifying 17 * information: Portions Copyright [yyyy] [name of copyright owner] 18 * 19 * CDDL HEADER END 20 */ 21 /* 22 * Copyright 2007 Sun Microsystems, Inc. All rights reserved. 23 * Use is subject to license terms. 24 */ 25 26 /* 27 * Keyboard table for bootstrap's simple keyboard driver. 28 */ 29 30 #include "boot_keyboard_table.h" 31 32 #define A | KBTYPE_ALPHA 33 #define C & 0x1f 34 #define F | KBTYPE_FUNC 35 #define N | KBTYPE_NUMPAD 36 37 #define ALT KBTYPE_SPEC_ALT 38 #define CTRL KBTYPE_SPEC_CTRL 39 #define LSHIFT KBTYPE_SPEC_LSHIFT 40 #define NOP KBTYPE_SPEC_NOP 41 #define NUMLK KBTYPE_SPEC_NUM_LOCK 42 #define SCRLLK KBTYPE_SPEC_SCROLL_LOCK 43 #define CAPSLK KBTYPE_SPEC_CAPS_LOCK 44 #define RSHIFT KBTYPE_SPEC_RSHIFT 45 #define REBOOT KBTYPE_SPEC_MAYBE_REBOOT 46 #define UNDEF KBTYPE_SPEC_UNDEF 47 48 struct keyboard_translate keyboard_translate[128] = { 49 /* Normal Shifted Ctrled Alted */ 50 { /* 00 */ UNDEF, UNDEF, UNDEF, UNDEF }, 51 { /* 01 */ '['C, '['C, NOP, NOP }, 52 { /* 02 */ '1', '!', NOP, 0x78 F }, 53 { /* 03 */ '2', '@', NOP, 0x79 F }, 54 { /* 04 */ '3', '#', NOP, 0x7a F }, 55 { /* 05 */ '4', '$', NOP, 0x7b F }, 56 { /* 06 */ '5', '%', NOP, 0x7c F }, 57 { /* 07 */ '6', '^', '^'C, 0x7d F }, 58 { /* 08 */ '7', '&', NOP, 0x7e F }, 59 { /* 09 */ '8', '*', NOP, 0x7f F }, 60 { /* 0a */ '9', '(', NOP, 0x80 F }, 61 { /* 0b */ '0', ')', NOP, 0x81 F }, 62 { /* 0c */ '-', '_', NOP, 0x82 F }, 63 { /* 0d */ '=', '+', NOP, 0x83 F }, 64 { /* 0e */ 'h'C, 0x0e F, 0x7f, NOP }, 65 { /* 0f */ 'i'C, 0x0f F, NOP, NOP }, 66 { /* 10 */ 'q'A, 'Q', 'q'C, 0x10 F }, 67 { /* 11 */ 'w'A, 'W', 'w'C, 0x11 F }, 68 { /* 12 */ 'e'A, 'E', 'e'C, 0x12 F }, 69 { /* 13 */ 'r'A, 'R', 'r'C, 0x13 F }, 70 { /* 14 */ 't'A, 'T', 't'C, 0x14 F }, 71 { /* 15 */ 'y'A, 'Y', 'y'C, 0x15 F }, 72 { /* 16 */ 'u'A, 'U', 'u'C, 0x16 F }, 73 { /* 17 */ 'i'A, 'I', 'i'C, 0x17 F }, 74 { /* 18 */ 'o'A, 'O', 'o'C, 0x18 F }, 75 { /* 19 */ 'p'A, 'P', 'p'C, 0x19 F }, 76 { /* 1a */ '[', '{', '['C, NOP }, 77 { /* 1b */ ']', '}', ']'C, NOP }, 78 { /* 1c */ 'm'C, 'm'C, NOP, NOP }, 79 { /* 1d */ CTRL, CTRL, CTRL, CTRL }, 80 { /* 1e */ 'a'A, 'A', 'a'C, 0x1e F }, 81 { /* 1f */ 's'A, 'S', 's'C, 0x1f F }, 82 { /* 20 */ 'd'A, 'D', 'd'C, 0x20 F }, 83 { /* 21 */ 'f'A, 'F', 'f'C, 0x21 F }, 84 { /* 22 */ 'g'A, 'G', 'g'C, 0x22 F }, 85 { /* 23 */ 'h'A, 'H', 'h'C, 0x23 F }, 86 { /* 24 */ 'j'A, 'J', 'j'C, 0x24 F }, 87 { /* 25 */ 'k'A, 'K', 'k'C, 0x25 F }, 88 { /* 26 */ 'l'A, 'L', 'l'C, 0x26 F }, 89 { /* 27 */ ';', ':', NOP, NOP }, 90 { /* 28 */ '\'', '"', NOP, NOP }, 91 { /* 29 */ '`', '~', NOP, NOP }, 92 { /* 2a */ LSHIFT, LSHIFT, LSHIFT, LSHIFT }, 93 { /* 2b */ '\\', '|', '\\'C, NOP }, 94 { /* 2c */ 'z'A, 'Z', 'z'C, 0x2c F }, 95 { /* 2d */ 'x'A, 'X', 'x'C, 0x2d F }, 96 { /* 2e */ 'c'A, 'C', 'c'C, 0x2e F }, 97 { /* 2f */ 'v'A, 'V', 'v'C, 0x2f F }, 98 { /* 30 */ 'b'A, 'B', 'b'C, 0x30 F }, 99 { /* 31 */ 'n'A, 'N', 'n'C, 0x31 F }, 100 { /* 32 */ 'm'A, 'M', 'm'C, 0x32 F }, 101 { /* 33 */ ',', '<', NOP, NOP }, 102 { /* 34 */ '.', '>', NOP, NOP }, 103 { /* 35 */ '/', '?', NOP, NOP }, 104 { /* 36 */ RSHIFT, RSHIFT, RSHIFT, RSHIFT }, 105 { /* 37 */ '*', NOP, NOP, NOP }, /* * PrtSc */ 106 { /* 38 */ ALT, ALT, ALT, ALT }, 107 { /* 39 */ ' ', ' ', NOP, NOP }, 108 { /* 3a */ CAPSLK, CAPSLK, CAPSLK, CAPSLK }, 109 { /* 3b */ 0x3b F, 0x54 F, 0x5e F, 0x68 F }, 110 { /* 3c */ 0x3c F, 0x55 F, 0x5f F, 0x69 F }, 111 { /* 3d */ 0x3d F, 0x56 F, 0x60 F, 0x6a F }, 112 { /* 3e */ 0x3e F, 0x57 F, 0x61 F, 0x6b F }, 113 { /* 3f */ 0x3f F, 0x58 F, 0x62 F, 0x6c F }, 114 { /* 40 */ 0x40 F, 0x59 F, 0x63 F, 0x6d F }, 115 { /* 41 */ 0x41 F, 0x5a F, 0x64 F, 0x6e F }, 116 { /* 42 */ 0x42 F, 0x5b F, 0x65 F, 0x6f F }, 117 { /* 43 */ 0x43 F, 0x5c F, 0x66 F, 0x70 F }, 118 { /* 44 */ 0x44 F, 0x5d F, 0x67 F, 0x71 F }, 119 { /* 45 */ NUMLK, NUMLK, NUMLK, NUMLK }, 120 { /* 46 */ SCRLLK, SCRLLK, SCRLLK, SCRLLK }, 121 { /* 47 */ 0x47 N, '7', NOP, NOP }, 122 { /* 48 */ 0x48 N, '8', NOP, NOP }, 123 { /* 49 */ 0x49 N, '9', NOP, NOP }, 124 { /* 4a */ '-', '-', NOP, NOP }, 125 { /* 4b */ 0x4b N, '4', NOP, NOP }, 126 { /* 4c */ NOP, '5', NOP, NOP }, 127 { /* 4d */ 0x4d N, '6', NOP, NOP }, 128 { /* 4e */ '+', '+', NOP, NOP }, 129 { /* 4f */ 0x4f N, '1', NOP, NOP }, 130 { /* 50 */ 0x50 N, '2', NOP, NOP }, 131 { /* 51 */ 0x51 N, '3', NOP, NOP }, 132 { /* 52 */ 0x52 N, '0', NOP, NOP }, 133 { /* 53 */ 0x53 N, '.', REBOOT, REBOOT }, 134 { /* 54 */ NOP, NOP, NOP, NOP }, /* SysReq */ 135 { /* 55 */ UNDEF, UNDEF, UNDEF, UNDEF }, 136 { /* 56 */ UNDEF, UNDEF, UNDEF, UNDEF }, 137 { /* 57 */ UNDEF, UNDEF, UNDEF, UNDEF }, 138 { /* 58 */ UNDEF, UNDEF, UNDEF, UNDEF }, 139 { /* 59 */ UNDEF, UNDEF, UNDEF, UNDEF }, 140 { /* 5a */ UNDEF, UNDEF, UNDEF, UNDEF }, 141 { /* 5b */ UNDEF, UNDEF, UNDEF, UNDEF }, 142 { /* 5c */ UNDEF, UNDEF, UNDEF, UNDEF }, 143 { /* 5d */ UNDEF, UNDEF, UNDEF, UNDEF }, 144 { /* 5e */ UNDEF, UNDEF, UNDEF, UNDEF }, 145 { /* 5f */ UNDEF, UNDEF, UNDEF, UNDEF }, 146 { /* 60 */ UNDEF, UNDEF, UNDEF, UNDEF }, 147 { /* 61 */ UNDEF, UNDEF, UNDEF, UNDEF }, 148 { /* 62 */ UNDEF, UNDEF, UNDEF, UNDEF }, 149 { /* 63 */ UNDEF, UNDEF, UNDEF, UNDEF }, 150 { /* 64 */ UNDEF, UNDEF, UNDEF, UNDEF }, 151 { /* 65 */ UNDEF, UNDEF, UNDEF, UNDEF }, 152 { /* 66 */ UNDEF, UNDEF, UNDEF, UNDEF }, 153 { /* 67 */ UNDEF, UNDEF, UNDEF, UNDEF }, 154 { /* 68 */ UNDEF, UNDEF, UNDEF, UNDEF }, 155 { /* 69 */ UNDEF, UNDEF, UNDEF, UNDEF }, 156 { /* 6a */ UNDEF, UNDEF, UNDEF, UNDEF }, 157 { /* 6b */ UNDEF, UNDEF, UNDEF, UNDEF }, 158 { /* 6c */ UNDEF, UNDEF, UNDEF, UNDEF }, 159 { /* 6d */ UNDEF, UNDEF, UNDEF, UNDEF }, 160 { /* 6e */ UNDEF, UNDEF, UNDEF, UNDEF }, 161 { /* 6f */ UNDEF, UNDEF, UNDEF, UNDEF }, 162 { /* 70 */ UNDEF, UNDEF, UNDEF, UNDEF }, 163 { /* 71 */ UNDEF, UNDEF, UNDEF, UNDEF }, 164 { /* 72 */ UNDEF, UNDEF, UNDEF, UNDEF }, 165 { /* 73 */ UNDEF, UNDEF, UNDEF, UNDEF }, 166 { /* 74 */ UNDEF, UNDEF, UNDEF, UNDEF }, 167 { /* 75 */ UNDEF, UNDEF, UNDEF, UNDEF }, 168 { /* 76 */ UNDEF, UNDEF, UNDEF, UNDEF }, 169 { /* 77 */ UNDEF, UNDEF, UNDEF, UNDEF }, 170 { /* 78 */ UNDEF, UNDEF, UNDEF, UNDEF }, 171 { /* 79 */ UNDEF, UNDEF, UNDEF, UNDEF }, 172 { /* 7a */ UNDEF, UNDEF, UNDEF, UNDEF }, 173 { /* 7b */ UNDEF, UNDEF, UNDEF, UNDEF }, 174 { /* 7c */ UNDEF, UNDEF, UNDEF, UNDEF }, 175 { /* 7d */ UNDEF, UNDEF, UNDEF, UNDEF }, 176 { /* 7e */ UNDEF, UNDEF, UNDEF, UNDEF }, 177 { /* 7f */ UNDEF, UNDEF, UNDEF, UNDEF } 178 };