Changeset 6fa9a99d in mainline for uspace/lib/c/generic/io/kio.c
- Timestamp:
- 2014-01-05T17:50:01Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 91db0280
- Parents:
- 208b5f5
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/io/kio.c
r208b5f5 r6fa9a99d 39 39 #include <unistd.h> 40 40 #include <errno.h> 41 #include <abi/k log.h>42 #include <io/k log.h>41 #include <abi/kio.h> 42 #include <io/kio.h> 43 43 #include <io/printf_core.h> 44 44 45 size_t k log_write(const void *buf, size_t size)45 size_t kio_write(const void *buf, size_t size) 46 46 { 47 ssize_t ret = (ssize_t) __SYSCALL3(SYS_K LOG, KLOG_WRITE, (sysarg_t) buf, size);47 ssize_t ret = (ssize_t) __SYSCALL3(SYS_KIO, KIO_WRITE, (sysarg_t) buf, size); 48 48 49 49 if (ret >= 0) … … 53 53 } 54 54 55 void k log_update(void)55 void kio_update(void) 56 56 { 57 (void) __SYSCALL3(SYS_K LOG, KLOG_UPDATE, (uintptr_t) NULL, 0);57 (void) __SYSCALL3(SYS_KIO, KIO_UPDATE, (uintptr_t) NULL, 0); 58 58 } 59 59 60 void k log_command(const void *buf, size_t size)60 void kio_command(const void *buf, size_t size) 61 61 { 62 (void) __SYSCALL3(SYS_K LOG, KLOG_COMMAND, (sysarg_t) buf, (sysarg_t) size);62 (void) __SYSCALL3(SYS_KIO, KIO_COMMAND, (sysarg_t) buf, (sysarg_t) size); 63 63 } 64 64 65 /** Print formatted text to k log.65 /** Print formatted text to kio. 66 66 * 67 67 * @param fmt Format string … … 70 70 * 71 71 */ 72 int k log_printf(const char *fmt, ...)72 int kio_printf(const char *fmt, ...) 73 73 { 74 74 va_list args; 75 75 va_start(args, fmt); 76 76 77 int ret = k log_vprintf(fmt, args);77 int ret = kio_vprintf(fmt, args); 78 78 79 79 va_end(args); … … 82 82 } 83 83 84 static int k log_vprintf_str_write(const char *str, size_t size, void *data)84 static int kio_vprintf_str_write(const char *str, size_t size, void *data) 85 85 { 86 size_t wr = k log_write(str, size);86 size_t wr = kio_write(str, size); 87 87 return str_nlength(str, wr); 88 88 } 89 89 90 static int k log_vprintf_wstr_write(const wchar_t *str, size_t size, void *data)90 static int kio_vprintf_wstr_write(const wchar_t *str, size_t size, void *data) 91 91 { 92 92 size_t offset = 0; … … 98 98 99 99 if (chr_encode(str[chars], buf, &sz, STR_BOUNDS(1)) == EOK) 100 k log_write(buf, sz);100 kio_write(buf, sz); 101 101 102 102 chars++; … … 107 107 } 108 108 109 /** Print formatted text to k log.109 /** Print formatted text to kio. 110 110 * 111 111 * @param fmt Format string … … 115 115 * 116 116 */ 117 int k log_vprintf(const char *fmt, va_list ap)117 int kio_vprintf(const char *fmt, va_list ap) 118 118 { 119 119 printf_spec_t ps = { 120 k log_vprintf_str_write,121 k log_vprintf_wstr_write,120 kio_vprintf_str_write, 121 kio_vprintf_wstr_write, 122 122 NULL 123 123 };
Note:
See TracChangeset
for help on using the changeset viewer.