Changeset c7c6afd in mainline for kernel/generic/src/log/log.c


Ignore:
Timestamp:
2025-04-13T23:27:44Z (3 months ago)
Author:
GitHub <noreply@…>
Children:
b6061f8c
Parents:
240b2e4 (diff), f5e1692 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Wayne Thornton <wmthornton-dev@…> (2025-04-13 23:27:44)
git-committer:
GitHub <noreply@…> (2025-04-13 23:27:44)
Message:

Merge branch 'HelenOS:master' into master

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/log/log.c

    r240b2e4 rc7c6afd  
    3333 */
    3434
    35 #include <sysinfo/sysinfo.h>
    36 #include <synch/spinlock.h>
    37 #include <typedefs.h>
     35#include <abi/log.h>
     36#include <arch.h>
     37#include <atomic.h>
     38#include <console/console.h>
     39#include <ddi/ddi.h>
    3840#include <ddi/irq.h>
    39 #include <ddi/ddi.h>
     41#include <errno.h>
    4042#include <ipc/event.h>
    4143#include <ipc/irq.h>
    42 #include <arch.h>
     44#include <log.h>
    4345#include <panic.h>
     46#include <print.h>
     47#include <printf_core.h>
    4448#include <putchar.h>
    45 #include <atomic.h>
     49#include <stdarg.h>
     50#include <stdlib.h>
     51#include <str.h>
     52#include <synch/spinlock.h>
    4653#include <syscall/copy.h>
    47 #include <errno.h>
    48 #include <str.h>
    49 #include <print.h>
    50 #include <printf/printf_core.h>
    51 #include <stdarg.h>
    52 #include <log.h>
    53 #include <console/console.h>
    54 #include <abi/log.h>
    55 #include <stdlib.h>
     54#include <sysinfo/sysinfo.h>
     55#include <typedefs.h>
    5656
    5757#define LOG_PAGES    8
     
    204204{
    205205        size_t offset = 0;
    206         size_t chars = 0;
    207 
    208         while (offset < size) {
     206
     207        while (offset < size)
    209208                kio_push_char(str_decode(str, &offset, size));
    210                 chars++;
    211         }
    212209
    213210        log_append((const uint8_t *)str, size);
    214211
    215         return chars;
    216 }
    217 
    218 static int log_printf_wstr_write(const char32_t *wstr, size_t size, void *data)
    219 {
    220         char buffer[16];
    221         size_t offset = 0;
    222         size_t chars = 0;
    223 
    224         for (offset = 0; offset < size; offset += sizeof(char32_t), chars++) {
    225                 kio_push_char(wstr[chars]);
    226 
    227                 size_t buffer_offset = 0;
    228                 errno_t rc = chr_encode(wstr[chars], buffer, &buffer_offset, 16);
    229                 if (rc != EOK) {
    230                         return EOF;
    231                 }
    232 
    233                 log_append((const uint8_t *)buffer, buffer_offset);
    234         }
    235 
    236         return chars;
     212        return EOK;
    237213}
    238214
     
    243219int log_vprintf(const char *fmt, va_list args)
    244220{
    245         int ret;
    246 
    247221        printf_spec_t ps = {
    248222                log_printf_str_write,
    249                 log_printf_wstr_write,
    250223                NULL
    251224        };
    252225
    253         ret = printf_core(fmt, &ps, args);
    254 
    255         return ret;
     226        return printf_core(fmt, &ps, args);
    256227}
    257228
Note: See TracChangeset for help on using the changeset viewer.