Changeset a35b458 in mainline for kernel/arch/ppc32/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/ppc32/src/mm
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/ppc32/src/mm/as.c

    r3061bc1 ra35b458  
    5656{
    5757        uint32_t sr;
    58        
     58
    5959        /* Lower 2 GB, user and supervisor access */
    6060        for (sr = 0; sr < 8; sr++)
    6161                sr_set(0x6000, as->asid, sr);
    62        
     62
    6363        /* Upper 2 GB, only supervisor access */
    6464        for (sr = 8; sr < 16; sr++)
  • kernel/arch/ppc32/src/mm/frame.c

    r3061bc1 ra35b458  
    4545{
    4646        printf("[base    ] [size    ]\n");
    47        
     47
    4848        size_t i;
    4949        for (i = 0; i < memmap.cnt; i++) {
     
    5757        pfn_t minconf = 2;
    5858        size_t i;
    59        
     59
    6060        for (i = 0; i < memmap.cnt; i++) {
    6161                /* To be safe, make the available zone possibly smaller */
     
    6464                size_t size = ALIGN_DOWN(memmap.zones[i].size -
    6565                    (base - ((uintptr_t) memmap.zones[i].start)), FRAME_SIZE);
    66                
     66
    6767                if (!frame_adjust_zone_bounds(low, &base, &size))
    6868                        return;
     
    8686                }
    8787        }
    88        
     88
    8989}
    9090
     
    9292{
    9393        frame_common_arch_init(true);
    94        
     94
    9595        /* First is exception vector, second is 'implementation specific',
    9696           third and fourth is reserved, other contain real mode code */
    9797        frame_mark_unavailable(0, 8);
    98        
     98
    9999        /* Mark the Page Hash Table frames as unavailable */
    100100        uint32_t sdr1 = sdr1_get();
    101        
     101
    102102        // FIXME: compute size of PHT exactly
    103103        frame_mark_unavailable(ADDR2PFN(sdr1 & 0xffff000), 16);
  • kernel/arch/ppc32/src/mm/pht.c

    r3061bc1 ra35b458  
    9393        uint32_t page = (vaddr >> 12) & 0xffff;
    9494        uint32_t api = (vaddr >> 22) & 0x3f;
    95        
     95
    9696        uint32_t vsid = sr_get(vaddr);
    9797        uint32_t sdr1 = sdr1_get();
    98        
     98
    9999        // FIXME: compute size of PHT exactly
    100100        phte_t *phte = (phte_t *) PA2KA(sdr1 & 0xffff0000);
    101        
     101
    102102        /* Primary hash (xor) */
    103103        uint32_t h = 0;
     
    106106        uint32_t i;
    107107        bool found = false;
    108        
     108
    109109        /* Find colliding PTE in PTEG */
    110110        for (i = 0; i < 8; i++) {
     
    117117                }
    118118        }
    119        
     119
    120120        if (!found) {
    121121                /* Find unused PTE in PTEG */
     
    127127                }
    128128        }
    129        
     129
    130130        if (!found) {
    131131                /* Secondary hash (not) */
    132132                uint32_t base2 = (~hash & 0x3ff) << 3;
    133                
     133
    134134                /* Find colliding PTE in PTEG */
    135135                for (i = 0; i < 8; i++) {
     
    144144                        }
    145145                }
    146                
     146
    147147                if (!found) {
    148148                        /* Find unused PTE in PTEG */
     
    156156                        }
    157157                }
    158                
     158
    159159                if (!found)
    160160                        i = RANDI(seed) % 8;
    161161        }
    162        
     162
    163163        phte[base + i].v = 1;
    164164        phte[base + i].vsid = vsid;
     
    181181{
    182182        uintptr_t badvaddr;
    183        
     183
    184184        if (n == VECTOR_DATA_STORAGE)
    185185                badvaddr = istate->dar;
    186186        else
    187187                badvaddr = istate->pc;
    188        
     188
    189189        pte_t pte;
    190190        bool found = find_mapping_and_check(AS, badvaddr,
    191191            PF_ACCESS_READ /* FIXME */, istate, &pte);
    192        
     192
    193193        if (found) {
    194194                /* Record access to PTE */
     
    201201{
    202202        uint32_t sdr1 = sdr1_get();
    203        
     203
    204204        // FIXME: compute size of PHT exactly
    205205        phte_t *phte = (phte_t *) PA2KA(sdr1 & 0xffff0000);
    206        
     206
    207207        // FIXME: this invalidates all PHT entries,
    208208        // which is an overkill, invalidate only
  • kernel/arch/ppc32/src/mm/tlb.c

    r3061bc1 ra35b458  
    4242        ptehi_t ptehi;
    4343        ptelo_t ptelo;
    44        
     44
    4545        asm volatile (
    4646                "mfspr %[tlbmiss], 980\n"
     
    5151                  [ptelo] "=r" (ptelo)
    5252        );
    53        
     53
    5454        uint32_t badvaddr = tlbmiss & 0xfffffffc;
    5555        uint32_t physmem = physmem_top();
    56        
     56
    5757        if ((badvaddr < PA2KA(0)) || (badvaddr >= PA2KA(physmem)))
    5858                return; // FIXME
    59        
     59
    6060        ptelo.rpn = KA2PA(badvaddr) >> 12;
    6161        ptelo.wimg = 0;
    6262        ptelo.pp = 2; // FIXME
    63        
     63
    6464        uint32_t index = 0;
    6565        asm volatile (
     
    8484                "sync\n"
    8585        );
    86        
     86
    8787        for (unsigned int i = 0; i < 0x00040000; i += 0x00001000) {
    8888                asm volatile (
     
    9191                );
    9292        }
    93        
     93
    9494        asm volatile (
    9595                "eieio\n"
     
    143143{
    144144        uint32_t sr;
    145        
     145
    146146        for (sr = 0; sr < 16; sr++) {
    147147                uint32_t vsid = sr_get(sr << 28);
    148                
     148
    149149                printf("sr[%02" PRIu32 "]: vsid=%#0" PRIx32 " (asid=%" PRIu32 ")"
    150150                    "%s%s\n", sr, vsid & UINT32_C(0x00ffffff),
     
    153153                    ((vsid >> 29) & 1) ? " user" : "");
    154154        }
    155        
     155
    156156        uint32_t upper;
    157157        uint32_t lower;
    158158        uint32_t mask;
    159159        uint32_t length;
    160        
     160
    161161        PRINT_BAT("ibat[0]", 528, 529);
    162162        PRINT_BAT("ibat[1]", 530, 531);
    163163        PRINT_BAT("ibat[2]", 532, 533);
    164164        PRINT_BAT("ibat[3]", 534, 535);
    165        
     165
    166166        PRINT_BAT("dbat[0]", 536, 537);
    167167        PRINT_BAT("dbat[1]", 538, 539);
Note: See TracChangeset for help on using the changeset viewer.