Changeset a35b458 in mainline for kernel/arch/mips32/src/mm


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:
kernel/arch/mips32/src/mm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/mips32/src/mm/frame.c

    r3061bc1 ra35b458  
    8282        if (frame == (KA2PA(MSIM_VIDEORAM) >> ZERO_PAGE_WIDTH))
    8383                return false;
    84        
     84
    8585        /* MSIM device (dkeyboard) */
    8686        if (frame == (KA2PA(MSIM_KBD_ADDRESS) >> ZERO_PAGE_WIDTH))
     
    9292                return false;
    9393#endif
    94        
     94
    9595        return true;
    9696}
     
    108108        if ((frame << ZERO_PAGE_WIDTH) < KA2PA(config.base))
    109109                return false;
    110        
     110
    111111        /* Kernel */
    112112        if (overlaps(frame << ZERO_PAGE_WIDTH, ZERO_PAGE_SIZE,
    113113            KA2PA(config.base), config.kernel_size))
    114114                return false;
    115        
     115
    116116        /* Kernel stack */
    117117        if (overlaps(frame << ZERO_PAGE_WIDTH, ZERO_PAGE_SIZE,
    118118            KA2PA(config.stack_base), config.stack_size))
    119119                return false;
    120        
     120
    121121        /* Init tasks */
    122122        bool safe = true;
     
    128128                        break;
    129129                }
    130        
     130
    131131        return safe;
    132132}
     
    161161                            ZONE_AVAILABLE | ZONE_HIGHMEM);
    162162        }
    163        
     163
    164164        if (phys_regions_count < MAX_REGIONS) {
    165165                phys_regions[phys_regions_count].start = first;
     
    182182{
    183183        ipl_t ipl = interrupts_disable();
    184        
     184
    185185        /* Clear and initialize TLB */
    186186        cp0_pagemask_write(ZERO_PAGE_MASK);
     
    194194                tlbwi();
    195195        }
    196                
     196
    197197        pfn_t start_frame = 0;
    198198        pfn_t frame;
    199199        bool avail = true;
    200        
     200
    201201        /* Walk through all 1 MB frames */
    202202        for (frame = 0; frame < ZERO_FRAMES; frame++) {
     
    211211                                tlb_prepare_entry_lo(&lo1, false, false, false, false, 0);
    212212                                tlb_prepare_entry_hi(&hi, ZERO_PAGE_ASID, ZERO_PAGE_ADDR);
    213                                
     213
    214214                                cp0_pagemask_write(ZERO_PAGE_MASK);
    215215                                cp0_entry_lo0_write(lo0.value);
     
    218218                                cp0_index_write(ZERO_PAGE_TLBI);
    219219                                tlbwi();
    220                                
     220
    221221                                ZERO_PAGE_VALUE = 0;
    222222                                if (ZERO_PAGE_VALUE != 0)
     
    229229                        }
    230230                }
    231                
     231
    232232                if (!avail) {
    233233                        frame_add_region(start_frame, frame, true);
     
    236236                }
    237237        }
    238        
     238
    239239        frame_add_region(start_frame, frame, true);
    240        
     240
    241241        /* Blacklist interrupt vector frame */
    242242        frame_mark_unavailable(0, 1);
     
    267267        frame_mark_unavailable(0, 1024 * 1024 / FRAME_SIZE);
    268268#endif
    269        
     269
    270270        /* Cleanup */
    271271        cp0_pagemask_write(ZERO_PAGE_MASK);
     
    275275        cp0_index_write(ZERO_PAGE_TLBI);
    276276        tlbwi();
    277        
     277
    278278        interrupts_restore(ipl);
    279279}
     
    286286{
    287287        printf("[base    ] [size    ]\n");
    288        
     288
    289289        size_t i;
    290290        for (i = 0; i < phys_regions_count; i++) {
  • kernel/arch/mips32/src/mm/tlb.c

    r3061bc1 ra35b458  
    7676
    7777        /* Clear and initialize TLB. */
    78        
     78
    7979        for (i = 0; i < TLB_ENTRY_COUNT; i++) {
    8080                cp0_index_write(i);
    8181                tlbwi();
    8282        }
    83        
     83
    8484        /*
    8585         * The kernel is going to make use of some wired
     
    9898        uintptr_t badvaddr;
    9999        pte_t pte;
    100        
     100
    101101        badvaddr = cp0_badvaddr_read();
    102102
     
    291291        lo1_save.value = cp0_entry_lo1_read();
    292292        mask_save.value = cp0_pagemask_read();
    293        
     293
    294294        printf("[nr] [asid] [vpn2    ] [mask] [gvdc] [pfn     ]\n");
    295        
     295
    296296        for (i = 0; i < TLB_ENTRY_COUNT; i++) {
    297297                cp0_index_write(i);
    298298                tlbr();
    299                
     299
    300300                mask.value = cp0_pagemask_read();
    301301                hi.value = cp0_entry_hi_read();
    302302                lo0.value = cp0_entry_lo0_read();
    303303                lo1.value = cp0_entry_lo1_read();
    304                
     304
    305305                printf("%-4u %-6u %0#10x %-#6x  %1u%1u%1u%1u  %0#10x\n",
    306306                    i, hi.asid, HI_VPN22ADDR(hi.vpn2), mask.mask,
     
    309309                    lo1.g, lo1.v, lo1.d, lo1.c, LO_PFN2ADDR(lo1.pfn));
    310310        }
    311        
     311
    312312        cp0_entry_hi_write(hi_save.value);
    313313        cp0_entry_lo0_write(lo0_save.value);
     
    339339                cp0_entry_lo0_write(lo0.value);
    340340                cp0_entry_lo1_write(lo1.value);
    341                                
     341
    342342                tlbwi();
    343343        }
    344        
     344
    345345        cp0_entry_hi_write(hi_save.value);
    346346}
     
    360360
    361361        hi_save.value = cp0_entry_hi_read();
    362        
     362
    363363        for (i = 0; i < TLB_ENTRY_COUNT; i++) {
    364364                cp0_index_write(i);
    365365                tlbr();
    366                
     366
    367367                hi.value = cp0_entry_hi_read();
    368                
     368
    369369                if (hi.asid == asid) {
    370370                        lo0.value = cp0_entry_lo0_read();
     
    380380                }
    381381        }
    382        
     382
    383383        cp0_entry_hi_write(hi_save.value);
    384384}
     
    399399
    400400        assert(interrupts_disabled());
    401        
     401
    402402        if (asid == ASID_INVALID)
    403403                return;
     
    431431                }
    432432        }
    433        
     433
    434434        cp0_entry_hi_write(hi_save.value);
    435435}
Note: See TracChangeset for help on using the changeset viewer.