Changeset 28ecadb in mainline for kernel/arch/sparc64/src/console.c
- Timestamp:
- 2006-09-22T21:44:54Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5d684e4
- Parents:
- 16529d5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/sparc64/src/console.c
r16529d5 r28ecadb 54 54 #include <arch/mm/tlb.h> 55 55 #include <arch/boot/boot.h> 56 #include <genarch/ofw/ofw_tree.h> 56 57 #include <arch.h> 58 #include <panic.h> 59 #include <print.h> 57 60 58 61 #define KEYBOARD_POLL_PAUSE 50000 /* 50ms */ … … 62 65 { 63 66 stdin = NULL; 64 67 68 ofw_tree_node_t *aliases; 69 ofw_tree_property_t *prop; 70 ofw_tree_node_t *screen; 71 ofw_tree_node_t *keyboard; 72 73 aliases = ofw_tree_lookup("/aliases"); 74 if (!aliases) 75 panic("Can't find /aliases.\n"); 76 77 prop = ofw_tree_getprop(aliases, "screen"); 78 if (!prop) 79 panic("Can't find property \"screen\".\n"); 80 if (!prop->value) 81 panic("Can't find screen alias.\n"); 82 screen = ofw_tree_lookup(prop->value); 83 if (!screen) 84 panic("Can't find %s\n", prop->value); 85 65 86 fb_init(bootinfo.screen.addr, bootinfo.screen.width, bootinfo.screen.height, 66 87 bootinfo.screen.bpp, bootinfo.screen.scanline, true); 88 89 prop = ofw_tree_getprop(aliases, "keyboard"); 90 if (!prop) 91 panic("Can't find property \"keyboard\".\n"); 92 if (!prop->value) 93 panic("Can't find keyboard alias.\n"); 94 keyboard = ofw_tree_lookup(prop->value); 95 if (!keyboard) 96 panic("Can't find %s\n", prop->value); 67 97 68 #ifdef KBD_ADDR_OVRD 69 if (!bootinfo.keyboard.addr) 70 bootinfo.keyboard.addr = KBD_ADDR_OVRD; 71 #endif 72 73 if (bootinfo.keyboard.addr) 74 kbd_init(); 98 kbd_init(keyboard); 75 99 } 76 100 … … 83 107 thread_detach(THREAD); 84 108 85 if (!bootinfo.keyboard.addr)86 return;87 88 while (1) {89 109 #ifdef CONFIG_Z8530 110 if (kbd_type == KBD_Z8530) 90 111 return; 91 112 #endif 113 114 while (1) { 92 115 #ifdef CONFIG_NS16550 93 ns16550_poll(); 116 if (kbd_type == KBD_NS16550) 117 ns16550_poll(); 94 118 #endif 95 119 thread_usleep(KEYBOARD_POLL_PAUSE); … … 103 127 { 104 128 #ifdef CONFIG_Z8530 105 z8530_grab(); 129 if (kbd_type == KBD_Z8530) 130 z8530_grab(); 106 131 #endif 107 132 } … … 113 138 { 114 139 #ifdef CONFIG_Z8530 115 z8530_release(); 140 if (kbd_type == KBD_Z8530) 141 z8530_release(); 116 142 #endif 117 143 }
Note:
See TracChangeset
for help on using the changeset viewer.