Changeset c640876 in mainline for kernel/arch/ia64/src/ski/ski.c
- Timestamp:
- 2009-03-12T20:08:43Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- afdd441
- Parents:
- 7ee8c5b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ia64/src/ski/ski.c
r7ee8c5b rc640876 44 44 #include <arch.h> 45 45 46 static chardev_t *skiout; 47 48 static chardev_t ski_stdout; 46 static indev_t skiin; /**< Ski input device. */ 47 static outdev_t skiout; /**< Ski output device. */ 49 48 50 49 static bool kbd_disabled; … … 58 57 * @param ch Character to be printed. 59 58 */ 60 static void ski_putchar( chardev_t *d, const char ch, bool silent)59 static void ski_putchar(outdev_t *d, const char ch, bool silent) 61 60 { 62 61 if (!silent) { … … 75 74 } 76 75 77 static chardev_operations_t ski_ops = { 76 static indev_operations_t skiin_ops = { 77 .poll = NULL 78 }; 79 80 static outdev_operations_t skiout_ops = { 78 81 .write = ski_putchar 79 82 }; … … 109 112 { 110 113 char ch; 111 ipl_t ipl; 112 113 ipl = interrupts_disable(); 114 115 if (kbd_disabled) { 116 interrupts_restore(ipl); 114 115 if (kbd_disabled) 117 116 return; 118 }119 120 117 ch = ski_getchar(); 121 118 if(ch == '\r') 122 119 ch = '\n'; 123 if (ch && skiout) { 124 chardev_push_character(skiout, ch); 125 interrupts_restore(ipl); 120 if (ch) { 121 indev_push_character(&skiin, ch); 126 122 return; 127 123 } 128 129 interrupts_restore(ipl);130 124 } 131 125 … … 148 142 * to open debug console. 149 143 */ 150 void ski_console_init(chardev_t *devout) 151 { 144 static void ski_init(void) 145 { 146 static bool initialized; 147 148 if (initialized) 149 return; 150 152 151 asm volatile ( 153 152 "mov r15 = %0\n" … … 157 156 : "r15", "r8" 158 157 ); 159 160 skiout = devout; 161 chardev_initialize("ski_stdout", &ski_stdout, &ski_ops); 162 stdout = &ski_stdout; 163 158 159 initialized = true; 160 } 161 162 indev_t *skiin_init(void) 163 { 164 ski_init(); 165 166 indev_initialize("skiin", &skiin, &skiin_ops); 164 167 thread_t *t = thread_create(kkbdpoll, NULL, TASK, 0, "kkbdpoll", true); 165 if (!t) 166 panic("Cannot create kkbdpoll."); 167 thread_ready(t); 168 if (t) 169 thread_ready(t); 170 else 171 return NULL; 168 172 169 173 sysinfo_set_item_val("kbd", NULL, true); 170 174 sysinfo_set_item_val("kbd.type", NULL, KBD_SKI); 171 175 176 return &skiin; 177 } 178 179 180 void skiout_init(void) 181 { 182 ski_init(); 183 184 outdev_initialize("skiout", &skiout, &skiout_ops); 185 stdout = &skiout; 186 172 187 sysinfo_set_item_val("fb", NULL, false); 173 188 }
Note:
See TracChangeset
for help on using the changeset viewer.