Changeset a35b458 in mainline for kernel/arch/ia64/src/mm/tlb.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/ia64/src/mm/tlb.c

    r3061bc1 ra35b458  
    6161        uintptr_t adr;
    6262        uint32_t count1, count2, stride1, stride2;
    63        
     63
    6464        unsigned int i, j;
    65        
     65
    6666        adr = PAL_PTCE_INFO_BASE();
    6767        count1 = PAL_PTCE_INFO_COUNT1();
     
    6969        stride1 = PAL_PTCE_INFO_STRIDE1();
    7070        stride2 = PAL_PTCE_INFO_STRIDE2();
    71        
     71
    7272        ipl = interrupts_disable();
    73        
     73
    7474        for (i = 0; i < count1; i++) {
    7575                for (j = 0; j < count2; j++) {
     
    8282                adr += stride1;
    8383        }
    84        
     84
    8585        interrupts_restore(ipl);
    86        
     86
    8787        srlz_d();
    8888        srlz_i();
    89        
     89
    9090#ifdef CONFIG_VHPT
    9191        vhpt_invalidate_all();
     
    110110        int b = 0;
    111111        int c = cnt;
    112        
     112
    113113        uintptr_t va;
    114114        va = page;
    115        
     115
    116116        rr.word = rr_read(VA2VRN(page));
    117117        if ((restore_rr = (rr.map.rid != ASID2RID(asid, VA2VRN(page))))) {
     
    121121                 */
    122122                region_register_t rr0;
    123                
     123
    124124                rr0 = rr;
    125125                rr0.map.rid = ASID2RID(asid, VA2VRN(page));
     
    128128                srlz_i();
    129129        }
    130        
     130
    131131        while (c >>= 1)
    132132                b++;
    133133        b >>= 1;
    134134        uint64_t ps;
    135        
     135
    136136        switch (b) {
    137137        case 0: /* cnt 1 - 3 */
     
    172172                break;
    173173        }
    174        
     174
    175175        for (; va < (page + cnt * PAGE_SIZE); va += (1UL << ps))
    176176                asm volatile (
     
    179179                           [ps] "r" (ps << 2)
    180180                );
    181        
     181
    182182        srlz_d();
    183183        srlz_i();
    184        
     184
    185185        if (restore_rr) {
    186186                rr_write(VA2VRN(page), rr.word);
     
    229229        region_register_t rr;
    230230        bool restore_rr = false;
    231        
     231
    232232        rr.word = rr_read(VA2VRN(va));
    233233        if ((restore_rr = (rr.map.rid != ASID2RID(asid, VA2VRN(va))))) {
     
    237237                 */
    238238                region_register_t rr0;
    239                
     239
    240240                rr0 = rr;
    241241                rr0.map.rid = ASID2RID(asid, VA2VRN(va));
     
    244244                srlz_i();
    245245        }
    246        
     246
    247247        asm volatile (
    248248                "mov r8 = psr ;;\n"
     
    264264                : "p6", "p7", "r8"
    265265        );
    266        
     266
    267267        if (restore_rr) {
    268268                rr_write(VA2VRN(va), rr.word);
     
    316316        region_register_t rr;
    317317        bool restore_rr = false;
    318        
     318
    319319        rr.word = rr_read(VA2VRN(va));
    320320        if ((restore_rr = (rr.map.rid != ASID2RID(asid, VA2VRN(va))))) {
     
    324324                 */
    325325                region_register_t rr0;
    326                
     326
    327327                rr0 = rr;
    328328                rr0.map.rid = ASID2RID(asid, VA2VRN(va));
     
    331331                srlz_i();
    332332        }
    333        
     333
    334334        asm volatile (
    335335                "mov r8 = psr ;;\n"
     
    352352                : "p6", "p7", "r8"
    353353        );
    354        
     354
    355355        if (restore_rr) {
    356356                rr_write(VA2VRN(va), rr.word);
     
    373373{
    374374        tlb_entry_t entry;
    375        
     375
    376376        entry.word[0] = 0;
    377377        entry.word[1] = 0;
    378        
     378
    379379        entry.p = true;           /* present */
    380380        entry.ma = MA_WRITEBACK;
     
    385385        entry.ppn = frame >> PPN_SHIFT;
    386386        entry.ps = PAGE_WIDTH;
    387        
     387
    388388        if (dtr)
    389389                dtr_mapping_insert(page, ASID_KERNEL, entry, tr);
     
    418418{
    419419        tlb_entry_t entry;
    420        
     420
    421421        entry.word[0] = 0;
    422422        entry.word[1] = 0;
    423        
     423
    424424        entry.p = t->p;
    425425        entry.ma = t->c ? MA_WRITEBACK : MA_UNCACHEABLE;
     
    430430        entry.ppn = t->frame >> PPN_SHIFT;
    431431        entry.ps = PAGE_WIDTH;
    432        
     432
    433433        dtc_mapping_insert(t->page, t->as->asid, entry);
    434        
     434
    435435#ifdef CONFIG_VHPT
    436436        vhpt_mapping_insert(t->page, t->as->asid, entry);
     
    446446{
    447447        tlb_entry_t entry;
    448        
     448
    449449        entry.word[0] = 0;
    450450        entry.word[1] = 0;
    451        
     451
    452452        assert(t->x);
    453        
     453
    454454        entry.p = t->p;
    455455        entry.ma = t->c ? MA_WRITEBACK : MA_UNCACHEABLE;
     
    459459        entry.ppn = t->frame >> PPN_SHIFT;
    460460        entry.ps = PAGE_WIDTH;
    461        
     461
    462462        itc_mapping_insert(t->page, t->as->asid, entry);
    463        
     463
    464464#ifdef CONFIG_VHPT
    465465        vhpt_mapping_insert(t->page, t->as->asid, entry);
     
    486486        uintptr_t va;
    487487        pte_t t;
    488        
     488
    489489        va = istate->cr_ifa; /* faulting address */
    490        
     490
    491491        assert(!is_kernel_fault(va));
    492492
     
    532532                        uint64_t io_page = (va & ((1 << LEGACYIO_PAGE_WIDTH) - 1)) >>
    533533                            LEGACYIO_SINGLE_PAGE_WIDTH;
    534                        
     534
    535535                        if (is_io_page_accessible(io_page)) {
    536536                                uint64_t page, frame;
    537                                
     537
    538538                                page = LEGACYIO_USER_BASE +
    539539                                    (1 << LEGACYIO_SINGLE_PAGE_WIDTH) * io_page;
    540540                                frame = LEGACYIO_PHYS_BASE +
    541541                                    (1 << LEGACYIO_SINGLE_PAGE_WIDTH) * io_page;
    542                                
     542
    543543                                tlb_entry_t entry;
    544                                
     544
    545545                                entry.word[0] = 0;
    546546                                entry.word[1] = 0;
    547                                
     547
    548548                                entry.p = true;             /* present */
    549549                                entry.ma = MA_UNCACHEABLE;
     
    554554                                entry.ppn = frame >> PPN_SHIFT;
    555555                                entry.ps = LEGACYIO_SINGLE_PAGE_WIDTH;
    556                                
     556
    557557                                dtc_mapping_insert(page, TASK->as->asid, entry);
    558558                                return 1;
     
    563563                }
    564564        }
    565        
     565
    566566        return 0;
    567567}
     
    586586                return;
    587587        }
    588        
     588
    589589        uintptr_t va = istate->cr_ifa;  /* faulting address */
    590590        as_t *as = AS;
    591        
     591
    592592        if (is_kernel_fault(va)) {
    593593                if (va < end_of_identity) {
     
    601601                }
    602602        }
    603        
    604        
     603
     604
    605605        pte_t t;
    606606        bool found = page_mapping_find(as, va, true, &t);
     
    616616                if (try_memmap_io_insertion(va, istate))
    617617                        return;
    618                
     618
    619619                /*
    620620                 * Forward the page fault to the address space page fault
     
    649649        pte_t t;
    650650        as_t *as = AS;
    651        
     651
    652652        va = istate->cr_ifa;  /* faulting address */
    653        
     653
    654654        if (is_kernel_fault(va))
    655655                as = AS_KERNEL;
     
    683683        uintptr_t va;
    684684        pte_t t;
    685        
     685
    686686        va = istate->cr_ifa;  /* faulting address */
    687687
    688688        assert(!is_kernel_fault(va));
    689        
     689
    690690        bool found = page_mapping_find(AS, va, true, &t);
    691691
     
    717717        pte_t t;
    718718        as_t *as = AS;
    719        
     719
    720720        va = istate->cr_ifa;  /* faulting address */
    721        
     721
    722722        if (is_kernel_fault(va))
    723723                as = AS_KERNEL;
     
    755755        uintptr_t va;
    756756        pte_t t;
    757        
     757
    758758        va = istate->cr_ifa;  /* faulting address */
    759759
    760760        assert(!is_kernel_fault(va));
    761        
     761
    762762        /*
    763763         * Assume a write to a read-only page.
     
    782782        uintptr_t va;
    783783        pte_t t;
    784        
     784
    785785        va = istate->cr_ifa;  /* faulting address */
    786        
     786
    787787        assert(!is_kernel_fault(va));
    788788
     
    790790
    791791        assert(found);
    792        
     792
    793793        if (t.p) {
    794794                /*
Note: See TracChangeset for help on using the changeset viewer.