Changeset 965dc18 in mainline for kernel/arch/sparc64/src/console.c
- Timestamp:
- 2008-12-05T19:59:03Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 49093a4
- Parents:
- 0258e67
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/sparc64/src/console.c
r0258e67 r965dc18 39 39 #include <arch/drivers/kbd.h> 40 40 41 #include <arch/drivers/sgcn.h> 42 41 43 #ifdef CONFIG_Z8530 42 44 #include <genarch/kbd/z8530.h> … … 55 57 #include <arch.h> 56 58 #include <panic.h> 59 #include <func.h> 57 60 #include <print.h> 58 61 59 62 #define KEYBOARD_POLL_PAUSE 50000 /* 50ms */ 60 63 61 /** Initialize kernel console to use framebuffer and keyboard directly. */ 62 void standalone_sparc64_console_init(void) 64 /** 65 * Initialize kernel console to use framebuffer and keyboard directly. 66 * Called on UltraSPARC machines with standard keyboard and framebuffer. 67 * 68 * @param aliases the "/aliases" OBP node 69 */ 70 static void standard_console_init(ofw_tree_node_t *aliases) 63 71 { 64 72 stdin = NULL; 65 73 66 ofw_tree_node_t *aliases;67 74 ofw_tree_property_t *prop; 68 75 ofw_tree_node_t *screen; 69 76 ofw_tree_node_t *keyboard; 70 71 aliases = ofw_tree_lookup("/aliases");72 if (!aliases)73 panic("Can't find /aliases.\n");74 77 75 78 prop = ofw_tree_getprop(aliases, "screen"); … … 96 99 } 97 100 101 /** Initilize I/O on the Serengeti machine. */ 102 static void serengeti_init(void) 103 { 104 sgcn_init(); 105 } 106 107 /** 108 * Initialize input/output. Auto-detects the type of machine 109 * and calls the appropriate I/O init routine. 110 */ 111 void standalone_sparc64_console_init(void) 112 { 113 ofw_tree_node_t *aliases; 114 ofw_tree_property_t *prop; 115 116 aliases = ofw_tree_lookup("/aliases"); 117 if (!aliases) 118 panic("Can't find /aliases.\n"); 119 120 /* "def-cn" = "default console" */ 121 prop = ofw_tree_getprop(aliases, "def-cn"); 122 123 if ((!prop) || (!prop->value) || (strcmp(prop->value, "/sgcn") != 0)) { 124 standard_console_init(aliases); 125 } else { 126 serengeti_init(); 127 } 128 } 129 130 98 131 /** Kernel thread for polling keyboard. 99 132 * … … 130 163 #endif 131 164 #endif 165 #ifdef CONFIG_SGCN 166 if (kbd_type == KBD_SGCN) 167 sgcn_poll(); 168 #endif 132 169 thread_usleep(KEYBOARD_POLL_PAUSE); 133 170 } … … 150 187 break; 151 188 #endif 189 #ifdef CONFIG_SGCN 190 case KBD_SGCN: 191 sgcn_grab(); 192 break; 193 #endif 152 194 default: 153 195 break; … … 171 213 break; 172 214 #endif 215 #ifdef CONFIG_SGCN 216 case KBD_SGCN: 217 sgcn_release(); 218 break; 219 #endif 173 220 default: 174 221 break;
Note:
See TracChangeset
for help on using the changeset viewer.