Changeset a35b458 in mainline for kernel/arch/ia32/src/mm/frame.c


Ignore:
Timestamp:
2018-03-02T20:10:49Z (7 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
  • kernel/arch/ia32/src/mm/frame.c

    r3061bc1 ra35b458  
    5454{
    5555        unsigned int i;
    56        
     56
    5757        for (i = 0; i < e820counter; i++) {
    5858                uint64_t base64 = e820table[i].base_address;
    5959                uint64_t size64 = e820table[i].size;
    60                
     60
    6161#ifdef KARCH_ia32
    6262                /*
     
    6565                if (base64 >= PHYSMEM_LIMIT32)
    6666                        continue;
    67                
     67
    6868                if (base64 + size64 > PHYSMEM_LIMIT32)
    6969                        size64 = PHYSMEM_LIMIT32 - base64;
    7070#endif
    71                
     71
    7272                uintptr_t base = (uintptr_t) base64;
    7373                size_t size = (size_t) size64;
    74                
     74
    7575                if (!frame_adjust_zone_bounds(low, &base, &size))
    7676                        continue;
    77                
     77
    7878                if (e820table[i].type == MEMMAP_MEMORY_AVAILABLE) {
    7979                        /* To be safe, make the available zone possibly smaller */
     
    8181                        uint64_t new_size = ALIGN_DOWN(size - (new_base - base),
    8282                            FRAME_SIZE);
    83                        
     83
    8484                        size_t count = SIZE2FRAMES(new_size);
    8585                        pfn_t pfn = ADDR2PFN(new_base);
    8686                        pfn_t conf;
    87                        
     87
    8888                        if (low) {
    8989                                if ((minconf < pfn) || (minconf >= pfn + count))
     
    105105                        uint64_t new_size = ALIGN_UP(size + (base - new_base),
    106106                            FRAME_SIZE);
    107                        
     107
    108108                        zone_create(ADDR2PFN(new_base), SIZE2FRAMES(new_size), 0,
    109109                            ZONE_FIRMWARE);
     
    113113                        uint64_t new_size = ALIGN_UP(size + (base - new_base),
    114114                            FRAME_SIZE);
    115                        
     115
    116116                        zone_create(ADDR2PFN(new_base), SIZE2FRAMES(new_size), 0,
    117117                            ZONE_RESERVED);
     
    133133        unsigned int i;
    134134        printf("[base            ] [size            ] [name   ]\n");
    135        
     135
    136136        for (i = 0; i < e820counter; i++) {
    137137                const char *name;
    138                
     138
    139139                if (e820table[i].type <= MEMMAP_MEMORY_UNUSABLE)
    140140                        name = e820names[e820table[i].type];
    141141                else
    142142                        name = "invalid";
    143                
     143
    144144                printf("%#018" PRIx64 " %#018" PRIx64" %s\n", e820table[i].base_address,
    145145                    e820table[i].size, name);
     
    150150{
    151151        pfn_t minconf;
    152        
     152
    153153        if (config.cpu_active == 1) {
    154154                minconf = 1;
    155                
     155
    156156#ifdef CONFIG_SMP
    157157                minconf = max(minconf,
     
    159159                    hardcoded_unmapped_kdata_size));
    160160#endif
    161                
     161
    162162                init_e820_memory(minconf, true);
    163                
     163
    164164                /* Reserve frame 0 (BIOS data) */
    165165                frame_mark_unavailable(0, 1);
    166                
     166
    167167#ifdef CONFIG_SMP
    168168                /* Reserve AP real mode bootstrap memory */
Note: See TracChangeset for help on using the changeset viewer.