Changeset a35b458 in mainline for boot/arch/riscv64/src


Ignore:
Timestamp:
2018-03-02T20:10:49Z (8 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f1380b7
Parents:
3061bc1
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:38:31)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:10:49)
Message:

style: Remove trailing whitespace on _all_ lines, including empty ones, for particular file types.

Command used: tools/srepl '\s\+$' '' -- *.c *.h *.py *.sh *.s *.S *.ag

Currently, whitespace on empty lines is very inconsistent.
There are two basic choices: Either remove the whitespace, or keep empty lines
indented to the level of surrounding code. The former is AFAICT more common,
and also much easier to do automatically.

Alternatively, we could write script for automatic indentation, and use that
instead. However, if such a script exists, it's possible to use the indented
style locally, by having the editor apply relevant conversions on load/save,
without affecting remote repository. IMO, it makes more sense to adopt
the simpler rule.

Location:
boot/arch/riscv64/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • boot/arch/riscv64/src/asm.S

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