Changeset a35b458 in mainline for kernel/genarch/src/mm/page_pt.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/genarch/src/mm/page_pt.c

    r3061bc1 ra35b458  
    8383
    8484        assert(page_table_locked(as));
    85        
     85
    8686        if (GET_PTL1_FLAGS(ptl0, PTL0_INDEX(page)) & PAGE_NOT_PRESENT) {
    8787                pte_t *newpt = (pte_t *)
     
    100100                SET_PTL1_PRESENT(ptl0, PTL0_INDEX(page));
    101101        }
    102        
     102
    103103        pte_t *ptl1 = (pte_t *) PA2KA(GET_PTL1_ADDRESS(ptl0, PTL0_INDEX(page)));
    104        
     104
    105105        if (GET_PTL2_FLAGS(ptl1, PTL1_INDEX(page)) & PAGE_NOT_PRESENT) {
    106106                pte_t *newpt = (pte_t *)
     
    117117                SET_PTL2_PRESENT(ptl1, PTL1_INDEX(page));
    118118        }
    119        
     119
    120120        pte_t *ptl2 = (pte_t *) PA2KA(GET_PTL2_ADDRESS(ptl1, PTL1_INDEX(page)));
    121        
     121
    122122        if (GET_PTL3_FLAGS(ptl2, PTL2_INDEX(page)) & PAGE_NOT_PRESENT) {
    123123                pte_t *newpt = (pte_t *)
     
    134134                SET_PTL3_PRESENT(ptl2, PTL2_INDEX(page));
    135135        }
    136        
     136
    137137        pte_t *ptl3 = (pte_t *) PA2KA(GET_PTL3_ADDRESS(ptl2, PTL2_INDEX(page)));
    138        
     138
    139139        SET_FRAME_ADDRESS(ptl3, PTL3_INDEX(page), frame);
    140140        SET_FRAME_FLAGS(ptl3, PTL3_INDEX(page), flags | PAGE_NOT_PRESENT);
     
    165165         * First, remove the mapping, if it exists.
    166166         */
    167        
     167
    168168        pte_t *ptl0 = (pte_t *) PA2KA((uintptr_t) as->genarch.page_table);
    169169        if (GET_PTL1_FLAGS(ptl0, PTL0_INDEX(page)) & PAGE_NOT_PRESENT)
    170170                return;
    171        
     171
    172172        pte_t *ptl1 = (pte_t *) PA2KA(GET_PTL1_ADDRESS(ptl0, PTL0_INDEX(page)));
    173173        if (GET_PTL2_FLAGS(ptl1, PTL1_INDEX(page)) & PAGE_NOT_PRESENT)
    174174                return;
    175        
     175
    176176        pte_t *ptl2 = (pte_t *) PA2KA(GET_PTL2_ADDRESS(ptl1, PTL1_INDEX(page)));
    177177        if (GET_PTL3_FLAGS(ptl2, PTL2_INDEX(page)) & PAGE_NOT_PRESENT)
    178178                return;
    179        
     179
    180180        pte_t *ptl3 = (pte_t *) PA2KA(GET_PTL3_ADDRESS(ptl2, PTL2_INDEX(page)));
    181        
     181
    182182        /*
    183183         * Destroy the mapping.
     
    189189        SET_FRAME_FLAGS(ptl3, PTL3_INDEX(page), PAGE_NOT_PRESENT);
    190190        memsetb(&ptl3[PTL3_INDEX(page)], sizeof(pte_t), 0);
    191        
     191
    192192        /*
    193193         * Second, free all empty tables along the way from PTL3 down to PTL0
    194194         * except those needed for sharing the kernel non-identity mappings.
    195195         */
    196        
     196
    197197        /* Check PTL3 */
    198198        bool empty = true;
    199        
     199
    200200        unsigned int i;
    201201        for (i = 0; i < PTL3_ENTRIES; i++) {
     
    205205                }
    206206        }
    207        
     207
    208208        if (empty) {
    209209                /*
     
    232232                return;
    233233        }
    234        
     234
    235235        /* Check PTL2, empty is still true */
    236236#if (PTL2_ENTRIES != 0)
     
    241241                }
    242242        }
    243        
     243
    244244        if (empty) {
    245245                /*
     
    267267        }
    268268#endif /* PTL2_ENTRIES != 0 */
    269        
     269
    270270        /* check PTL1, empty is still true */
    271271#if (PTL1_ENTRIES != 0)
     
    276276                }
    277277        }
    278        
     278
    279279        if (empty) {
    280280                /*
     
    301301
    302302        read_barrier();
    303        
     303
    304304        pte_t *ptl1 = (pte_t *) PA2KA(GET_PTL1_ADDRESS(ptl0, PTL0_INDEX(page)));
    305305        if (GET_PTL2_FLAGS(ptl1, PTL1_INDEX(page)) & PAGE_NOT_PRESENT)
     
    312312        read_barrier();
    313313#endif
    314        
     314
    315315        pte_t *ptl2 = (pte_t *) PA2KA(GET_PTL2_ADDRESS(ptl1, PTL1_INDEX(page)));
    316316        if (GET_PTL3_FLAGS(ptl2, PTL2_INDEX(page)) & PAGE_NOT_PRESENT)
     
    323323        read_barrier();
    324324#endif
    325        
     325
    326326        pte_t *ptl3 = (pte_t *) PA2KA(GET_PTL3_ADDRESS(ptl2, PTL2_INDEX(page)));
    327        
     327
    328328        return &ptl3[PTL3_INDEX(page)];
    329329}
     
    400400{
    401401        assert(size > 0);
    402        
     402
    403403        uintptr_t ptl0 = PA2KA((uintptr_t) AS_KERNEL->genarch.page_table);
    404404        uintptr_t ptl0_step = ptl0_step_get();
    405405        size_t frames;
    406        
     406
    407407#if (PTL1_ENTRIES != 0)
    408408        frames = PTL1_FRAMES;
     
    412412        frames = PTL3_FRAMES;
    413413#endif
    414        
     414
    415415        for (uintptr_t addr = ALIGN_DOWN(base, ptl0_step);
    416416            addr - 1 < base + size - 1;
Note: See TracChangeset for help on using the changeset viewer.