Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • boot/arch/sparc64/src/ofw.c

    r7a99507 ra35b458  
    4747        if (ch == '\n')
    4848                ofw_putchar('\r');
    49        
     49
    5050        if (ascii_check(ch))
    5151                ofw_putchar(ch);
     
    7272{
    7373        size_t cpus;
    74        
     74
    7575        for (cpus = 0; (child != 0) && (child != (phandle) -1);
    7676            child = ofw_get_peer_node(child), cpus++) {
    7777                char type_name[OFW_TREE_PROPERTY_MAX_VALUELEN];
    78                
     78
    7979                if (ofw_get_property(child, "device_type", type_name,
    8080                    OFW_TREE_PROPERTY_MAX_VALUELEN) > 0) {
    8181                        type_name[OFW_TREE_PROPERTY_MAX_VALUELEN - 1] = 0;
    82                        
     82
    8383                        if (str_cmp(type_name, "cpu") == 0) {
    8484                                uint32_t mid;
    85                                
     85
    8686                                /*
    8787                                 * "upa-portid" for US, "portid" for US-III,
     
    9292                                    && (ofw_get_property(child, "cpuid", &mid, sizeof(mid)) <= 0))
    9393                                        continue;
    94                                
     94
    9595                                if (current_mid != mid) {
    9696                                        /*
     
    104104                }
    105105        }
    106        
     106
    107107        return cpus;
    108108}
     
    115115        /* Get the current CPU MID */
    116116        uint64_t current_mid;
    117        
     117
    118118        asm volatile (
    119119                "ldxa [%[zero]] %[asi], %[current_mid]\n"
     
    122122                  [asi] "i" (ASI_ICBUS_CONFIG)
    123123        );
    124        
     124
    125125        current_mid >>= ICBUS_CONFIG_MID_SHIFT;
    126126        current_mid &= mid_mask;
    127        
     127
    128128        /* Wake up the CPUs */
    129        
     129
    130130        phandle cpus_parent = ofw_find_device("/ssm@0,0");
    131131        if ((cpus_parent == 0) || (cpus_parent == (phandle) -1))
    132132                cpus_parent = ofw_find_device("/");
    133        
     133
    134134        phandle node = ofw_get_child_node(cpus_parent);
    135135        size_t cpus = wake_cpus_in_node(node, current_mid, physmem_start);
    136        
     136
    137137        while ((node != 0) && (node != (phandle) -1)) {
    138138                char name[OFW_TREE_PROPERTY_MAX_VALUELEN];
    139                
     139
    140140                if (ofw_get_property(node, "name", name,
    141141                    OFW_TREE_PROPERTY_MAX_VALUELEN) > 0) {
    142142                        name[OFW_TREE_PROPERTY_MAX_VALUELEN - 1] = 0;
    143                        
     143
    144144                        if (str_cmp(name, "cmp") == 0) {
    145145                                phandle subnode = ofw_get_child_node(node);
     
    148148                        }
    149149                }
    150                
     150
    151151                node = ofw_get_peer_node(node);
    152152        }
    153        
     153
    154154        if (cpus == 0)
    155155                printf("Warning: Unable to get CPU properties.\n");
     
    169169                halt();
    170170        }
    171        
     171
    172172        return ((((uintptr_t) memreg[0]) << 32) | memreg[1]);
    173173}
Note: See TracChangeset for help on using the changeset viewer.