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