Changes in kernel/generic/src/console/console.c [98000fb:a71c158] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/console/console.c
r98000fb ra71c158 71 71 72 72 /** Kernel log spinlock */ 73 SPINLOCK_ INITIALIZE(klog_lock);73 SPINLOCK_STATIC_INITIALIZE_NAME(klog_lock, "*klog_lock"); 74 74 75 75 /** Physical memory area used for klog buffer */ 76 76 static parea_t klog_parea; 77 78 static indev_t stdin_sink; 79 static outdev_t stdout_source; 77 80 78 81 static indev_operations_t stdin_ops = { … … 80 83 }; 81 84 85 static void stdout_write(outdev_t *dev, wchar_t ch, bool silent); 86 static void stdout_redraw(outdev_t *dev); 87 88 static outdev_operations_t stdout_ops = { 89 .write = stdout_write, 90 .redraw = stdout_redraw 91 }; 92 82 93 /** Silence output */ 83 94 bool silent = false; … … 90 101 { 91 102 if (stdin == NULL) { 92 stdin = malloc(sizeof(indev_t), FRAME_ATOMIC); 93 if (stdin != NULL) 94 indev_initialize("stdin", stdin, &stdin_ops); 103 indev_initialize("stdin", &stdin_sink, &stdin_ops); 104 stdin = &stdin_sink; 95 105 } 96 106 97 107 return stdin; 108 } 109 110 void stdout_wire(outdev_t *outdev) 111 { 112 if (stdout == NULL) { 113 outdev_initialize("stdout", &stdout_source, &stdout_ops); 114 stdout = &stdout_source; 115 } 116 117 list_append(&outdev->link, &stdout->list); 118 } 119 120 static void stdout_write(outdev_t *dev, wchar_t ch, bool silent) 121 { 122 link_t *cur; 123 124 for (cur = dev->list.next; cur != &dev->list; cur = cur->next) { 125 outdev_t *sink = list_get_instance(cur, outdev_t, link); 126 if ((sink) && (sink->op->write)) 127 sink->op->write(sink, ch, silent); 128 } 129 } 130 131 static void stdout_redraw(outdev_t *dev) 132 { 133 link_t *cur; 134 135 for (cur = dev->list.next; cur != &dev->list; cur = cur->next) { 136 outdev_t *sink = list_get_instance(cur, outdev_t, link); 137 if ((sink) && (sink->op->redraw)) 138 sink->op->redraw(sink); 139 } 98 140 } 99 141 … … 128 170 129 171 silent = false; 130 arch_grab_console(); 172 if ((stdout) && (stdout->op->redraw)) 173 stdout->op->redraw(stdout); 131 174 132 175 /* Force the console to print the prompt */ … … 137 180 void release_console(void) 138 181 { 182 // FIXME arch_release_console 139 183 silent = true; 140 arch_release_console();141 184 } 142 185
Note:
See TracChangeset
for help on using the changeset viewer.