Changes in kernel/generic/src/console/console.c [712c4ba:0fe52ef] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/console/console.c
r712c4ba r0fe52ef 87 87 }; 88 88 89 static void stdout_write(outdev_t *, wchar_t , bool);89 static void stdout_write(outdev_t *, wchar_t); 90 90 static void stdout_redraw(outdev_t *); 91 91 … … 95 95 }; 96 96 97 /** Silence output */98 bool silent= false;97 /** Override kernel console lockout */ 98 bool console_override = false; 99 99 100 100 /** Standard input and output character devices */ … … 122 122 } 123 123 124 static void stdout_write(outdev_t *dev, wchar_t ch, bool silent) 125 { 126 link_t *cur; 127 128 for (cur = dev->list.next; cur != &dev->list; cur = cur->next) { 124 static void stdout_write(outdev_t *dev, wchar_t ch) 125 { 126 list_foreach(dev->list, cur) { 129 127 outdev_t *sink = list_get_instance(cur, outdev_t, link); 130 128 if ((sink) && (sink->op->write)) 131 sink->op->write(sink, ch , silent);129 sink->op->write(sink, ch); 132 130 } 133 131 } … … 135 133 static void stdout_redraw(outdev_t *dev) 136 134 { 137 link_t *cur; 138 139 for (cur = dev->list.next; cur != &dev->list; cur = cur->next) { 135 list_foreach(dev->list, cur) { 140 136 outdev_t *sink = list_get_instance(cur, outdev_t, link); 141 137 if ((sink) && (sink->op->redraw)) … … 160 156 klog_parea.frames = SIZE2FRAMES(sizeof(klog)); 161 157 klog_parea.unpriv = false; 158 klog_parea.mapped = false; 162 159 ddi_parea_register(&klog_parea); 163 160 … … 171 168 void grab_console(void) 172 169 { 173 bool prev = silent;174 175 silent = false;170 bool prev = console_override; 171 172 console_override = true; 176 173 if ((stdout) && (stdout->op->redraw)) 177 174 stdout->op->redraw(stdout); 178 175 179 if ((stdin) && ( prev)) {176 if ((stdin) && (!prev)) { 180 177 /* 181 178 * Force the console to print the prompt. … … 187 184 void release_console(void) 188 185 { 189 // FIXME arch_release_console 190 silent = true; 191 } 192 193 /** Tell kernel to get keyboard/console access again */ 194 sysarg_t sys_debug_enable_console(void) 186 console_override = false; 187 } 188 189 /** Activate kernel console override */ 190 sysarg_t sys_debug_activate_console(void) 195 191 { 196 192 #ifdef CONFIG_KCONSOLE … … 200 196 return false; 201 197 #endif 202 }203 204 /** Tell kernel to relinquish keyboard/console access */205 sysarg_t sys_debug_disable_console(void)206 {207 release_console();208 return true;209 198 } 210 199 … … 259 248 } 260 249 261 void klog_update(void )250 void klog_update(void *event) 262 251 { 263 252 if (!atomic_get(&klog_inited)) … … 293 282 */ 294 283 spinlock_unlock(&klog_lock); 295 stdout->op->write(stdout, tmp , silent);284 stdout->op->write(stdout, tmp); 296 285 spinlock_lock(&klog_lock); 297 286 } … … 321 310 * it should be no longer buffered. 322 311 */ 323 stdout->op->write(stdout, ch , silent);312 stdout->op->write(stdout, ch); 324 313 } else { 325 314 /* … … 338 327 /* Force notification on newline */ 339 328 if (ch == '\n') 340 klog_update( );329 klog_update(NULL); 341 330 } 342 331 … … 369 358 free(data); 370 359 } else 371 klog_update( );360 klog_update(NULL); 372 361 373 362 return size;
Note:
See TracChangeset
for help on using the changeset viewer.