Changeset a35b458 in mainline for kernel/arch/ppc32/src/mm/pht.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
  • 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
Note: See TracChangeset for help on using the changeset viewer.