Changeset b2fa1204 in mainline


Ignore:
Timestamp:
2014-01-05T21:12:26Z (10 years ago)
Author:
Martin Sucha <sucha14@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ca05e9b
Parents:
bd6ff94
Message:

Cherrypick usage of kernel logger

Location:
kernel
Files:
32 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/amd64/src/interrupt.c

    rbd6ff94 rb2fa1204  
    3535#include <arch/interrupt.h>
    3636#include <print.h>
     37#include <log.h>
    3738#include <debug.h>
    3839#include <panic.h>
     
    6667void istate_decode(istate_t *istate)
    6768{
    68         printf("cs =%0#18" PRIx64 "\trip=%0#18" PRIx64 "\t"
     69        log_printf("cs =%0#18" PRIx64 "\trip=%0#18" PRIx64 "\t"
    6970            "rfl=%0#18" PRIx64 "\terr=%0#18" PRIx64 "\n",
    7071            istate->cs, istate->rip, istate->rflags, istate->error_word);
    7172       
    7273        if (istate_from_uspace(istate))
    73                 printf("ss =%0#18" PRIx64 "\n", istate->ss);
    74        
    75         printf("rax=%0#18" PRIx64 "\trbx=%0#18" PRIx64 "\t"
     74                log_printf("ss =%0#18" PRIx64 "\n", istate->ss);
     75       
     76        log_printf("rax=%0#18" PRIx64 "\trbx=%0#18" PRIx64 "\t"
    7677            "rcx=%0#18" PRIx64 "\trdx=%0#18" PRIx64 "\n",
    7778            istate->rax, istate->rbx, istate->rcx, istate->rdx);
    7879       
    79         printf("rsi=%0#18" PRIx64 "\trdi=%0#18" PRIx64 "\t"
     80        log_printf("rsi=%0#18" PRIx64 "\trdi=%0#18" PRIx64 "\t"
    8081            "rbp=%0#18" PRIx64 "\trsp=%0#18" PRIx64 "\n",
    8182            istate->rsi, istate->rdi, istate->rbp,
     
    8384            (uintptr_t) &istate->rsp);
    8485       
    85         printf("r8 =%0#18" PRIx64 "\tr9 =%0#18" PRIx64 "\t"
     86        log_printf("r8 =%0#18" PRIx64 "\tr9 =%0#18" PRIx64 "\t"
    8687            "r10=%0#18" PRIx64 "\tr11=%0#18" PRIx64 "\n",
    8788            istate->r8, istate->r9, istate->r10, istate->r11);
    8889       
    89         printf("r12=%0#18" PRIx64 "\tr13=%0#18" PRIx64 "\t"
     90        log_printf("r12=%0#18" PRIx64 "\tr13=%0#18" PRIx64 "\t"
    9091            "r14=%0#18" PRIx64 "\tr15=%0#18" PRIx64 "\n",
    9192            istate->r12, istate->r13, istate->r14, istate->r15);
     
    193194                 */
    194195#ifdef CONFIG_DEBUG
    195                 printf("cpu%u: spurious interrupt (inum=%u)\n", CPU->id, inum);
     196                log(LF_ARCH, LVL_DEBUG, "cpu%u: spurious interrupt (inum=%u)",
     197                    CPU->id, inum);
    196198#endif
    197199        }
  • kernel/arch/arm32/src/mach/gta02/gta02.c

    rbd6ff94 rb2fa1204  
    4949#include <ddi/ddi.h>
    5050#include <ddi/device.h>
     51#include <log.h>
    5152
    5253#define GTA02_MEMORY_START      0x30000000      /* physical */
     
    149150        } else {
    150151                /* Spurious interrupt.*/
    151                 printf("cpu%d: spurious interrupt (inum=%d)\n",
     152                log(LF_ARCH, LVL_DEBUG, "cpu%d: spurious interrupt (inum=%d)",
    152153                    CPU->id, inum);
    153154        }
  • kernel/arch/arm32/src/mach/integratorcp/integratorcp.c

    rbd6ff94 rb2fa1204  
    4343#include <console/console.h>
    4444#include <sysinfo/sysinfo.h>
    45 #include <print.h>
    4645#include <ddi/device.h>
    4746#include <mm/page.h>
     
    5352#include <abi/fb/visuals.h>
    5453#include <ddi/ddi.h>
    55 #include <print.h>
     54#include <log.h>
     55
    5656
    5757
     
    275275                        } else {
    276276                                /* Spurious interrupt.*/
    277                                 printf("cpu%d: spurious interrupt (inum=%d)\n",
     277                                log(LF_ARCH, LVL_DEBUG,
     278                                    "cpu%d: spurious interrupt (inum=%d)",
    278279                                    CPU->id, i);
    279280                        }
  • kernel/arch/ia32/src/drivers/i8259.c

    rbd6ff94 rb2fa1204  
    4242#include <arch/asm.h>
    4343#include <arch.h>
    44 #include <print.h>
     44#include <log.h>
    4545#include <interrupt.h>
    4646
     
    129129{
    130130#ifdef CONFIG_DEBUG
    131         printf("cpu%u: PIC spurious interrupt\n", CPU->id);
     131        log(LF_ARCH, LVL_DEBUG, "cpu%u: PIC spurious interrupt", CPU->id);
    132132#endif
    133133}
  • kernel/arch/ia32/src/smp/apic.c

    rbd6ff94 rb2fa1204  
    4242#include <interrupt.h>
    4343#include <arch/interrupt.h>
    44 #include <print.h>
     44#include <log.h>
    4545#include <arch/asm.h>
    4646#include <arch.h>
     
    135135{
    136136#ifdef CONFIG_DEBUG
    137         printf("cpu%u: APIC spurious interrupt\n", CPU->id);
     137        log(LF_ARCH, LVL_DEBUG, "cpu%u: APIC spurious interrupt", CPU->id);
    138138#endif
    139139}
     
    241241        esr.value = l_apic[ESR];
    242242       
    243         if (esr.send_checksum_error)
    244                 printf("Send Checksum Error\n");
    245         if (esr.receive_checksum_error)
    246                 printf("Receive Checksum Error\n");
    247         if (esr.send_accept_error)
    248                 printf("Send Accept Error\n");
    249         if (esr.receive_accept_error)
    250                 printf("Receive Accept Error\n");
    251         if (esr.send_illegal_vector)
    252                 printf("Send Illegal Vector\n");
    253         if (esr.received_illegal_vector)
    254                 printf("Received Illegal Vector\n");
    255         if (esr.illegal_register_address)
    256                 printf("Illegal Register Address\n");
     243        if (esr.err_bitmap) {
     244                log_begin(LF_ARCH, LVL_ERROR);
     245                log_printf("APIC errors detected:");
     246                if (esr.send_checksum_error)
     247                        log_printf("\nSend Checksum Error");
     248                if (esr.receive_checksum_error)
     249                        log_printf("\nReceive Checksum Error");
     250                if (esr.send_accept_error)
     251                        log_printf("\nSend Accept Error");
     252                if (esr.receive_accept_error)
     253                        log_printf("\nReceive Accept Error");
     254                if (esr.send_illegal_vector)
     255                        log_printf("\nSend Illegal Vector");
     256                if (esr.received_illegal_vector)
     257                        log_printf("\nReceived Illegal Vector");
     258                if (esr.illegal_register_address)
     259                        log_printf("\nIllegal Register Address");
     260                log_end();
     261        }
    257262       
    258263        return !esr.err_bitmap;
     
    270275                        retries = 0;
    271276#ifdef CONFIG_DEBUG
    272                         printf("IPI is pending.\n");
     277                        log(LF_ARCH, LVL_DEBUG, "IPI is pending.");
    273278#endif
    274279                        delay(20);
     
    489494{
    490495#ifdef LAPIC_VERBOSE
    491         printf("LVT on cpu%u, LAPIC ID: %" PRIu8 "\n",
     496        log_begin(LF_ARCH, LVL_DEBUG);
     497        log_printf("LVT on cpu%u, LAPIC ID: %" PRIu8 "\n",
    492498            CPU->id, l_apic_id());
    493499       
    494500        lvt_tm_t tm;
    495501        tm.value = l_apic[LVT_Tm];
    496         printf("LVT Tm: vector=%" PRIu8 ", %s, %s, %s\n",
     502        log_printf("LVT Tm: vector=%" PRIu8 ", %s, %s, %s\n",
    497503            tm.vector, delivs_str[tm.delivs], mask_str[tm.masked],
    498504            tm_mode_str[tm.mode]);
     
    500506        lvt_lint_t lint;
    501507        lint.value = l_apic[LVT_LINT0];
    502         printf("LVT LINT0: vector=%" PRIu8 ", %s, %s, %s, irr=%u, %s, %s\n",
     508        log_printf("LVT LINT0: vector=%" PRIu8 ", %s, %s, %s, irr=%u, %s, %s\n",
    503509            tm.vector, delmod_str[lint.delmod], delivs_str[lint.delivs],
    504510            intpol_str[lint.intpol], lint.irr, trigmod_str[lint.trigger_mode],
     
    506512       
    507513        lint.value = l_apic[LVT_LINT1];
    508         printf("LVT LINT1: vector=%" PRIu8 ", %s, %s, %s, irr=%u, %s, %s\n",
     514        log_printf("LVT LINT1: vector=%" PRIu8 ", %s, %s, %s, irr=%u, %s, %s\n",
    509515            tm.vector, delmod_str[lint.delmod], delivs_str[lint.delivs],
    510516            intpol_str[lint.intpol], lint.irr, trigmod_str[lint.trigger_mode],
     
    513519        lvt_error_t error;
    514520        error.value = l_apic[LVT_Err];
    515         printf("LVT Err: vector=%" PRIu8 ", %s, %s\n", error.vector,
     521        log_printf("LVT Err: vector=%" PRIu8 ", %s, %s\n", error.vector,
    516522            delivs_str[error.delivs], mask_str[error.masked]);
     523        log_end();
    517524#endif
    518525}
  • kernel/arch/ia32/src/smp/mps.c

    rbd6ff94 rb2fa1204  
    3636
    3737#include <config.h>
    38 #include <print.h>
     38#include <log.h>
    3939#include <debug.h>
    4040#include <arch/smp/mps.h>
     
    181181        buf[6] = 0;
    182182       
    183         printf("MPS: bus=%" PRIu8 " (%s)\n", bus->bus_id, buf);
     183        log(LF_ARCH, LVL_DEBUG, "MPS: bus=%" PRIu8 " (%s)", bus->bus_id, buf);
    184184#endif
    185185}
     
    205205{
    206206#ifdef MPSCT_VERBOSE
    207         printf("MPS: ");
     207        log_begin(LF_ARCH, LVL_DEBUG);
     208        log_printf("MPS: ");
    208209       
    209210        switch (iointr->intr_type) {
    210211        case 0:
    211                 printf("INT");
    212                 break;
    213         case 1:
    214                 printf("NMI");
    215                 break;
    216         case 2:
    217                 printf("SMI");
    218                 break;
    219         case 3:
    220                 printf("ExtINT");
    221                 break;
    222         }
    223        
    224         printf(", ");
     212                log_printf("INT");
     213                break;
     214        case 1:
     215                log_printf("NMI");
     216                break;
     217        case 2:
     218                log_printf("SMI");
     219                break;
     220        case 3:
     221                log_printf("ExtINT");
     222                break;
     223        }
     224       
     225        log_printf(", ");
    225226       
    226227        switch (iointr->poel & 3) {
    227228        case 0:
    228                 printf("bus-like");
    229                 break;
    230         case 1:
    231                 printf("active high");
    232                 break;
    233         case 2:
    234                 printf("reserved");
    235                 break;
    236         case 3:
    237                 printf("active low");
    238                 break;
    239         }
    240        
    241         printf(", ");
     229                log_printf("bus-like");
     230                break;
     231        case 1:
     232                log_printf("active high");
     233                break;
     234        case 2:
     235                log_printf("reserved");
     236                break;
     237        case 3:
     238                log_printf("active low");
     239                break;
     240        }
     241       
     242        log_printf(", ");
    242243       
    243244        switch ((iointr->poel >> 2) & 3) {
    244245        case 0:
    245                 printf("bus-like");
    246                 break;
    247         case 1:
    248                 printf("edge-triggered");
    249                 break;
    250         case 2:
    251                 printf("reserved");
    252                 break;
    253         case 3:
    254                 printf("level-triggered");
    255                 break;
    256         }
    257        
    258         printf(", bus=%" PRIu8 " irq=%" PRIu8 " io_apic=%" PRIu8" pin=%"
    259             PRIu8 "\n", iointr->src_bus_id, iointr->src_bus_irq,
     246                log_printf("bus-like");
     247                break;
     248        case 1:
     249                log_printf("edge-triggered");
     250                break;
     251        case 2:
     252                log_printf("reserved");
     253                break;
     254        case 3:
     255                log_printf("level-triggered");
     256                break;
     257        }
     258       
     259        log_printf(", bus=%" PRIu8 " irq=%" PRIu8 " io_apic=%" PRIu8" pin=%"
     260            PRIu8, iointr->src_bus_id, iointr->src_bus_irq,
    260261            iointr->dst_io_apic_id, iointr->dst_io_apic_pin);
     262        log_end();
    261263#endif
    262264}
     
    266268{
    267269#ifdef MPSCT_VERBOSE
    268         printf("MPS: ");
     270        log_begin(LF_ARCH, LVL_DEBUG);
     271        log_printf("MPS: ");
    269272       
    270273        switch (lintr->intr_type) {
    271274        case 0:
    272                 printf("INT");
    273                 break;
    274         case 1:
    275                 printf("NMI");
    276                 break;
    277         case 2:
    278                 printf("SMI");
    279                 break;
    280         case 3:
    281                 printf("ExtINT");
    282                 break;
    283         }
    284        
    285         printf(", ");
     275                log_printf("INT");
     276                break;
     277        case 1:
     278                log_printf("NMI");
     279                break;
     280        case 2:
     281                log_printf("SMI");
     282                break;
     283        case 3:
     284                log_printf("ExtINT");
     285                break;
     286        }
     287       
     288        log_printf(", ");
    286289       
    287290        switch (lintr->poel & 3) {
    288291        case 0:
    289                 printf("bus-like");
    290                 break;
    291         case 1:
    292                 printf("active high");
    293                 break;
    294         case 2:
    295                 printf("reserved");
    296                 break;
    297         case 3:
    298                 printf("active low");
    299                 break;
    300         }
    301        
    302         printf(", ");
     292                log_printf("bus-like");
     293                break;
     294        case 1:
     295                log_printf("active high");
     296                break;
     297        case 2:
     298                log_printf("reserved");
     299                break;
     300        case 3:
     301                log_printf("active low");
     302                break;
     303        }
     304       
     305        log_printf(", ");
    303306       
    304307        switch ((lintr->poel >> 2) & 3) {
    305308        case 0:
    306                 printf("bus-like");
    307                 break;
    308         case 1:
    309                 printf("edge-triggered");
    310                 break;
    311         case 2:
    312                 printf("reserved");
    313                 break;
    314         case 3:
    315                 printf("level-triggered");
    316                 break;
    317         }
    318        
    319         printf(", bus=%" PRIu8 " irq=%" PRIu8 " l_apic=%" PRIu8" pin=%"
    320             PRIu8 "\n", lintr->src_bus_id, lintr->src_bus_irq,
     309                log_printf("bus-like");
     310                break;
     311        case 1:
     312                log_printf("edge-triggered");
     313                break;
     314        case 2:
     315                log_printf("reserved");
     316                break;
     317        case 3:
     318                log_printf("level-triggered");
     319                break;
     320        }
     321       
     322        log_printf(", bus=%" PRIu8 " irq=%" PRIu8 " l_apic=%" PRIu8" pin=%"
     323            PRIu8, lintr->src_bus_id, lintr->src_bus_irq,
    321324            lintr->dst_l_apic_id, lintr->dst_l_apic_pin);
     325        log_end();
    322326#endif
    323327}
     
    332336                switch (cur[CT_EXT_ENTRY_TYPE]) {
    333337                default:
    334                         printf("MPS: Skipping MP Configuration Table extended "
    335                             "entry type %" PRIu8 "\n", cur[CT_EXT_ENTRY_TYPE]);
     338                        log(LF_ARCH, LVL_NOTE, "MPS: Skipping MP Configuration"
     339                            " Table extended entry type %" PRIu8,
     340                            cur[CT_EXT_ENTRY_TYPE]);
    336341                }
    337342        }
     
    341346{
    342347        if (ct->signature != CT_SIGNATURE) {
    343                 printf("MPS: Wrong ct->signature\n");
     348                log(LF_ARCH, LVL_WARN, "MPS: Wrong ct->signature");
    344349                return;
    345350        }
    346351       
    347352        if (!mps_ct_check()) {
    348                 printf("MPS: Wrong ct checksum\n");
     353                log(LF_ARCH, LVL_WARN, "MPS: Wrong ct checksum");
    349354                return;
    350355        }
    351356       
    352357        if (ct->oem_table) {
    353                 printf("MPS: ct->oem_table not supported\n");
     358                log(LF_ARCH, LVL_WARN, "MPS: ct->oem_table not supported");
    354359                return;
    355360        }
     
    402407                         * Something is wrong. Fallback to UP mode.
    403408                         */
    404                         printf("MPS: ct badness %" PRIu8 "\n", *cur);
     409                        log(LF_ARCH, LVL_WARN, "MPS: ct badness %" PRIu8, *cur);
    405410                        return;
    406411                }
     
    418423         * Not yet implemented.
    419424         */
    420         printf("MPS: Default configuration not supported\n");
     425        log(LF_ARCH, LVL_WARN, "MPS: Default configuration not supported");
    421426}
    422427
     
    449454       
    450455fs_found:
    451         printf("%p: MPS Floating Pointer Structure\n", fs);
     456        log(LF_ARCH, LVL_NOTE, "%p: MPS Floating Pointer Structure", fs);
    452457       
    453458        if ((fs->config_type == 0) && (fs->configuration_table)) {
    454459                if (fs->mpfib2 >> 7) {
    455                         printf("MPS: PIC mode not supported\n");
     460                        log(LF_ARCH, LVL_WARN, "MPS: PIC mode not supported\n");
    456461                        return;
    457462                }
  • kernel/arch/ia32/src/smp/smp.c

    rbd6ff94 rb2fa1204  
    5252#include <mm/slab.h>
    5353#include <mm/as.h>
    54 #include <print.h>
     54#include <log.h>
    5555#include <memstr.h>
    5656#include <arch/drivers/i8259.h>
     
    129129               
    130130                if (ops->cpu_apic_id(i) == bsp_l_apic) {
    131                         printf("kmp: bad processor entry #%u, will not send IPI "
    132                             "to myself\n", i);
     131                        log(LF_ARCH, LVL_ERROR, "kmp: bad processor entry #%u, "
     132                            "will not send IPI to myself", i);
    133133                        continue;
    134134                }
     
    162162                        if (waitq_sleep_timeout(&ap_completion_wq, 1000000,
    163163                            SYNCH_FLAGS_NONE) == ESYNCH_TIMEOUT) {
    164                                 printf("%s: waiting for cpu%u (APIC ID = %d) "
    165                                     "timed out\n", __FUNCTION__, i,
    166                                     ops->cpu_apic_id(i));
     164                                log(LF_ARCH, LVL_NOTE, "%s: waiting for cpu%u "
     165                                    "(APIC ID = %d) timed out", __FUNCTION__,
     166                                    i, ops->cpu_apic_id(i));
    167167                        }
    168168                } else
    169                         printf("INIT IPI for l_apic%d failed\n",
     169                        log(LF_ARCH, LVL_ERROR, "INIT IPI for l_apic%d failed",
    170170                            ops->cpu_apic_id(i));
    171171        }
  • kernel/arch/mips32/src/debugger.c

    rbd6ff94 rb2fa1204  
    3939#include <console/cmd.h>
    4040#include <print.h>
     41#include <log.h>
    4142#include <panic.h>
    4243#include <arch.h>
     
    294295        cmd_initialize(&bkpts_info);
    295296        if (!cmd_register(&bkpts_info))
    296                 printf("Cannot register command %s\n", bkpts_info.name);
     297                log(LF_OTHER, LVL_WARN, "Cannot register command %s",
     298                    bkpts_info.name);
    297299       
    298300        cmd_initialize(&delbkpt_info);
    299301        if (!cmd_register(&delbkpt_info))
    300                 printf("Cannot register command %s\n", delbkpt_info.name);
     302                log(LF_OTHER, LVL_WARN, "Cannot register command %s",
     303                    delbkpt_info.name);
    301304       
    302305        cmd_initialize(&addbkpt_info);
    303306        if (!cmd_register(&addbkpt_info))
    304                 printf("Cannot register command %s\n", addbkpt_info.name);
     307                log(LF_OTHER, LVL_WARN, "Cannot register command %s",
     308                    addbkpt_info.name);
    305309       
    306310        cmd_initialize(&addbkpte_info);
    307311        if (!cmd_register(&addbkpte_info))
    308                 printf("Cannot register command %s\n", addbkpte_info.name);
     312                log(LF_OTHER, LVL_WARN, "Cannot register command %s",
     313                    addbkpte_info.name);
    309314#endif /* CONFIG_KCONSOLE */
    310315}
  • kernel/arch/mips32/src/exception.c

    rbd6ff94 rb2fa1204  
    4848#include <arch/debugger.h>
    4949#include <symtab.h>
     50#include <log.h>
    5051
    5152static const char *exctable[] = {
     
    7475void istate_decode(istate_t *istate)
    7576{
    76         printf("epc=%#010" PRIx32 "\tsta=%#010" PRIx32 "\t"
     77        log_printf("epc=%#010" PRIx32 "\tsta=%#010" PRIx32 "\t"
    7778            "lo =%#010" PRIx32 "\thi =%#010" PRIx32 "\n",
    7879            istate->epc, istate->status, istate->lo, istate->hi);
    7980       
    80         printf("a0 =%#010" PRIx32 "\ta1 =%#010" PRIx32 "\t"
     81        log_printf("a0 =%#010" PRIx32 "\ta1 =%#010" PRIx32 "\t"
    8182            "a2 =%#010" PRIx32 "\ta3 =%#010" PRIx32 "\n",
    8283            istate->a0, istate->a1, istate->a2, istate->a3);
    8384       
    84         printf("t0 =%#010" PRIx32 "\tt1 =%#010" PRIx32 "\t"
     85        log_printf("t0 =%#010" PRIx32 "\tt1 =%#010" PRIx32 "\t"
    8586            "t2 =%#010" PRIx32 "\tt3 =%#010" PRIx32 "\n",
    8687            istate->t0, istate->t1, istate->t2, istate->t3);
    8788       
    88         printf("t4 =%#010" PRIx32 "\tt5 =%#010" PRIx32 "\t"
     89        log_printf("t4 =%#010" PRIx32 "\tt5 =%#010" PRIx32 "\t"
    8990            "t6 =%#010" PRIx32 "\tt7 =%#010" PRIx32 "\n",
    9091            istate->t4, istate->t5, istate->t6, istate->t7);
    9192       
    92         printf("t8 =%#010" PRIx32 "\tt9 =%#010" PRIx32 "\t"
     93        log_printf("t8 =%#010" PRIx32 "\tt9 =%#010" PRIx32 "\t"
    9394            "v0 =%#010" PRIx32 "\tv1 =%#010" PRIx32 "\n",
    9495            istate->t8, istate->t9, istate->v0, istate->v1);
    9596       
    96         printf("s0 =%#010" PRIx32 "\ts1 =%#010" PRIx32 "\t"
     97        log_printf("s0 =%#010" PRIx32 "\ts1 =%#010" PRIx32 "\t"
    9798            "s2 =%#010" PRIx32 "\ts3 =%#010" PRIx32 "\n",
    9899            istate->s0, istate->s1, istate->s2, istate->s3);
    99100       
    100         printf("s4 =%#010" PRIx32 "\ts5 =%#010" PRIx32 "\t"
     101        log_printf("s4 =%#010" PRIx32 "\ts5 =%#010" PRIx32 "\t"
    101102            "s6 =%#010" PRIx32 "\ts7 =%#010" PRIx32 "\n",
    102103            istate->s4, istate->s5, istate->s6, istate->s7);
    103104       
    104         printf("s8 =%#010" PRIx32 "\tat =%#010" PRIx32 "\t"
     105        log_printf("s8 =%#010" PRIx32 "\tat =%#010" PRIx32 "\t"
    105106            "kt0=%#010" PRIx32 "\tkt1=%#010" PRIx32 "\n",
    106107            istate->s8, istate->at, istate->kt0, istate->kt1);
    107108       
    108         printf("sp =%#010" PRIx32 "\tra =%#010" PRIx32 "\t"
     109        log_printf("sp =%#010" PRIx32 "\tra =%#010" PRIx32 "\t"
    109110            "gp =%#010" PRIx32 "\n",
    110111            istate->sp, istate->ra, istate->gp);
     
    194195                                 */
    195196#ifdef CONFIG_DEBUG
    196                                 printf("cpu%u: spurious interrupt (inum=%u)\n",
     197                                log(LF_ARCH, LVL_DEBUG,
     198                                    "cpu%u: spurious interrupt (inum=%u)",
    197199                                    CPU->id, i);
    198200#endif
  • kernel/arch/mips32/src/mm/tlb.c

    rbd6ff94 rb2fa1204  
    4343#include <synch/mutex.h>
    4444#include <print.h>
     45#include <log.h>
    4546#include <debug.h>
    4647#include <align.h>
     
    217218         */
    218219        if (index.p) {
    219                 printf("%s: TLBP failed in exception handler (badvaddr=%#"
     220                log(LF_ARCH, LVL_WARN, "%s: TLBP failed in exception handler (badvaddr=%#"
    220221                    PRIxn ", ASID=%d).\n", __func__, badvaddr,
    221222                    AS ? AS->asid : -1);
  • kernel/arch/ppc32/src/interrupt.c

    rbd6ff94 rb2fa1204  
    4444#include <arch/mm/pht.h>
    4545#include <print.h>
     46#include <log.h>
    4647
    4748void start_decrementer(void)
     
    5556void istate_decode(istate_t *istate)
    5657{
    57         printf("r0 =%0#10" PRIx32 "\tr1 =%0#10" PRIx32 "\t"
     58        log_printf("r0 =%0#10" PRIx32 "\tr1 =%0#10" PRIx32 "\t"
    5859            "r2 =%0#10" PRIx32 "\n", istate->r0, istate->sp, istate->r2);
    5960       
    60         printf("r3 =%0#10" PRIx32 "\tr4 =%0#10" PRIx32 "\t"
     61        log_printf("r3 =%0#10" PRIx32 "\tr4 =%0#10" PRIx32 "\t"
    6162            "r5 =%0#10" PRIx32 "\n", istate->r3, istate->r4, istate->r5);
    6263       
    63         printf("r6 =%0#10" PRIx32 "\tr7 =%0#10" PRIx32 "\t"
     64        log_printf("r6 =%0#10" PRIx32 "\tr7 =%0#10" PRIx32 "\t"
    6465            "r8 =%0#10" PRIx32 "\n", istate->r6, istate->r7, istate->r8);
    6566       
    66         printf("r9 =%0#10" PRIx32 "\tr10=%0#10" PRIx32 "\t"
     67        log_printf("r9 =%0#10" PRIx32 "\tr10=%0#10" PRIx32 "\t"
    6768            "r11=%0#10" PRIx32 "\n", istate->r9, istate->r10, istate->r11);
    6869       
    69         printf("r12=%0#10" PRIx32 "\tr13=%0#10" PRIx32 "\t"
     70        log_printf("r12=%0#10" PRIx32 "\tr13=%0#10" PRIx32 "\t"
    7071            "r14=%0#10" PRIx32 "\n", istate->r12, istate->r13, istate->r14);
    7172       
    72         printf("r15=%0#10" PRIx32 "\tr16=%0#10" PRIx32 "\t"
     73        log_printf("r15=%0#10" PRIx32 "\tr16=%0#10" PRIx32 "\t"
    7374            "r17=%0#10" PRIx32 "\n", istate->r15, istate->r16, istate->r17);
    7475       
    75         printf("r18=%0#10" PRIx32 "\tr19=%0#10" PRIx32 "\t"
     76        log_printf("r18=%0#10" PRIx32 "\tr19=%0#10" PRIx32 "\t"
    7677            "r20=%0#10" PRIx32 "\n", istate->r18, istate->r19, istate->r20);
    7778       
    78         printf("r21=%0#10" PRIx32 "\tr22=%0#10" PRIx32 "\t"
     79        log_printf("r21=%0#10" PRIx32 "\tr22=%0#10" PRIx32 "\t"
    7980            "r23=%0#10" PRIx32 "\n", istate->r21, istate->r22, istate->r23);
    8081       
    81         printf("r24=%0#10" PRIx32 "\tr25=%0#10" PRIx32 "\t"
     82        log_printf("r24=%0#10" PRIx32 "\tr25=%0#10" PRIx32 "\t"
    8283            "r26=%0#10" PRIx32 "\n", istate->r24, istate->r25, istate->r26);
    8384       
    84         printf("r27=%0#10" PRIx32 "\tr28=%0#10" PRIx32 "\t"
     85        log_printf("r27=%0#10" PRIx32 "\tr28=%0#10" PRIx32 "\t"
    8586            "r29=%0#10" PRIx32 "\n", istate->r27, istate->r28, istate->r29);
    8687       
    87         printf("r30=%0#10" PRIx32 "\tr31=%0#10" PRIx32 "\n",
     88        log_printf("r30=%0#10" PRIx32 "\tr31=%0#10" PRIx32 "\n",
    8889            istate->r30, istate->r31);
    8990       
    90         printf("cr =%0#10" PRIx32 "\tpc =%0#10" PRIx32 "\t"
     91        log_printf("cr =%0#10" PRIx32 "\tpc =%0#10" PRIx32 "\t"
    9192            "lr =%0#10" PRIx32 "\n", istate->cr, istate->pc, istate->lr);
    9293       
    93         printf("ctr=%0#10" PRIx32 "\txer=%0#10" PRIx32 "\t"
     94        log_printf("ctr=%0#10" PRIx32 "\txer=%0#10" PRIx32 "\t"
    9495            "dar=%0#10" PRIx32 "\n", istate->ctr, istate->xer, istate->dar);
    9596       
    96         printf("srr1=%0#10" PRIx32 "\n", istate->srr1);
     97        log_printf("srr1=%0#10" PRIx32 "\n", istate->srr1);
    9798}
    9899
     
    130131                         */
    131132#ifdef CONFIG_DEBUG
    132                         printf("cpu%u: spurious interrupt (inum=%" PRIu8 ")\n",
    133                             CPU->id, inum);
     133                        log(LF_ARCH, LVL_DEBUG, "cpu%u: spurious interrupt"
     134                            " (inum=%" PRIu8 ")", CPU->id, inum);
    134135#endif
    135136                }
  • kernel/arch/sparc64/src/drivers/kbd.c

    rbd6ff94 rb2fa1204  
    4444#include <align.h>
    4545#include <str.h>
    46 #include <print.h>
     46#include <log.h>
    4747#include <sysinfo/sysinfo.h>
    4848
     
    7171        ofw_tree_property_t *prop = ofw_tree_getprop(node, "interrupts");
    7272        if ((!prop) || (!prop->value)) {
    73                 printf("ns16550: Unable to find interrupts property\n");
     73                log(LF_ARCH, LVL_ERROR,
     74                    "ns16550: Unable to find interrupts property");
    7475                return false;
    7576        }
     
    8283        prop = ofw_tree_getprop(node, "reg");
    8384        if ((!prop) || (!prop->value)) {
    84                 printf("ns16550: Unable to find reg property\n");
     85                log(LF_ARCH, LVL_ERROR,
     86                    "ns16550: Unable to find reg property");
    8587                return false;
    8688        }
     
    9193        if (!ofw_ebus_apply_ranges(node->parent,
    9294            ((ofw_ebus_reg_t *) prop->value), &pa)) {
    93                 printf("ns16550: Failed to determine address\n");
     95                log(LF_ARCH, LVL_ERROR,
     96                    "ns16550: Failed to determine address");
    9497                return false;
    9598        }
     
    101104            ((ofw_ebus_reg_t *) prop->value), interrupts, &inr, &cir,
    102105            &cir_arg)) {
    103                 printf("ns16550: Failed to determine interrupt\n");
     106                log(LF_ARCH, LVL_ERROR,
     107                    "ns16550: Failed to determine interrupt");
    104108                return false;
    105109        }
     
    117121            PAGE_WRITE | PAGE_NOT_CACHEABLE) + offset);
    118122       
    119         ns16550_instance_t *ns16550_instance = ns16550_init(ns16550, inr, cir, cir_arg);
     123        ns16550_instance_t *ns16550_instance = ns16550_init(ns16550, inr, cir,
     124            cir_arg, NULL);
    120125        if (ns16550_instance) {
    121126                kbrd_instance_t *kbrd_instance = kbrd_init();
  • kernel/arch/sparc64/src/drivers/pci.c

    rbd6ff94 rb2fa1204  
    4343#include <typedefs.h>
    4444#include <debug.h>
    45 #include <print.h>
     45#include <log.h>
    4646#include <str.h>
    4747#include <arch/asm.h>
     
    213213                 * Unsupported model.
    214214                 */
    215                 printf("Unsupported PCI controller model (%s).\n",
     215                log(LF_ARCH, LVL_WARN, "Unsupported PCI controller model (%s).",
    216216                    (char *) prop->value);
    217217        }
  • kernel/arch/sparc64/src/drivers/scr.c

    rbd6ff94 rb2fa1204  
    8181       
    8282        if (scr_type == SCR_UNKNOWN) {
    83                 printf("Unknown screen device.\n");
     83                log(LF_ARCH, LVL_ERROR, "Unknown screen device.");
    8484                return;
    8585        }
     
    117117        case SCR_ATYFB:
    118118                if (prop->size / sizeof(ofw_pci_reg_t) < 2) {
    119                         printf("Too few screen registers.\n");
     119                        log(LF_ARCH, LVL_ERROR, "Too few screen registers.");
    120120                        return;
    121121                }
     
    124124               
    125125                if (!ofw_pci_reg_absolutize(node, pci_reg, &pci_abs_reg)) {
    126                         printf("Failed to absolutize fb register.\n");
     126                        log(LF_ARCH, LVL_ERROR,
     127                            "Failed to absolutize fb register.");
    127128                        return;
    128129                }
     
    130131                if (!ofw_pci_apply_ranges(node->parent, &pci_abs_reg,
    131132                    &fb_addr)) {
    132                         printf("Failed to determine screen address.\n");
     133                        log(LF_ARCH, LVL_ERROR,
     134                            "Failed to determine screen address.");
    133135                        return;
    134136                }
     
    152154                        break;
    153155                default:
    154                         printf("Unsupported bits per pixel.\n");
     156                        log(LF_ARCH, LVL_ERROR,
     157                            "Unsupported bits per pixel.");
    155158                        return;
    156159                }
     
    159162        case SCR_XVR:
    160163                if (prop->size / sizeof(ofw_pci_reg_t) < 2) {
    161                         printf("Too few screen registers.\n");
     164                        log(LF_ARCH, LVL_ERROR,
     165                            "Too few screen registers.");
    162166                        return;
    163167                }
     
    166170               
    167171                if (!ofw_pci_reg_absolutize(node, pci_reg, &pci_abs_reg)) {
    168                         printf("Failed to absolutize fb register.\n");
     172                        log(LF_ARCH, LVL_ERROR,
     173                            "Failed to absolutize fb register.");
    169174                        return;
    170175                }
     
    172177                if (!ofw_pci_apply_ranges(node->parent, &pci_abs_reg,
    173178                    &fb_addr)) {
    174                         printf("Failed to determine screen address.\n");
     179                        log(LF_ARCH, LVL_ERROR,
     180                            "Failed to determine screen address.");
    175181                        return;
    176182                }
     
    196202                        break;
    197203                default:
    198                         printf("Unsupported bits per pixel.\n");
     204                        log(LF_ARCH, LVL_ERROR,
     205                            "Unsupported bits per pixel.");
    199206                        return;
    200207                }
     
    207214                upa_reg = &((ofw_upa_reg_t *) prop->value)[FFB_REG_24BPP];
    208215                if (!ofw_upa_apply_ranges(node->parent, upa_reg, &fb_addr)) {
    209                         printf("Failed to determine screen address.\n");
     216                        log(LF_ARCH, LVL_ERROR,
     217                            "Failed to determine screen address.");
    210218                        return;
    211219                }
     
    219227                        break;
    220228                default:
    221                         printf("Not implemented.\n");
     229                        log(LF_ARCH, LVL_WARN, "Not implemented.");
    222230                        return;
    223231                }
     
    225233                sbus_reg = &((ofw_sbus_reg_t *) prop->value)[0];
    226234                if (!ofw_sbus_apply_ranges(node->parent, sbus_reg, &fb_addr)) {
    227                         printf("Failed to determine screen address.\n");
     235                        log(LF_ARCH, LVL_ERROR,
     236                            "Failed to determine screen address.");
    228237                        return;
    229238                }
     
    233242        case SCR_QEMU_VGA:
    234243                if (prop->size / sizeof(ofw_pci_reg_t) < 2) {
    235                         printf("Too few screen registers.\n");
     244                        log(LF_ARCH, LVL_ERROR, "Too few screen registers.");
    236245                        return;
    237246                }
     
    240249
    241250                if (!ofw_pci_reg_absolutize(node, pci_reg, &pci_abs_reg)) {
    242                         printf("Failed to absolutize fb register.\n");
     251                        log(LF_ARCH, LVL_ERROR,
     252                            "Failed to absolutize fb register.");
    243253                        return;
    244254                }
     
    246256                if (!ofw_pci_apply_ranges(node->parent, &pci_abs_reg,
    247257                    &fb_addr)) {
    248                         printf("Failed to determine screen address.\n");
     258                        log(LF_ARCH, LVL_ERROR,
     259                            "Failed to determine screen address.");
    249260                        return;
    250261                }
     
    268279                        break;
    269280                default:
    270                         printf("Unsupported bits per pixel.\n");
     281                        log(LF_ARCH, LVL_ERROR, "Unsupported bits per pixel.");
    271282                        return;
    272283                }
  • kernel/arch/sparc64/src/mm/sun4v/tlb.c

    rbd6ff94 rb2fa1204  
    4646#include <arch.h>
    4747#include <print.h>
     48#include <log.h>
    4849#include <typedefs.h>
    4950#include <config.h>
     
    335336void tlb_print(void)
    336337{
    337         printf("Operation not possible on Niagara.\n");
     338        log(LF_ARCH, LVL_WARN, "Operation not possible on Niagara.");
    338339}
    339340
  • kernel/arch/sparc64/src/smp/sun4u/smp.c

    rbd6ff94 rb2fa1204  
    4343#include <typedefs.h>
    4444#include <synch/waitq.h>
    45 #include <print.h>
     45#include <log.h>
    4646#include <arch/cpu_node.h>
    4747
     
    108108        if (waitq_sleep_timeout(&ap_completion_wq, 1000000, SYNCH_FLAGS_NONE) ==
    109109            ESYNCH_TIMEOUT)
    110                 printf("%s: waiting for processor (mid = %" PRIu32
    111                     ") timed out\n", __func__, mid);
     110                log(LF_ARCH, LVL_NOTE, "%s: waiting for processor (mid = %" PRIu32
     111                    ") timed out", __func__, mid);
    112112}
    113113
  • kernel/arch/sparc64/src/sun4v/md.c

    rbd6ff94 rb2fa1204  
    3636#include <panic.h>
    3737#include <func.h>
    38 #include <print.h>
     38#include <log.h>
    3939#include <str.h>
    4040#include <arch/sun4v/md.h>
     
    310310        retval = retval;
    311311        if (retval != HV_EOK) {
    312                 printf("Could not retrieve machine description, "
    313                     "error=%" PRIu64 ".\n", retval);
     312                log(LF_ARCH, LVL_ERROR, "Could not retrieve machine "
     313                    "description, error=%" PRIu64 ".", retval);
    314314        }
    315315}
  • kernel/arch/sparc64/src/trap/sun4u/interrupt.c

    rbd6ff94 rb2fa1204  
    4242#include <arch/asm.h>
    4343#include <arch/barrier.h>
    44 #include <print.h>
     44#include <log.h>
    4545#include <arch.h>
    4646#include <mm/tlb.h>
     
    9696                 */
    9797#ifdef CONFIG_DEBUG
    98                 printf("cpu%u: spurious interrupt (intrcv=%#" PRIx64
    99                     ", data0=%#" PRIx64 ")\n", CPU->id, intrcv, data0);
     98                log(LF_ARCH, LVL_DEBUG,
     99                    "cpu%u: spurious interrupt (intrcv=%#" PRIx64 ", data0=%#"
     100                    PRIx64 ")", CPU->id, intrcv, data0);
    100101#else
    101102                (void) intrcv;
  • kernel/arch/sparc64/src/trap/sun4v/interrupt.c

    rbd6ff94 rb2fa1204  
    4242#include <arch/asm.h>
    4343#include <arch/barrier.h>
    44 #include <print.h>
     44#include <log.h>
    4545#include <arch.h>
    4646#include <mm/tlb.h>
     
    111111                        ((void (*)(void)) data1)();
    112112                } else {
    113                         printf("Spurious interrupt on %" PRIu64 ", data = %" PRIx64 ".\n",
    114                             CPU->arch.id, data1);
     113                        log(LF_ARCH, LVL_DEBUG, "Spurious interrupt on %" PRIu64
     114                            ", data = %" PRIx64 ".", CPU->arch.id, data1);
    115115                }
    116116        }
  • kernel/genarch/src/acpi/acpi.c

    rbd6ff94 rb2fa1204  
    4141#include <mm/page.h>
    4242#include <mm/km.h>
    43 #include <print.h>
     43#include <log.h>
    4444
    4545#define RSDP_SIGNATURE      "RSD PTR "
     
    211211       
    212212        if ((acpi_rsdt) && (!acpi_sdt_check((uint8_t *) acpi_rsdt))) {
    213                 printf("RSDT: bad checksum\n");
     213                log(LF_ARCH, LVL_ERROR, "RSDT: bad checksum");
    214214                return;
    215215        }
    216216       
    217217        if ((acpi_xsdt) && (!acpi_sdt_check((uint8_t *) acpi_xsdt))) {
    218                 printf("XSDT: bad checksum\n");
     218                log(LF_ARCH, LVL_ERROR, "XSDT: bad checksum");
    219219                return;
    220220        }
  • kernel/genarch/src/acpi/madt.c

    rbd6ff94 rb2fa1204  
    4343#include <debug.h>
    4444#include <config.h>
    45 #include <print.h>
     45#include <log.h>
    4646#include <mm/slab.h>
    4747#include <memstr.h>
     
    236236                case MADT_L_SAPIC:
    237237                case MADT_PLATFORM_INTR_SRC:
    238                         printf("MADT: Skipping %s entry (type=%" PRIu8 ")\n",
     238                        log(LF_ARCH, LVL_WARN,
     239                            "MADT: Skipping %s entry (type=%" PRIu8 ")",
    239240                            entry[hdr->type], hdr->type);
    240241                        break;
     
    242243                        if ((hdr->type >= MADT_RESERVED_SKIP_BEGIN)
    243244                            && (hdr->type <= MADT_RESERVED_SKIP_END))
    244                                 printf("MADT: Skipping reserved entry (type=%" PRIu8 ")\n",
     245                                log(LF_ARCH, LVL_NOTE,
     246                                    "MADT: Skipping reserved entry (type=%" PRIu8 ")",
    245247                                    hdr->type);
    246248                               
    247249                        if (hdr->type >= MADT_RESERVED_OEM_BEGIN)
    248                                 printf("MADT: Skipping OEM entry (type=%" PRIu8 ")\n",
     250                                log(LF_ARCH, LVL_NOTE,
     251                                    "MADT: Skipping OEM entry (type=%" PRIu8 ")",
    249252                                    hdr->type);
    250253                       
  • kernel/genarch/src/drivers/via-cuda/cuda.c

    rbd6ff94 rb2fa1204  
    118118}
    119119
    120 #include <print.h>
     120#include <log.h>
    121121void cuda_wire(cuda_instance_t *instance, indev_t *kbrdin)
    122122{
     
    197197
    198198        if ((b & TREQ) != 0) {
    199                 printf("cuda_irq_listen: no TREQ?!\n");
     199                log(LF_OTHER, LVL_ERROR, "cuda_irq_listen: no TREQ?!");
    200200                return;
    201201        }
  • kernel/generic/include/synch/spinlock.h

    rbd6ff94 rb2fa1204  
    137137#ifdef CONFIG_DEBUG_SPINLOCK
    138138
    139 #include <print.h>
     139#include <log.h>
    140140
    141141#define DEADLOCK_THRESHOLD  100000000
     
    146146        if ((pname)++ > (value)) { \
    147147                (pname) = 0; \
    148                 printf("Deadlock probe %s: exceeded threshold %u\n" \
     148                log(LF_OTHER, LVL_WARN, \
     149                    "Deadlock probe %s: exceeded threshold %u\n" \
    149150                    "cpu%u: function=%s, line=%u\n", \
    150151                    #pname, (value), CPU->id, __func__, __LINE__); \
  • kernel/generic/src/console/cmd.c

    rbd6ff94 rb2fa1204  
    4545#include <console/kconsole.h>
    4646#include <print.h>
     47#include <log.h>
    4748#include <panic.h>
    4849#include <typedefs.h>
     
    639640        for (i = 0; basic_commands[i]; i++) {
    640641                if (!cmd_register(basic_commands[i])) {
    641                         printf("Cannot register command %s\n",
     642                        log(LF_OTHER, LVL_ERROR,
     643                            "Cannot register command %s",
    642644                            basic_commands[i]->name);
    643645                }
     
    665667        unsigned int _len = (unsigned int) len;
    666668        if ((_len != len) || (((int) _len) < 0)) {
    667                 printf("Command length overflow\n");
     669                log(LF_OTHER, LVL_ERROR, "Command length overflow");
    668670                return 1;
    669671        }
  • kernel/generic/src/lib/func.c

    rbd6ff94 rb2fa1204  
    3737
    3838#include <func.h>
    39 #include <print.h>
     39#include <log.h>
    4040#include <cpu.h>
    4141#include <arch/asm.h>
     
    7272       
    7373        if (CPU)
    74                 printf("cpu%u: halted\n", CPU->id);
     74                log(LF_OTHER, LVL_NOTE, "cpu%u: halted", CPU->id);
    7575        else
    76                 printf("cpu: halted\n");
     76                log(LF_OTHER, LVL_NOTE, "cpu: halted");
    7777       
    7878        cpu_halt();
  • kernel/generic/src/lib/rd.c

    rbd6ff94 rb2fa1204  
    3838 */
    3939
    40 #include <print.h>
     40#include <log.h>
    4141#include <lib/rd.h>
    4242#include <mm/frame.h>
     
    6868        sysinfo_set_item_val("rd.address.physical", NULL, (sysarg_t) base);
    6969       
    70         printf("RAM disk at %p (size %zu bytes)\n", (void *) base, size);
     70        log(LF_OTHER, LVL_NOTE, "RAM disk at %p (size %zu bytes)", (void *) base,
     71            size);
    7172}
    7273
  • kernel/generic/src/main/kinit.c

    rbd6ff94 rb2fa1204  
    5959#include <mm/km.h>
    6060#include <print.h>
     61#include <log.h>
    6162#include <memstr.h>
    6263#include <console/console.h>
     
    140141                                thread_ready(thread);
    141142                        } else
    142                                 printf("Unable to create kcpulb thread for cpu%u\n", i);
     143                                log(LF_OTHER, LVL_ERROR,
     144                                    "Unable to create kcpulb thread for cpu%u", i);
    143145                }
    144146        }
     
    156158                thread_ready(thread);
    157159        else
    158                 printf("Unable to create kload thread\n");
     160                log(LF_OTHER, LVL_ERROR, "Unable to create kload thread");
    159161       
    160162#ifdef CONFIG_KCONSOLE
     
    168170                        thread_ready(thread);
    169171                else
    170                         printf("Unable to create kconsole thread\n");
     172                        log(LF_OTHER, LVL_ERROR,
     173                            "Unable to create kconsole thread");
    171174        }
    172175#endif /* CONFIG_KCONSOLE */
     
    210213        for (i = 0; i < init.cnt; i++) {
    211214                if (init.tasks[i].paddr % FRAME_SIZE) {
    212                         printf("init[%zu]: Address is not frame aligned\n", i);
     215                        log(LF_OTHER, LVL_ERROR,
     216                            "init[%zu]: Address is not frame aligned", i);
    213217                        programs[i].task = NULL;
    214218                        continue;
     
    273277                        init_rd((void *) init.tasks[i].paddr, init.tasks[i].size);
    274278                } else
    275                         printf("init[%zu]: Init binary load failed "
    276                             "(error %d, loader status %u)\n", i, rc,
     279                        log(LF_OTHER, LVL_ERROR,
     280                            "init[%zu]: Init binary load failed "
     281                            "(error %d, loader status %u)", i, rc,
    277282                            programs[i].loader_status);
    278283        }
  • kernel/generic/src/main/shutdown.c

    rbd6ff94 rb2fa1204  
    3939#include <func.h>
    4040#include <print.h>
     41#include <log.h>
    4142
    4243void reboot(void)
     
    4546       
    4647#ifdef CONFIG_DEBUG
    47         printf("Rebooting the system\n");
     48        log(LF_OTHER, LVL_DEBUG, "Rebooting the system");
    4849#endif
    4950       
  • kernel/generic/src/mm/frame.c

    rbd6ff94 rb2fa1204  
    5454#include <arch.h>
    5555#include <print.h>
     56#include <log.h>
    5657#include <align.h>
    5758#include <mm/slab.h>
     
    121122{
    122123        if (zones.count + 1 == ZONES_MAX) {
    123                 printf("Maximum zone count %u exceeded!\n", ZONES_MAX);
     124                log(LF_OTHER, LVL_ERROR, "Maximum zone count %u exceeded!",
     125                    ZONES_MAX);
    124126                return (size_t) -1;
    125127        }
     
    141143                            (!iswithin(zones.info[i].base, zones.info[i].count,
    142144                            base, count))) {
    143                                 printf("Zone (%p, %p) overlaps "
    144                                     "with previous zone (%p %p)!\n",
     145                                log(LF_OTHER, LVL_WARN,
     146                                    "Zone (%p, %p) overlaps "
     147                                    "with previous zone (%p %p)!",
    145148                                    (void *) PFN2ADDR(base), (void *) PFN2ADDR(count),
    146149                                    (void *) PFN2ADDR(zones.info[i].base),
     
    913916               
    914917#ifdef CONFIG_DEBUG
    915                 printf("Thread %" PRIu64 " waiting for %zu frames "
    916                     "(%zu available).\n", THREAD->tid, count, avail);
     918                log(LF_OTHER, LVL_DEBUG,
     919                    "Thread %" PRIu64 " waiting for %zu frames "
     920                    "%zu available.", THREAD->tid, count, avail);
    917921#endif
    918922               
     
    938942               
    939943#ifdef CONFIG_DEBUG
    940                 printf("Thread %" PRIu64 " woken up.\n", THREAD->tid);
     944                log(LF_OTHER, LVL_DEBUG, "Thread %" PRIu64 " woken up.",
     945                    THREAD->tid);
    941946#endif
    942947               
  • kernel/generic/src/proc/program.c

    rbd6ff94 rb2fa1204  
    4949#include <lib/elf_load.h>
    5050#include <errno.h>
    51 #include <print.h>
     51#include <log.h>
    5252#include <syscall/copy.h>
    5353#include <proc/program.h>
     
    155155               
    156156                program_loader = image_addr;
    157                 printf("Program loader at %p\n", (void *) image_addr);
     157                log(LF_OTHER, LVL_NOTE, "Program loader at %p", (void *) image_addr);
    158158               
    159159                return EOK;
     
    181181        if (!loader) {
    182182                as_destroy(as);
    183                 printf("Cannot spawn loader as none was registered\n");
     183                log(LF_OTHER, LVL_ERROR,
     184                    "Cannot spawn loader as none was registered");
    184185                return ENOENT;
    185186        }
     
    189190        if (prg->loader_status != EE_OK) {
    190191                as_destroy(as);
    191                 printf("Cannot spawn loader (%s)\n",
     192                log(LF_OTHER, LVL_ERROR, "Cannot spawn loader (%s)",
    192193                    elf_error(prg->loader_status));
    193194                return ENOENT;
  • kernel/generic/src/proc/scheduler.c

    rbd6ff94 rb2fa1204  
    6161#include <cpu.h>
    6262#include <print.h>
     63#include <log.h>
    6364#include <debug.h>
    6465#include <stacktrace.h>
     
    517518       
    518519#ifdef SCHEDULER_VERBOSE
    519         printf("cpu%u: tid %" PRIu64 " (priority=%d, ticks=%" PRIu64
    520             ", nrdy=%" PRIua ")\n", CPU->id, THREAD->tid, THREAD->priority,
     520        log(LF_OTHER, LVL_DEBUG,
     521            "cpu%u: tid %" PRIu64 " (priority=%d, ticks=%" PRIu64
     522            ", nrdy=%" PRIua ")", CPU->id, THREAD->tid, THREAD->priority,
    521523            THREAD->ticks, atomic_get(&CPU->nrdy));
    522524#endif
     
    663665                               
    664666#ifdef KCPULB_VERBOSE
    665                                 printf("kcpulb%u: TID %" PRIu64 " -> cpu%u, "
    666                                     "nrdy=%ld, avg=%ld\n", CPU->id, t->tid,
     667                                log(LF_OTHER, LVL_DEBUG,
     668                                    "kcpulb%u: TID %" PRIu64 " -> cpu%u, "
     669                                    "nrdy=%ld, avg=%ld", CPU->id, t->tid,
    667670                                    CPU->id, atomic_get(&CPU->nrdy),
    668671                                    atomic_get(&nrdy) / config.cpu_active);
  • kernel/generic/src/syscall/syscall.c

    rbd6ff94 rb2fa1204  
    8787                rc = syscall_table[id](a1, a2, a3, a4, a5, a6);
    8888        } else {
    89                 printf("Task %" PRIu64": Unknown syscall %#" PRIxn, TASK->taskid, id);
     89                log(LF_OTHER, LVL_ERROR,
     90                    "Task %" PRIu64": Unknown syscall %#" PRIxn, TASK->taskid, id);
    9091                task_kill_self(true);
    9192        }
Note: See TracChangeset for help on using the changeset viewer.