Changeset 8565a42 in mainline for boot/arch/sparc64


Ignore:
Timestamp:
2018-03-02T20:34:50Z (8 years ago)
Author:
GitHub <noreply@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a1a81f69, d5e5fd1
Parents:
3061bc1 (diff), 34e1206 (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:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:34:50)
git-committer:
GitHub <noreply@…> (2018-03-02 20:34:50)
Message:

Remove all trailing whitespace, everywhere.

See individual commit messages for details.

Location:
boot/arch/sparc64
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • boot/arch/sparc64/_link.ld.in

    r3061bc1 r8565a42  
    66                *(BOOTSTRAP);
    77                *(.text);
    8                
     8
    99                *(.data);       /* initialized data */
    1010                *(.rodata);
     
    1717                *(.components);
    1818        }
    19        
     19
    2020        /DISCARD/ : {
    2121                *(.gnu.*);
  • boot/arch/sparc64/src/asm.S

    r3061bc1 r8565a42  
    65651:
    6666        ! Disable interrupts and disable address masking.
    67        
     67
    6868        wrpr %g0, PSTATE_PRIV_BIT, %pstate
    69        
     69
    7070        wrpr %g0, NWINDOWS - 2, %cansave   ! Set maximum saveable windows
    7171        wrpr %g0, 0, %canrestore           ! Get rid of windows we will never need again
    7272        wrpr %g0, 0, %otherwin             ! Make sure the window state is consistent
    7373        wrpr %g0, NWINDOWS - 1, %cleanwin  ! Prevent needless clean_window traps for kernel
    74        
     74
    7575        set initial_stack, %sp
    7676        add %sp, -STACK_BIAS, %sp
    77        
     77
    7878        set ofw_cif, %l0
    79        
     79
    8080        ! Initialize OpenFirmware
    81        
     81
    8282        call ofw_init
    8383        stx %o4, [%l0]
    84        
     84
    8585        ba %xcc, bootstrap
    8686        nop
     
    105105         * 3. Flush instruction pipeline.
    106106         */
    107        
     107
    108108        /*
    109109         * US3 processors have a write-invalidate cache, so explicitly
     
    115115        be %xcc, 1f
    116116        nop
    117        
     117
    118118        0:
    119119                call icache_flush
    120120                nop
    121        
     121
    122122        1:
    123123                membar #StoreStore
    124        
     124
    125125        /*
    126126         * Flush the instruction pipeline.
    127127         */
    128128        flush %i7
    129        
     129
    130130        ! Jump to kernel
    131131        jmp %o3
     
    138138        set ((ICACHE_SIZE - ICACHE_LINE_SIZE) | ICACHE_SET_BIT), %g1
    139139        stxa %g0, [%g1] ASI_ICACHE_TAG
    140        
     140
    141141        0:
    142142                membar #Sync
    143143                subcc %g1, ICACHE_LINE_SIZE, %g1
    144144                bnz,pt %xcc, 0b
    145        
     145
    146146        stxa %g0, [%g1] ASI_ICACHE_TAG
    147147        membar #Sync
    148148        retl
    149        
     149
    150150        ! SF Erratum #51
    151        
     151
    152152        nop
    153153#else
     
    161161        set ofw_cif, %l0
    162162        ldx [%l0], %l0
    163        
     163
    164164        rdpr %pstate, %l1
    165165        and %l1, ~PSTATE_AM_BIT, %l2
    166166        wrpr %l2, 0, %pstate
    167        
     167
    168168        jmpl %l0, %o7
    169169        mov %i0, %o0
    170        
     170
    171171        wrpr %l1, 0, %pstate
    172        
     172
    173173        ret
    174174        restore %o0, 0, %o0
  • boot/arch/sparc64/src/main.c

    r3061bc1 r8565a42  
    8686        phandle root = ofw_find_device("/");
    8787        char compatible[OFW_TREE_PROPERTY_MAX_VALUELEN];
    88        
     88
    8989        if (ofw_get_property(root, "compatible", compatible,
    9090            OFW_TREE_PROPERTY_MAX_VALUELEN) <= 0) {
     
    9393                return;
    9494        }
    95        
     95
    9696        if (str_cmp(compatible, "sun4v") != 0) {
    9797                /*
     
    122122                : [ver] "=r" (ver)
    123123        );
    124        
     124
    125125        ver = (ver << 16) >> 48;
    126        
     126
    127127        if ((ver >= FIRST_US3_CPU) && (ver <= LAST_US3_CPU)) {
    128128                subarch = SUBARCH_US3;
    129                
     129
    130130                if (ver == US_IIIi_CODE)
    131131                        mid_mask = (1 << 5) - 1;
    132132                else
    133133                        mid_mask = (1 << 10) - 1;
    134                
     134
    135135        } else if (ver < FIRST_US3_CPU) {
    136136                subarch = SUBARCH_US;
     
    193193{
    194194        version_print();
    195        
     195
    196196        arch_detect();
    197197        if (arch == ARCH_SUN4U)
     
    199199        else
    200200                subarch = SUBARCH_UNKNOWN;
    201        
     201
    202202        bootinfo.physmem_start = ofw_get_physmem_start();
    203203        ofw_memmap(&bootinfo.memmap);
     
    205205        if (arch == ARCH_SUN4V)
    206206                sun4v_fixups();
    207        
     207
    208208        void *bootinfo_pa = ofw_translate(&bootinfo);
    209209        void *kernel_address_pa = ofw_translate((void *) KERNEL_ADDRESS);
    210210        void *loader_address_pa = ofw_translate((void *) LOADER_ADDRESS);
    211        
     211
    212212        printf("\nMemory statistics (total %" PRIu64 " MB, starting at %p)\n",
    213213            bootinfo.memmap.total >> 20, (void *) bootinfo.physmem_start);
     
    217217        printf(" %p|%p: loader entry point\n",
    218218            (void *) LOADER_ADDRESS, (void *) loader_address_pa);
    219        
     219
    220220        size_t i;
    221221        for (i = 0; i < COMPONENTS; i++)
     
    223223                    ofw_translate(components[i].addr), components[i].name,
    224224                    components[i].inflated, components[i].size);
    225        
     225
    226226        void *dest[COMPONENTS];
    227227        size_t top = KERNEL_ADDRESS;
     
    230230        for (i = 0; i < min(COMPONENTS, TASKMAP_MAX_RECORDS); i++) {
    231231                top = ALIGN_UP(top, PAGE_SIZE);
    232                
     232
    233233                if (i > 0) {
    234234                        bootinfo.taskmap.tasks[bootinfo.taskmap.cnt].addr =
     
    236236                        bootinfo.taskmap.tasks[bootinfo.taskmap.cnt].size =
    237237                            components[i].inflated;
    238                        
     238
    239239                        str_cpy(bootinfo.taskmap.tasks[bootinfo.taskmap.cnt].name,
    240240                            BOOTINFO_TASK_NAME_BUFLEN, components[i].name);
    241                        
     241
    242242                        bootinfo.taskmap.cnt++;
    243243                }
    244                
     244
    245245                dest[i] = (void *) top;
    246246                top += components[i].inflated;
    247247                cnt++;
    248248        }
    249        
     249
    250250        printf("\nInflating components ... ");
    251        
     251
    252252        for (i = cnt; i > 0; i--) {
    253253                printf("%s ", components[i - 1].name);
    254                
     254
    255255                /*
    256256                 * At this point, we claim and map the physical memory that we
     
    263263                ofw_claim_phys(bootinfo.physmem_start + dest[i - 1],
    264264                    ALIGN_UP(components[i - 1].inflated, PAGE_SIZE));
    265                
     265
    266266                ofw_map(bootinfo.physmem_start + dest[i - 1], dest[i - 1],
    267267                    ALIGN_UP(components[i - 1].inflated, PAGE_SIZE), -1);
    268                
     268
    269269                int err = inflate(components[i - 1].addr, components[i - 1].size,
    270270                    dest[i - 1], components[i - 1].inflated);
    271                
     271
    272272                if (err != EOK) {
    273273                        printf("\n%s: Inflating error %d, halting.\n",
     
    276276                }
    277277        }
    278        
     278
    279279        printf(".\n");
    280        
     280
    281281        /*
    282282         * Claim and map the physical memory for the boot allocator.
     
    290290        balloc_init(&bootinfo.ballocs, balloc_base, (uintptr_t) balloc_base,
    291291            BALLOC_MAX_SIZE);
    292        
     292
    293293        printf("Setting up screens ...\n");
    294294        ofw_setup_screens();
    295        
     295
    296296        printf("Canonizing OpenFirmware device tree ...\n");
    297297        bootinfo.ofw_root = ofw_tree_build();
    298        
     298
    299299        if (arch == ARCH_SUN4U)
    300300                sun4u_smp();
    301        
     301
    302302        printf("Booting the kernel ...\n");
    303303        jump_to_kernel(bootinfo.physmem_start | BSP_PROCESSOR, &bootinfo, subarch,
  • boot/arch/sparc64/src/ofw.c

    r3061bc1 r8565a42  
    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.