Changes in kernel/generic/src/console/console.c [d7533c7:a71c158] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/console/console.c
rd7533c7 ra71c158 39 39 #include <synch/waitq.h> 40 40 #include <synch/spinlock.h> 41 #include < typedefs.h>41 #include <arch/types.h> 42 42 #include <ddi/irq.h> 43 43 #include <ddi/ddi.h> … … 45 45 #include <ipc/irq.h> 46 46 #include <arch.h> 47 #include <panic.h>48 47 #include <print.h> 49 48 #include <putchar.h> … … 51 50 #include <syscall/copy.h> 52 51 #include <errno.h> 53 #include <str .h>52 #include <string.h> 54 53 55 54 #define KLOG_PAGES 4 … … 62 61 /** Kernel log initialized */ 63 62 static bool klog_inited = false; 64 65 63 /** First kernel log characters */ 66 64 static size_t klog_start = 0; 67 68 65 /** Number of valid kernel log characters */ 69 66 static size_t klog_len = 0; 70 71 67 /** Number of stored (not printed) kernel log characters */ 72 68 static size_t klog_stored = 0; 73 74 69 /** Number of stored kernel log characters for uspace */ 75 70 static size_t klog_uspace = 0; … … 88 83 }; 89 84 90 static void stdout_write(outdev_t * , wchar_t, bool);91 static void stdout_redraw(outdev_t * );85 static void stdout_write(outdev_t *dev, wchar_t ch, bool silent); 86 static void stdout_redraw(outdev_t *dev); 92 87 93 88 static outdev_operations_t stdout_ops = { … … 160 155 klog_parea.pbase = (uintptr_t) faddr; 161 156 klog_parea.frames = SIZE2FRAMES(sizeof(klog)); 162 klog_parea.unpriv = false;163 157 ddi_parea_register(&klog_parea); 164 158 165 sysinfo_set_item_val("klog.faddr", NULL, ( sysarg_t) faddr);159 sysinfo_set_item_val("klog.faddr", NULL, (unative_t) faddr); 166 160 sysinfo_set_item_val("klog.pages", NULL, KLOG_PAGES); 167 161 … … 179 173 stdout->op->redraw(stdout); 180 174 181 if ((stdin) && (prev)) { 182 /* 183 * Force the console to print the prompt. 184 */ 175 /* Force the console to print the prompt */ 176 if ((stdin) && (prev)) 185 177 indev_push_character(stdin, '\n'); 186 }187 178 } 188 179 … … 194 185 195 186 /** Tell kernel to get keyboard/console access again */ 196 sysarg_t sys_debug_enable_console(void)187 unative_t sys_debug_enable_console(void) 197 188 { 198 189 #ifdef CONFIG_KCONSOLE … … 205 196 206 197 /** Tell kernel to relinquish keyboard/console access */ 207 sysarg_t sys_debug_disable_console(void)198 unative_t sys_debug_disable_console(void) 208 199 { 209 200 release_console(); … … 295 286 stdout->op->write(stdout, ch, silent); 296 287 else { 297 /* 298 * No standard output routine defined yet. 299 * The character is still stored in the kernel log 300 * for possible future output. 301 * 302 * The early_putchar() function is used to output 303 * the character for low-level debugging purposes. 304 * Note that the early_putc() function might be 305 * a no-op on certain hardware configurations. 306 * 307 */ 308 early_putchar(ch); 309 288 /* The character is just in the kernel log */ 310 289 if (klog_stored < klog_len) 311 290 klog_stored++; … … 334 313 * 335 314 */ 336 sysarg_t sys_klog(int fd, const void *buf, size_t size)315 unative_t sys_klog(int fd, const void *buf, size_t size) 337 316 { 338 317 char *data; … … 340 319 341 320 if (size > PAGE_SIZE) 342 return (sysarg_t)ELIMIT;321 return ELIMIT; 343 322 344 323 if (size > 0) { 345 324 data = (char *) malloc(size + 1, 0); 346 325 if (!data) 347 return (sysarg_t)ENOMEM;326 return ENOMEM; 348 327 349 328 rc = copy_from_uspace(data, buf, size); 350 329 if (rc) { 351 330 free(data); 352 return (sysarg_t)rc;331 return rc; 353 332 } 354 333 data[size] = 0;
Note:
See TracChangeset
for help on using the changeset viewer.