Changeset 8565a42 in mainline for boot/arch/riscv64


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/riscv64
Files:
4 edited

Legend:

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

    r3061bc1 r8565a42  
    55SECTIONS {
    66        . = PHYSMEM_START;
    7        
     7
    88        .text : {
    99                *(BOOTSTRAP);
    1010                *(.text);
    1111        }
    12        
     12
    1313        . = ALIGN(0x1000);
    1414        .htif : {
     
    1717        }
    1818        . = ALIGN(0x1000);
    19        
     19
    2020        . = ALIGN(0x1000);
    2121        .pt : {
     
    2424        }
    2525        . = ALIGN(0x1000);
    26        
     26
    2727        .data : {
    2828                *(.data);       /* initialized data */
     
    3737                *(.components);
    3838        }
    39        
     39
    4040        /DISCARD/ : {
    4141                *(.gnu.*);
  • boot/arch/riscv64/src/asm.S

    r3061bc1 r8565a42  
    8585        li x30, 0
    8686        li x31, 0
    87        
     87
    8888        /* Set up stack, create stack frame */
    8989        la sp, boot_stack + BOOT_STACK_SIZE
    9090        addi sp, sp, -16
    91        
     91
    9292        j bootstrap
    9393
     
    9797        /* Enable performance counters access in supervisor mode */
    9898        csrsi mcounteren, MCOUNTEREN_CY_MASK | MCOUNTEREN_TM_MASK | MCOUNTEREN_IR_MASK
    99        
     99
    100100        /* Setup SV48 paging for supervisor mode */
    101101        la t0, ptl_0
    102102        srli t0, t0, 12
    103        
     103
    104104        li t1, SATP_PFN_MASK
    105105        and t0, t0, t1
    106        
     106
    107107        li t1, SATP_MODE_SV48
    108108        or t0, t0, t1
    109        
     109
    110110        csrw sptbr, t0
    111        
     111
    112112        /* Jump to supervisor mode */
    113113        csrr t0, mstatus
    114        
     114
    115115        li t1, ~MSTATUS_MPP_MASK
    116116        and t0, t0, t1
    117        
     117
    118118        /*
    119119         * TODO: Enable running with Supervisor User Mode
     
    122122        li t1, MSTATUS_MPP_SUPERVISOR | MSTATUS_SUM_MASK
    123123        or t0, t0, t1
    124        
     124
    125125        csrw mstatus, t0
    126        
     126
    127127        li ra, PA2KA(BOOT_OFFSET)
    128128        csrw mepc, ra
    129        
     129
    130130        mret
    131131FUNCTION_END(jump_to_kernel)
  • boot/arch/riscv64/src/main.c

    r3061bc1 r8565a42  
    4848{
    4949        version_print();
    50        
     50
    5151        bootinfo.htif_frame = ((uintptr_t) &htif_page) >> PAGE_WIDTH;
    5252        bootinfo.pt_frame = ((uintptr_t) &pt_page) >> PAGE_WIDTH;
    53        
     53
    5454        bootinfo.ucbinfo.tohost =
    5555            (volatile uint64_t *) PA2KA((uintptr_t) &tohost);
    5656        bootinfo.ucbinfo.fromhost =
    5757            (volatile uint64_t *) PA2KA((uintptr_t) &fromhost);
    58        
     58
    5959        // FIXME TODO: read from device tree
    6060        bootinfo.physmem_start = PHYSMEM_START;
     
    6363        bootinfo.memmap.zones[0].start = (void *) PHYSMEM_START;
    6464        bootinfo.memmap.zones[0].size = PHYSMEM_SIZE;
    65        
     65
    6666        printf("\nMemory statistics (total %lu MB, starting at %p)\n\n",
    6767            bootinfo.memmap.total >> 20, (void *) bootinfo.physmem_start);
    6868        printf(" %p: boot info structure\n", &bootinfo);
    69        
     69
    7070        uintptr_t top = BOOT_OFFSET;
    71        
     71
    7272        for (size_t i = 0; i < COMPONENTS; i++) {
    7373                printf(" %p: %s image (%zu/%zu bytes)\n", components[i].addr,
    7474                    components[i].name, components[i].inflated,
    7575                    components[i].size);
    76                
     76
    7777                uintptr_t tail = (uintptr_t) components[i].addr +
    7878                    components[i].size;
     
    8383                }
    8484        }
    85        
     85
    8686        printf(" %p: inflate area\n", (void *) top);
    87        
     87
    8888        void *kernel_entry = NULL;
    8989        void *dest[COMPONENTS];
    9090        size_t cnt = 0;
    9191        bootinfo.taskmap.cnt = 0;
    92        
     92
    9393        for (size_t i = 0; i < min(COMPONENTS, TASKMAP_MAX_RECORDS); i++) {
    9494                top = ALIGN_UP(top, PAGE_SIZE);
    95                
     95
    9696                if (i > 0) {
    9797                        bootinfo.taskmap.tasks[bootinfo.taskmap.cnt].addr =
     
    9999                        bootinfo.taskmap.tasks[bootinfo.taskmap.cnt].size =
    100100                            components[i].inflated;
    101                        
     101
    102102                        str_cpy(bootinfo.taskmap.tasks[bootinfo.taskmap.cnt].name,
    103103                            BOOTINFO_TASK_NAME_BUFLEN, components[i].name);
    104                        
     104
    105105                        bootinfo.taskmap.cnt++;
    106106                } else
    107107                        kernel_entry = (void *) PA2KA(top);
    108                
     108
    109109                dest[i] = (void *) top;
    110110                top += components[i].inflated;
    111111                cnt++;
    112112        }
    113        
     113
    114114        printf(" %p: kernel entry point\n", kernel_entry);
    115        
     115
    116116        if (top >= bootinfo.physmem_start + bootinfo.memmap.total) {
    117117                printf("Not enough physical memory available.\n");
     
    119119                halt();
    120120        }
    121        
     121
    122122        printf("\nInflating components ... ");
    123        
     123
    124124        for (size_t i = cnt; i > 0; i--) {
    125125                printf("%s ", components[i - 1].name);
    126                
     126
    127127                int err = inflate(components[i - 1].addr, components[i - 1].size,
    128128                    dest[i - 1], components[i - 1].inflated);
    129                
     129
    130130                if (err != EOK) {
    131131                        printf("\n%s: Inflating error %d, halting.\n",
     
    134134                }
    135135        }
    136        
     136
    137137        printf(".\n");
    138        
     138
    139139        printf("Booting the kernel...\n");
    140140        jump_to_kernel(PA2KA(&bootinfo));
  • boot/arch/riscv64/src/ucb.c

    r3061bc1 r8565a42  
    3939        if (!val)
    4040                return;
    41        
     41
    4242        fromhost = 0;
    4343}
     
    4848            (((uint64_t) cmd) << 48) |
    4949            (payload & UINT64_C(0xffffffffffff));
    50        
     50
    5151        while (tohost)
    5252                poll_fromhost();
    53        
     53
    5454        tohost = val;
    5555}
Note: See TracChangeset for help on using the changeset viewer.