Changeset b2fa1204 in mainline for kernel/arch/sparc64/src


Ignore:
Timestamp:
2014-01-05T21:12:26Z (12 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/arch/sparc64/src
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • 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        }
Note: See TracChangeset for help on using the changeset viewer.