Changeset a801688b in mainline
- Timestamp:
- 2012-11-23T20:25:27Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ec85df0
- Parents:
- 2f33fbc
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/console/console.h
r2f33fbc ra801688b 67 67 extern wchar_t getc(indev_t *indev); 68 68 extern size_t gets(indev_t *indev, char *buf, size_t buflen); 69 extern sysarg_t sys_klog(int fd, const void *buf, size_t size);69 extern sysarg_t sys_klog(int cmd, const void *buf, size_t size); 70 70 71 71 extern void grab_console(void); -
kernel/generic/src/console/console.c
r2f33fbc ra801688b 52 52 #include <errno.h> 53 53 #include <str.h> 54 #include <abi/klog.h> 54 55 55 56 #define KLOG_PAGES 8 … … 335 336 * 336 337 */ 337 sysarg_t sys_klog(int fd, const void *buf, size_t size)338 sysarg_t sys_klog(int cmd, const void *buf, size_t size) 338 339 { 339 340 char *data; 340 341 int rc; 341 342 343 switch (cmd) { 344 case KLOG_UPDATE: 345 klog_update(NULL); 346 return EOK; 347 case KLOG_WRITE: 348 case KLOG_COMMAND: 349 break; 350 default: 351 return ENOTSUP; 352 } 353 342 354 if (size > PAGE_SIZE) 343 355 return (sysarg_t) ELIMIT; -
uspace/lib/c/generic/io/klog.c
r2f33fbc ra801688b 39 39 #include <unistd.h> 40 40 #include <errno.h> 41 #include <abi/klog.h> 41 42 #include <io/klog.h> 42 43 #include <io/printf_core.h> … … 44 45 size_t klog_write(const void *buf, size_t size) 45 46 { 46 ssize_t ret = (ssize_t) __SYSCALL3(SYS_KLOG, 1, (sysarg_t) buf, size);47 ssize_t ret = (ssize_t) __SYSCALL3(SYS_KLOG, KLOG_WRITE, (sysarg_t) buf, size); 47 48 48 49 if (ret >= 0) … … 54 55 void klog_update(void) 55 56 { 56 (void) __SYSCALL3(SYS_KLOG, 1, (uintptr_t) NULL, 0);57 (void) __SYSCALL3(SYS_KLOG, KLOG_UPDATE, (uintptr_t) NULL, 0); 57 58 } 58 59 -
uspace/lib/c/include/stdio.h
r2f33fbc ra801688b 40 40 #include <str.h> 41 41 #include <io/verify.h> 42 #include <abi/klog.h> 42 43 43 44 #define EOF (-1) … … 51 52 int _n = snprintf(_buf, sizeof(_buf), fmt, ##__VA_ARGS__); \ 52 53 if (_n > 0) \ 53 (void) __SYSCALL3(SYS_KLOG, 1, (sysarg_t) _buf, str_size(_buf)); \54 (void) __SYSCALL3(SYS_KLOG, KLOG_WRITE, (sysarg_t) _buf, str_size(_buf)); \ 54 55 } 55 56
Note:
See TracChangeset
for help on using the changeset viewer.