Changeset a35b458 in mainline for boot/arch/ppc32/src/main.c


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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • boot/arch/ppc32/src/main.c

    r3061bc1 ra35b458  
    6060        version_print();
    6161        ofw_memmap(&bootinfo.memmap);
    62        
     62
    6363        void *bootinfo_pa = ofw_translate(&bootinfo);
    6464        void *real_mode_pa = ofw_translate(&real_mode);
    6565        void *loader_address_pa = ofw_translate((void *) LOADER_ADDRESS);
    66        
     66
    6767        printf("\nMemory statistics (total %llu MB)\n", bootinfo.memmap.total >> 20);
    6868        printf(" %p|%p: real mode trampoline\n", &real_mode, real_mode_pa);
     
    7272        printf(" %p|%p: loader entry point\n",
    7373            (void *) LOADER_ADDRESS, loader_address_pa);
    74        
     74
    7575        size_t i;
    7676        for (i = 0; i < COMPONENTS; i++)
     
    7878                    ofw_translate(components[i].addr), components[i].name,
    7979                    components[i].inflated, components[i].size);
    80        
     80
    8181        size_t dest[COMPONENTS];
    8282        size_t top = 0;
     
    8585        for (i = 0; i < min(COMPONENTS, TASKMAP_MAX_RECORDS); i++) {
    8686                top = ALIGN_UP(top, PAGE_SIZE);
    87                
     87
    8888                if (i > 0) {
    8989                        bootinfo.taskmap.tasks[bootinfo.taskmap.cnt].addr =
     
    9191                        bootinfo.taskmap.tasks[bootinfo.taskmap.cnt].size =
    9292                            components[i].inflated;
    93                        
     93
    9494                        str_cpy(bootinfo.taskmap.tasks[bootinfo.taskmap.cnt].name,
    9595                            BOOTINFO_TASK_NAME_BUFLEN, components[i].name);
    96                        
     96
    9797                        bootinfo.taskmap.cnt++;
    9898                }
    99                
     99
    100100                dest[i] = top;
    101101                top += components[i].inflated;
    102102                cnt++;
    103103        }
    104        
     104
    105105        if (top >= (size_t) loader_address_pa) {
    106106                printf("Inflated components overlap loader area.\n");
     
    108108                halt();
    109109        }
    110        
     110
    111111        void *balloc_base;
    112112        void *balloc_base_pa;
     
    114114            BALLOC_MAX_SIZE, loader_address_pa);
    115115        printf(" %p|%p: boot allocator area\n", balloc_base, balloc_base_pa);
    116        
     116
    117117        void *inflate_base;
    118118        void *inflate_base_pa;
     
    120120            loader_address_pa);
    121121        printf(" %p|%p: inflate area\n", inflate_base, inflate_base_pa);
    122        
     122
    123123        uintptr_t balloc_start = ALIGN_UP(top, PAGE_SIZE);
    124124        size_t pages = (balloc_start + ALIGN_UP(BALLOC_MAX_SIZE, PAGE_SIZE))
     
    129129            pages * sizeof(void *), loader_address_pa);
    130130        printf(" %p|%p: translate table\n", transtable, transtable_pa);
    131        
     131
    132132        check_overlap("boot allocator area", balloc_base_pa, pages);
    133133        check_overlap("inflate area", inflate_base_pa, pages);
    134134        check_overlap("translate table", transtable_pa, pages);
    135        
     135
    136136        printf("\nInflating components ... ");
    137        
     137
    138138        for (i = cnt; i > 0; i--) {
    139139                printf("%s ", components[i - 1].name);
    140                
     140
    141141                int err = inflate(components[i - 1].addr, components[i - 1].size,
    142142                    inflate_base + dest[i - 1], components[i - 1].inflated);
    143                
     143
    144144                if (err != EOK) {
    145145                        printf("\n%s: Inflating error %d, halting.\n",
     
    148148                }
    149149        }
    150        
     150
    151151        printf(".\n");
    152        
     152
    153153        printf("Setting up boot allocator ...\n");
    154154        balloc_init(&bootinfo.ballocs, balloc_base, PA2KA(balloc_start),
    155155            BALLOC_MAX_SIZE);
    156        
     156
    157157        printf("Setting up screens ...\n");
    158158        ofw_setup_screens();
    159        
     159
    160160        printf("Canonizing OpenFirmware device tree ...\n");
    161161        bootinfo.ofw_root = ofw_tree_build();
    162        
     162
    163163        printf("Setting up translate table ...\n");
    164164        for (i = 0; i < pages; i++) {
    165165                uintptr_t off = i << PAGE_WIDTH;
    166166                void *phys;
    167                
     167
    168168                if (off < balloc_start)
    169169                        phys = ofw_translate(inflate_base + off);
    170170                else
    171171                        phys = ofw_translate(balloc_base + off - balloc_start);
    172                
     172
    173173                ((void **) transtable)[i] = phys;
    174174        }
    175        
     175
    176176        printf("Booting the kernel...\n");
    177177        jump_to_kernel(bootinfo_pa, transtable_pa, pages, real_mode_pa);
Note: See TracChangeset for help on using the changeset viewer.