Changeset 6fa9a99d in mainline


Ignore:
Timestamp:
2014-01-05T17:50:01Z (10 years ago)
Author:
Martin Sucha <sucha14@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
91db0280
Parents:
208b5f5
Message:

Rename klog to kio

Files:
23 edited
6 moved

Legend:

Unmodified
Added
Removed
  • .bzrignore

    r208b5f5 r6fa9a99d  
    3333uspace/app/kill/kill
    3434uspace/app/killall/killall
    35 uspace/app/klog/klog
     35uspace/app/kio/kio
    3636uspace/app/loc/loc
    3737uspace/app/logset/logset
     
    8282uspace/dist/app/kill
    8383uspace/dist/app/killall
    84 uspace/dist/app/klog
     84uspace/dist/app/kio
    8585uspace/dist/app/loc
    8686uspace/dist/app/logset
  • abi/include/abi/ipc/event.h

    r208b5f5 r6fa9a99d  
    3838/** Global events */
    3939typedef enum event_type {
    40         /** New data available in kernel log */
    41         EVENT_KLOG = 0,
     40        /** New data available in kernel character buffer */
     41        EVENT_KIO = 0,
    4242        /** Returning from kernel console to uspace */
    4343        EVENT_KCONSOLE,
  • abi/include/abi/kio.h

    r208b5f5 r6fa9a99d  
    3333 */
    3434
    35 #ifndef ABI_KLOG_H_
    36 #define ABI_KLOG_H_
     35#ifndef ABI_KIO_H_
     36#define ABI_KIO_H_
    3737
    3838enum {
    39         KLOG_UNKNOW,
    40         KLOG_WRITE,
    41         KLOG_UPDATE,
    42         KLOG_COMMAND
     39        KIO_UNKNOW,
     40        KIO_WRITE,
     41        KIO_UPDATE,
     42        KIO_COMMAND
    4343};
    4444
  • abi/include/abi/syscall.h

    r208b5f5 r6fa9a99d  
    3737
    3838typedef enum {
    39         SYS_KLOG = 0,
     39        SYS_KIO = 0,
    4040        SYS_TLS_SET = 1,  /* Hardcoded for AMD64, IA-32 (fibril.S in uspace) */
    4141       
  • boot/Makefile.common

    r208b5f5 r6fa9a99d  
    161161        $(USPACE_PATH)/app/bdsh/bdsh \
    162162        $(USPACE_PATH)/app/getterm/getterm \
    163         $(USPACE_PATH)/app/klog/klog \
     163        $(USPACE_PATH)/app/kio/kio \
    164164        $(USPACE_PATH)/app/vlaunch/vlaunch \
    165165        $(USPACE_PATH)/app/vterm/vterm
  • contrib/arch/HelenOS.adl

    r208b5f5 r6fa9a99d  
    2222       
    2323        /* Kernel log */
    24         inst klog klog;
     24        inst kio kio;
    2525       
    2626        [/uspace/lib/libc/bind%ns]
     
    3030        [/uspace/lib/libc/bind%vfs]
    3131        [/uspace/lib/libc/bind%console]
    32         [/uspace/lib/libc/bind%klog]
     32        [/uspace/lib/libc/bind%kio]
    3333       
    3434        bind ns:kbd to console:kbd;
     
    5858        bind console:sys_console to kernel:sys_console;
    5959       
    60         bind klog:ns to ns:ns;
     60        bind kio:ns to ns:ns;
    6161};
  • contrib/arch/kernel/kernel.adl

    r208b5f5 r6fa9a99d  
    33 *****************************/
    44
    5 interface sys_klog {
     5interface sys_kio {
    66                /* Print using kernel facility */
    7                 sysarg_t sys_klog(int fd, const void *buf, size_t size);
    8         protocol:
    9                 ?sys_klog*
     7                sysarg_t sys_kio(int fd, const void *buf, size_t size);
     8        protocol:
     9                ?sys_kio*
    1010};
    1111
     
    251251frame sys_console {
    252252        provides:
    253                 sys_klog sys_klog;
     253                sys_kio sys_kio;
    254254                sys_console sys_console;
    255255};
     
    316316        inst sys_debug sys_debug;
    317317       
    318         delegate sys_klog to sys_console:sys_klog;
     318        delegate sys_kio to sys_console:sys_kio;
    319319        delegate sys_console to sys_console:sys_console;
    320320        delegate sys_tls to sys_proc:sys_tls;
  • contrib/arch/uspace/app/kio/kio.adl

    r208b5f5 r6fa9a99d  
    1 frame klog {
     1frame kio {
    22        requires:
    33                naming_service ns;
    44                [/uspace/lib/libc/requires]
    55        initialization:
    6                 !ns.ipc_m_share_in /* SERVICE_MEM_KLOG */
     6                !ns.ipc_m_share_in /* SERVICE_MEM_KIO */
    77        protocol:
    88                [/uspace/lib/libc/protocol]
  • contrib/arch/uspace/lib/libc/bind

    r208b5f5 r6fa9a99d  
    11/* Bind %% to kernel interfaces */
    2 bind %%:sys_klog to kernel:sys_klog;
     2bind %%:sys_kio to kernel:sys_kio;
    33bind %%:sys_tls to kernel:sys_tls;
    44bind %%:sys_thread to kernel:sys_thread;
  • contrib/arch/uspace/lib/libc/protocol

    r208b5f5 r6fa9a99d  
    11/* Protocol according to which libc uses kernel syscalls */
    22(
    3         !sys_klog.sys_klog +
     3        !sys_kio.sys_kio +
    44        !sys_tls.sys_tls_set +
    55        !sys_thread.sys_thread_create +
  • contrib/arch/uspace/lib/libc/requires

    r208b5f5 r6fa9a99d  
    11/* Kernel interfaces required by libc */
    2 sys_klog sys_klog;
     2sys_kio sys_kio;
    33sys_tls sys_tls;
    44sys_thread sys_thread;
  • contrib/arch/uspace/lib/libc/subsume

    r208b5f5 r6fa9a99d  
    11/* Subsume %% to kernel interfaces */
    2 subsume %%:sys_klog to sys_klog;
     2subsume %%:sys_kio to sys_kio;
    33subsume %%:sys_tls to sys_tls;
    44subsume %%:sys_thread to sys_thread;
  • contrib/arch/uspace/srv/ns/ns.adl

    r208b5f5 r6fa9a99d  
    66                sysarg_t ipc_m_connect_me_to(in sysarg_t service, in sysarg_t arg2, in sysarg_t arg3, in sysarg_t flags);
    77               
    8                 /* Share real-time clock page or klog page */
     8                /* Share real-time clock page or kio page */
    99                sysarg_t ipc_m_share_in(in sysarg_t as_area_base, in sysarg_t as_area_size, in sysarg_t service);
    1010               
  • kernel/doc/doxygroups.h

    r208b5f5 r6fa9a99d  
    167167 */
    168168 
    169 /** @defgroup genericklog KLog
    170  * @brief Kernel logging facility
     169/** @defgroup generickio KIO
     170 * @brief Kernel character input/output facility
    171171 * @ingroup genericconsole
    172172 */
  • kernel/generic/include/console/console.h

    r208b5f5 r6fa9a99d  
    6262extern void console_init(void);
    6363
    64 extern void klog_init(void);
    65 extern void klog_update(void *);
     64extern void kio_init(void);
     65extern void kio_update(void *);
    6666
    6767extern wchar_t getc(indev_t *indev);
    6868extern size_t gets(indev_t *indev, char *buf, size_t buflen);
    69 extern sysarg_t sys_klog(int cmd, const void *buf, size_t size);
     69extern sysarg_t sys_kio(int cmd, const void *buf, size_t size);
    7070
    7171extern void grab_console(void);
  • kernel/generic/src/console/console.c

    r208b5f5 r6fa9a99d  
    5252#include <errno.h>
    5353#include <str.h>
    54 #include <abi/klog.h>
    55 
    56 #define KLOG_PAGES    8
    57 #define KLOG_LENGTH   (KLOG_PAGES * PAGE_SIZE / sizeof(wchar_t))
     54#include <abi/kio.h>
     55
     56#define KIO_PAGES    8
     57#define KIO_LENGTH   (KIO_PAGES * PAGE_SIZE / sizeof(wchar_t))
    5858
    5959/** Kernel log cyclic buffer */
    60 wchar_t klog[KLOG_LENGTH] __attribute__((aligned(PAGE_SIZE)));
     60wchar_t kio[KIO_LENGTH] __attribute__((aligned(PAGE_SIZE)));
    6161
    6262/** Kernel log initialized */
    63 static atomic_t klog_inited = {false};
     63static atomic_t kio_inited = {false};
    6464
    6565/** First kernel log characters */
    66 static size_t klog_start = 0;
     66static size_t kio_start = 0;
    6767
    6868/** Number of valid kernel log characters */
    69 static size_t klog_len = 0;
     69static size_t kio_len = 0;
    7070
    7171/** Number of stored (not printed) kernel log characters */
    72 static size_t klog_stored = 0;
     72static size_t kio_stored = 0;
    7373
    7474/** Number of stored kernel log characters for uspace */
    75 static size_t klog_uspace = 0;
     75static size_t kio_uspace = 0;
    7676
    7777/** Kernel log spinlock */
    78 SPINLOCK_STATIC_INITIALIZE_NAME(klog_lock, "klog_lock");
    79 
    80 /** Physical memory area used for klog buffer */
    81 static parea_t klog_parea;
     78SPINLOCK_STATIC_INITIALIZE_NAME(kio_lock, "kio_lock");
     79
     80/** Physical memory area used for kio buffer */
     81static parea_t kio_parea;
    8282
    8383static indev_t stdin_sink;
     
    146146 *
    147147 */
    148 void klog_init(void)
    149 {
    150         void *faddr = (void *) KA2PA(klog);
     148void kio_init(void)
     149{
     150        void *faddr = (void *) KA2PA(kio);
    151151       
    152152        ASSERT((uintptr_t) faddr % FRAME_SIZE == 0);
    153153       
    154         klog_parea.pbase = (uintptr_t) faddr;
    155         klog_parea.frames = SIZE2FRAMES(sizeof(klog));
    156         klog_parea.unpriv = false;
    157         klog_parea.mapped = false;
    158         ddi_parea_register(&klog_parea);
    159        
    160         sysinfo_set_item_val("klog.faddr", NULL, (sysarg_t) faddr);
    161         sysinfo_set_item_val("klog.pages", NULL, KLOG_PAGES);
    162        
    163         event_set_unmask_callback(EVENT_KLOG, klog_update);
    164         atomic_set(&klog_inited, true);
     154        kio_parea.pbase = (uintptr_t) faddr;
     155        kio_parea.frames = SIZE2FRAMES(sizeof(kio));
     156        kio_parea.unpriv = false;
     157        kio_parea.mapped = false;
     158        ddi_parea_register(&kio_parea);
     159       
     160        sysinfo_set_item_val("kio.faddr", NULL, (sysarg_t) faddr);
     161        sysinfo_set_item_val("kio.pages", NULL, KIO_PAGES);
     162       
     163        event_set_unmask_callback(EVENT_KIO, kio_update);
     164        atomic_set(&kio_inited, true);
    165165}
    166166
     
    247247}
    248248
    249 void klog_update(void *event)
    250 {
    251         if (!atomic_get(&klog_inited))
     249void kio_update(void *event)
     250{
     251        if (!atomic_get(&kio_inited))
    252252                return;
    253253       
    254         spinlock_lock(&klog_lock);
    255        
    256         if (klog_uspace > 0) {
    257                 if (event_notify_3(EVENT_KLOG, true, klog_start, klog_len,
    258                     klog_uspace) == EOK)
    259                         klog_uspace = 0;
    260         }
    261        
    262         spinlock_unlock(&klog_lock);
     254        spinlock_lock(&kio_lock);
     255       
     256        if (kio_uspace > 0) {
     257                if (event_notify_3(EVENT_KIO, true, kio_start, kio_len,
     258                    kio_uspace) == EOK)
     259                        kio_uspace = 0;
     260        }
     261       
     262        spinlock_unlock(&kio_lock);
    263263}
    264264
     
    267267        bool ordy = ((stdout) && (stdout->op->write));
    268268       
    269         spinlock_lock(&klog_lock);
     269        spinlock_lock(&kio_lock);
    270270       
    271271        /* Print charaters stored in kernel log */
    272272        if (ordy) {
    273                 while (klog_stored > 0) {
    274                         wchar_t tmp = klog[(klog_start + klog_len - klog_stored) % KLOG_LENGTH];
    275                         klog_stored--;
     273                while (kio_stored > 0) {
     274                        wchar_t tmp = kio[(kio_start + kio_len - kio_stored) % KIO_LENGTH];
     275                        kio_stored--;
    276276                       
    277277                        /*
     
    280280                         * the character.
    281281                         */
    282                         spinlock_unlock(&klog_lock);
     282                        spinlock_unlock(&kio_lock);
    283283                        stdout->op->write(stdout, tmp);
    284                         spinlock_lock(&klog_lock);
     284                        spinlock_lock(&kio_lock);
    285285                }
    286286        }
    287287       
    288288        /* Store character in the cyclic kernel log */
    289         klog[(klog_start + klog_len) % KLOG_LENGTH] = ch;
    290         if (klog_len < KLOG_LENGTH)
    291                 klog_len++;
     289        kio[(kio_start + kio_len) % KIO_LENGTH] = ch;
     290        if (kio_len < KIO_LENGTH)
     291                kio_len++;
    292292        else
    293                 klog_start = (klog_start + 1) % KLOG_LENGTH;
     293                kio_start = (kio_start + 1) % KIO_LENGTH;
    294294       
    295295        if (!ordy) {
    296                 if (klog_stored < klog_len)
    297                         klog_stored++;
     296                if (kio_stored < kio_len)
     297                        kio_stored++;
    298298        }
    299299       
    300300        /* The character is stored for uspace */
    301         if (klog_uspace < klog_len)
    302                 klog_uspace++;
    303        
    304         spinlock_unlock(&klog_lock);
     301        if (kio_uspace < kio_len)
     302                kio_uspace++;
     303       
     304        spinlock_unlock(&kio_lock);
    305305       
    306306        if (ordy) {
     
    326326        /* Force notification on newline */
    327327        if (ch == '\n')
    328                 klog_update(NULL);
     328                kio_update(NULL);
    329329}
    330330
     
    334334 *
    335335 */
    336 sysarg_t sys_klog(int cmd, const void *buf, size_t size)
     336sysarg_t sys_kio(int cmd, const void *buf, size_t size)
    337337{
    338338        char *data;
     
    340340
    341341        switch (cmd) {
    342         case KLOG_UPDATE:
    343                 klog_update(NULL);
     342        case KIO_UPDATE:
     343                kio_update(NULL);
    344344                return EOK;
    345         case KLOG_WRITE:
    346         case KLOG_COMMAND:
     345        case KIO_WRITE:
     346        case KIO_COMMAND:
    347347                break;
    348348        default:
     
    366366               
    367367                switch (cmd) {
    368                 case KLOG_WRITE:
     368                case KIO_WRITE:
    369369                        printf("%s", data);
    370370                        break;
    371                 case KLOG_COMMAND:
     371                case KIO_COMMAND:
    372372                        if (!stdin)
    373373                                break;
  • kernel/generic/src/main/main.c

    r208b5f5 r6fa9a99d  
    281281        ipc_init();
    282282        event_init();
    283         klog_init();
     283        kio_init();
    284284        stats_init();
    285285       
  • kernel/generic/src/syscall/syscall.c

    r208b5f5 r6fa9a99d  
    120120syshandler_t syscall_table[SYSCALL_END] = {
    121121        /* System management syscalls. */
    122         (syshandler_t) sys_klog,
     122        (syshandler_t) sys_kio,
    123123        (syshandler_t) sys_tls_set,
    124124       
  • uspace/Makefile

    r208b5f5 r6fa9a99d  
    5050        app/kill \
    5151        app/killall \
    52         app/klog \
     52        app/kio \
    5353        app/loc \
    5454        app/logset \
  • uspace/app/kio/Makefile

    r208b5f5 r6fa9a99d  
    3131LIBS = $(LIBCLUI_PREFIX)/libclui.a
    3232EXTRA_CFLAGS = -I$(LIBCLUI_PREFIX)
    33 BINARY = klog
     33BINARY = kio
    3434
    3535SOURCES = \
    36         klog.c
     36        kio.c
    3737
    3838include $(USPACE_PREFIX)/Makefile.common
  • uspace/app/kio/kio.c

    r208b5f5 r6fa9a99d  
    2727 */
    2828
    29 /** @addtogroup klog KLog
    30  * @brief HelenOS KLog
     29/** @addtogroup kio KIO
     30 * @brief HelenOS KIO
    3131 * @{
    3232 */
     
    4242#include <errno.h>
    4343#include <str_error.h>
    44 #include <io/klog.h>
     44#include <io/kio.h>
    4545#include <sysinfo.h>
    4646#include <malloc.h>
     
    5050#include <tinput.h>
    5151
    52 #define NAME       "klog"
    53 #define LOG_FNAME  "/log/klog"
     52#define NAME       "kio"
     53#define LOG_FNAME  "/log/kio"
    5454
    5555/* Producer/consumer buffers */
     
    6262static prodcons_t pc;
    6363
    64 /* Pointer to klog area */
    65 static wchar_t *klog;
    66 static size_t klog_length;
     64/* Pointer to kio area */
     65static wchar_t *kio;
     66static size_t kio_length;
    6767
    6868/* Notification mutex */
     
    7575 *
    7676 * @param length Number of characters to copy.
    77  * @param data   Pointer to the kernel klog buffer.
     77 * @param data   Pointer to the kernel kio buffer.
    7878 *
    7979 */
     
    142142/** Kernel notification handler
    143143 *
    144  * Receives kernel klog notifications.
     144 * Receives kernel kio notifications.
    145145 *
    146146 * @param callid IPC call ID
     
    156156         * starving.
    157157         *
    158          * Note: Usually the automatic masking of the klog
     158         * Note: Usually the automatic masking of the kio
    159159         * notifications on the kernel side does the trick
    160160         * of limiting the chance of accidentally copying
    161161         * the same data multiple times. However, due to
    162          * the non-blocking architecture of klog notifications,
     162         * the non-blocking architecture of kio notifications,
    163163         * this possibility cannot be generally avoided.
    164164         */
     
    166166        fibril_mutex_lock(&mtx);
    167167       
    168         size_t klog_start = (size_t) IPC_GET_ARG1(*call);
    169         size_t klog_len = (size_t) IPC_GET_ARG2(*call);
    170         size_t klog_stored = (size_t) IPC_GET_ARG3(*call);
    171        
    172         size_t offset = (klog_start + klog_len - klog_stored) % klog_length;
     168        size_t kio_start = (size_t) IPC_GET_ARG1(*call);
     169        size_t kio_len = (size_t) IPC_GET_ARG2(*call);
     170        size_t kio_stored = (size_t) IPC_GET_ARG3(*call);
     171       
     172        size_t offset = (kio_start + kio_len - kio_stored) % kio_length;
    173173       
    174174        /* Copy data from the ring buffer */
    175         if (offset + klog_stored >= klog_length) {
    176                 size_t split = klog_length - offset;
    177                
    178                 producer(split, klog + offset);
    179                 producer(klog_stored - split, klog);
     175        if (offset + kio_stored >= kio_length) {
     176                size_t split = kio_length - offset;
     177               
     178                producer(split, kio + offset);
     179                producer(kio_stored - split, kio);
    180180        } else
    181                 producer(klog_stored, klog + offset);
    182        
    183         event_unmask(EVENT_KLOG);
     181                producer(kio_stored, kio + offset);
     182       
     183        event_unmask(EVENT_KIO);
    184184        fibril_mutex_unlock(&mtx);
    185185}
     
    188188{
    189189        size_t pages;
    190         int rc = sysinfo_get_value("klog.pages", &pages);
    191         if (rc != EOK) {
    192                 fprintf(stderr, "%s: Unable to get number of klog pages\n",
     190        int rc = sysinfo_get_value("kio.pages", &pages);
     191        if (rc != EOK) {
     192                fprintf(stderr, "%s: Unable to get number of kio pages\n",
    193193                    NAME);
    194194                return rc;
     
    196196       
    197197        uintptr_t faddr;
    198         rc = sysinfo_get_value("klog.faddr", &faddr);
    199         if (rc != EOK) {
    200                 fprintf(stderr, "%s: Unable to get klog physical address\n",
     198        rc = sysinfo_get_value("kio.faddr", &faddr);
     199        if (rc != EOK) {
     200                fprintf(stderr, "%s: Unable to get kio physical address\n",
    201201                    NAME);
    202202                return rc;
     
    204204       
    205205        size_t size = pages * PAGE_SIZE;
    206         klog_length = size / sizeof(wchar_t);
     206        kio_length = size / sizeof(wchar_t);
    207207       
    208208        rc = physmem_map(faddr, pages, AS_AREA_READ | AS_AREA_CACHEABLE,
    209             (void *) &klog);
    210         if (rc != EOK) {
    211                 fprintf(stderr, "%s: Unable to map klog\n", NAME);
     209            (void *) &kio);
     210        if (rc != EOK) {
     211                fprintf(stderr, "%s: Unable to map kio\n", NAME);
    212212                return rc;
    213213        }
     
    215215        prodcons_initialize(&pc);
    216216        async_set_interrupt_received(notification_received);
    217         rc = event_subscribe(EVENT_KLOG, 0);
    218         if (rc != EOK) {
    219                 fprintf(stderr, "%s: Unable to register klog notifications\n",
     217        rc = event_subscribe(EVENT_KIO, 0);
     218        if (rc != EOK) {
     219                fprintf(stderr, "%s: Unable to register kio notifications\n",
    220220                    NAME);
    221221                return rc;
     
    236236
    237237        fibril_add_ready(fid);
    238         event_unmask(EVENT_KLOG);
    239         klog_update();
    240        
    241         tinput_set_prompt(input, "klog> ");
     238        event_unmask(EVENT_KIO);
     239        kio_update();
     240       
     241        tinput_set_prompt(input, "kio> ");
    242242
    243243        char *str;
     
    248248                }
    249249
    250                 klog_command(str, str_size(str));
     250                kio_command(str, str_size(str));
    251251                free(str);
    252252        }
  • uspace/app/trace/syscalls.c

    r208b5f5 r6fa9a99d  
    3838
    3939const sc_desc_t syscall_desc[] = {
    40     [SYS_KLOG] ={ "klog",                               3,      V_INT_ERRNO },
     40    [SYS_KIO] ={ "kio",                                 3,      V_INT_ERRNO },
    4141    [SYS_TLS_SET] = { "tls_set",                        1,      V_ERRNO },
    4242
  • uspace/lib/c/Makefile

    r208b5f5 r6fa9a99d  
    107107        generic/io/log.c \
    108108        generic/io/logctl.c \
    109         generic/io/klog.c \
     109        generic/io/kio.c \
    110110        generic/io/snprintf.c \
    111111        generic/io/vprintf.c \
  • uspace/lib/c/generic/assert.c

    r208b5f5 r6fa9a99d  
    3333#include <assert.h>
    3434#include <stdio.h>
    35 #include <io/klog.h>
     35#include <io/kio.h>
    3636#include <stdlib.h>
    3737#include <atomic.h>
     
    4444{
    4545        /*
    46          * Send the message safely to klog. Nested asserts should not occur.
     46         * Send the message safely to kio. Nested asserts should not occur.
    4747         */
    48         klog_printf("Assertion failed (%s) in file \"%s\", line %u.\n",
     48        kio_printf("Assertion failed (%s) in file \"%s\", line %u.\n",
    4949            cond, file, line);
    5050       
  • uspace/lib/c/generic/io/io.c

    r208b5f5 r6fa9a99d  
    4242#include <malloc.h>
    4343#include <async.h>
    44 #include <io/klog.h>
     44#include <io/kio.h>
    4545#include <vfs/vfs.h>
    4646#include <vfs/vfs_sess.h>
     
    5757        .error = true,
    5858        .eof = true,
    59         .klog = false,
     59        .kio = false,
    6060        .sess = NULL,
    6161        .btype = _IONBF,
     
    6767};
    6868
    69 static FILE stdout_klog = {
     69static FILE stdout_kio = {
    7070        .fd = -1,
    7171        .error = false,
    7272        .eof = false,
    73         .klog = true,
     73        .kio = true,
    7474        .sess = NULL,
    7575        .btype = _IOLBF,
     
    8181};
    8282
    83 static FILE stderr_klog = {
     83static FILE stderr_kio = {
    8484        .fd = -1,
    8585        .error = false,
    8686        .eof = false,
    87         .klog = true,
     87        .kio = true,
    8888        .sess = NULL,
    8989        .btype = _IONBF,
     
    113113                stdout = fdopen(1, "w");
    114114        } else {
    115                 stdout = &stdout_klog;
     115                stdout = &stdout_kio;
    116116                list_append(&stdout->link, &files);
    117117        }
     
    120120                stderr = fdopen(2, "w");
    121121        } else {
    122                 stderr = &stderr_klog;
     122                stderr = &stderr_kio;
    123123                list_append(&stderr->link, &files);
    124124        }
     
    267267        stream->error = false;
    268268        stream->eof = false;
    269         stream->klog = false;
     269        stream->kio = false;
    270270        stream->sess = NULL;
    271271        stream->need_sync = false;
     
    289289        stream->error = false;
    290290        stream->eof = false;
    291         stream->klog = false;
     291        stream->kio = false;
    292292        stream->sess = NULL;
    293293        stream->need_sync = false;
     
    314314       
    315315        if ((stream != &stdin_null)
    316             && (stream != &stdout_klog)
    317             && (stream != &stderr_klog))
     316            && (stream != &stdout_kio)
     317            && (stream != &stderr_kio))
    318318                free(stream);
    319319       
     
    382382                ssize_t wr;
    383383               
    384                 if (stream->klog)
    385                         wr = klog_write(buf + done, left);
     384                if (stream->kio)
     385                        wr = kio_write(buf + done, left);
    386386                else
    387387                        wr = write(stream->fd, buf + done, left);
     
    705705        _fflushbuf(stream);
    706706       
    707         if (stream->klog) {
    708                 klog_update();
     707        if (stream->kio) {
     708                kio_update();
    709709                return EOK;
    710710        }
     
    740740int fileno(FILE *stream)
    741741{
    742         if (stream->klog) {
     742        if (stream->kio) {
    743743                errno = EBADF;
    744744                return -1;
  • uspace/lib/c/generic/io/kio.c

    r208b5f5 r6fa9a99d  
    3939#include <unistd.h>
    4040#include <errno.h>
    41 #include <abi/klog.h>
    42 #include <io/klog.h>
     41#include <abi/kio.h>
     42#include <io/kio.h>
    4343#include <io/printf_core.h>
    4444
    45 size_t klog_write(const void *buf, size_t size)
     45size_t kio_write(const void *buf, size_t size)
    4646{
    47         ssize_t ret = (ssize_t) __SYSCALL3(SYS_KLOG, KLOG_WRITE, (sysarg_t) buf, size);
     47        ssize_t ret = (ssize_t) __SYSCALL3(SYS_KIO, KIO_WRITE, (sysarg_t) buf, size);
    4848       
    4949        if (ret >= 0)
     
    5353}
    5454
    55 void klog_update(void)
     55void kio_update(void)
    5656{
    57         (void) __SYSCALL3(SYS_KLOG, KLOG_UPDATE, (uintptr_t) NULL, 0);
     57        (void) __SYSCALL3(SYS_KIO, KIO_UPDATE, (uintptr_t) NULL, 0);
    5858}
    5959
    60 void klog_command(const void *buf, size_t size)
     60void kio_command(const void *buf, size_t size)
    6161{
    62         (void) __SYSCALL3(SYS_KLOG, KLOG_COMMAND, (sysarg_t) buf, (sysarg_t) size);
     62        (void) __SYSCALL3(SYS_KIO, KIO_COMMAND, (sysarg_t) buf, (sysarg_t) size);
    6363}
    6464
    65 /** Print formatted text to klog.
     65/** Print formatted text to kio.
    6666 *
    6767 * @param fmt Format string
     
    7070 *
    7171 */
    72 int klog_printf(const char *fmt, ...)
     72int kio_printf(const char *fmt, ...)
    7373{
    7474        va_list args;
    7575        va_start(args, fmt);
    7676       
    77         int ret = klog_vprintf(fmt, args);
     77        int ret = kio_vprintf(fmt, args);
    7878       
    7979        va_end(args);
     
    8282}
    8383
    84 static int klog_vprintf_str_write(const char *str, size_t size, void *data)
     84static int kio_vprintf_str_write(const char *str, size_t size, void *data)
    8585{
    86         size_t wr = klog_write(str, size);
     86        size_t wr = kio_write(str, size);
    8787        return str_nlength(str, wr);
    8888}
    8989
    90 static int klog_vprintf_wstr_write(const wchar_t *str, size_t size, void *data)
     90static int kio_vprintf_wstr_write(const wchar_t *str, size_t size, void *data)
    9191{
    9292        size_t offset = 0;
     
    9898               
    9999                if (chr_encode(str[chars], buf, &sz, STR_BOUNDS(1)) == EOK)
    100                         klog_write(buf, sz);
     100                        kio_write(buf, sz);
    101101               
    102102                chars++;
     
    107107}
    108108
    109 /** Print formatted text to klog.
     109/** Print formatted text to kio.
    110110 *
    111111 * @param fmt Format string
     
    115115 *
    116116 */
    117 int klog_vprintf(const char *fmt, va_list ap)
     117int kio_vprintf(const char *fmt, va_list ap)
    118118{
    119119        printf_spec_t ps = {
    120                 klog_vprintf_str_write,
    121                 klog_vprintf_wstr_write,
     120                kio_vprintf_str_write,
     121                kio_vprintf_wstr_write,
    122122                NULL
    123123        };
  • uspace/lib/c/generic/private/stdio.h

    r208b5f5 r6fa9a99d  
    5353        int eof;
    5454       
    55         /** Klog indicator */
    56         int klog;
     55        /** KIO indicator */
     56        int kio;
    5757       
    5858        /** Session to the file provider */
  • uspace/lib/c/include/io/kio.h

    r208b5f5 r6fa9a99d  
    3333 */
    3434
    35 #ifndef LIBC_IO_KLOG_H_
    36 #define LIBC_IO_KLOG_H_
     35#ifndef LIBC_IO_KIO_H_
     36#define LIBC_IO_KIO_H_
    3737
    3838#include <sys/types.h>
     
    4040#include <io/verify.h>
    4141
    42 extern size_t klog_write(const void *, size_t);
    43 extern void klog_update(void);
    44 extern void klog_command(const void *, size_t);
    45 extern int klog_printf(const char *, ...)
     42extern size_t kio_write(const void *, size_t);
     43extern void kio_update(void);
     44extern void kio_command(const void *, size_t);
     45extern int kio_printf(const char *, ...)
    4646    PRINTF_ATTRIBUTE(1, 2);
    47 extern int klog_vprintf(const char *, va_list);
     47extern int kio_vprintf(const char *, va_list);
    4848
    4949#endif
  • uspace/lib/c/include/stdio.h

    r208b5f5 r6fa9a99d  
    4040#include <str.h>
    4141#include <io/verify.h>
    42 #include <abi/klog.h>
     42#include <abi/kio.h>
    4343
    4444#define EOF  (-1)
     
    5252                int _n = snprintf(_buf, sizeof(_buf), fmt, ##__VA_ARGS__); \
    5353                if (_n > 0) \
    54                         (void) __SYSCALL3(SYS_KLOG, KLOG_WRITE, (sysarg_t) _buf, str_size(_buf)); \
     54                        (void) __SYSCALL3(SYS_KIO, KIO_WRITE, (sysarg_t) _buf, str_size(_buf)); \
    5555        }
    5656
Note: See TracChangeset for help on using the changeset viewer.