Changeset a35b458 in mainline for kernel/arch/sparc64/src/mm/sun4u


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/sparc64/src/mm/sun4u
Files:
4 edited

Legend:

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

    r3061bc1 ra35b458  
    6969        tsb_entry_t *tsb = (tsb_entry_t *) PA2KA(tsb_base);
    7070        memsetb(tsb, TSB_SIZE, 0);
    71        
     71
    7272        as->arch.itsb = tsb;
    7373        as->arch.dtsb = tsb + ITSB_ENTRY_COUNT;
    7474#endif
    75        
     75
    7676        return EOK;
    7777}
     
    8181#ifdef CONFIG_TSB
    8282        frame_free(KA2PA((uintptr_t) as->arch.itsb), TSB_FRAMES);
    83        
     83
    8484        return TSB_FRAMES;
    8585#else
     
    9393        tsb_invalidate(as, 0, (size_t) -1);
    9494#endif
    95        
     95
    9696        return 0;
    9797}
     
    107107{
    108108        tlb_context_reg_t ctx;
    109        
     109
    110110        /*
    111111         * Note that we don't and may not lock the address space. That's ok
     
    115115         *
    116116         */
    117        
     117
    118118        /*
    119119         * Write ASID to secondary context register. The primary context
     
    126126        ctx.context = as->asid;
    127127        mmu_secondary_context_write(ctx.v);
    128        
     128
    129129#ifdef CONFIG_TSB
    130130        uintptr_t base = ALIGN_DOWN(config.base, 1 << KERNEL_PAGE_WIDTH);
    131        
     131
    132132        assert(as->arch.itsb);
    133133        assert(as->arch.dtsb);
    134        
     134
    135135        uintptr_t tsb = (uintptr_t) as->arch.itsb;
    136        
     136
    137137        if (!overlaps(tsb, TSB_SIZE, base, 1 << KERNEL_PAGE_WIDTH)) {
    138138                /*
     
    145145                dtlb_insert_mapping(tsb, KA2PA(tsb), PAGESIZE_64K, true, true);
    146146        }
    147        
     147
    148148        /*
    149149         * Setup TSB Base registers.
     
    151151         */
    152152        tsb_base_reg_t tsb_base_reg;
    153        
     153
    154154        tsb_base_reg.value = 0;
    155155        tsb_base_reg.size = TSB_BASE_REG_SIZE;
    156156        tsb_base_reg.split = 0;
    157        
     157
    158158        tsb_base_reg.base = ((uintptr_t) as->arch.itsb) >> MMU_PAGE_WIDTH;
    159159        itsb_base_write(tsb_base_reg.value);
    160160        tsb_base_reg.base = ((uintptr_t) as->arch.dtsb) >> MMU_PAGE_WIDTH;
    161161        dtsb_base_write(tsb_base_reg.value);
    162        
     162
    163163#if defined (US3)
    164164        /*
     
    198198         *
    199199         */
    200        
     200
    201201#ifdef CONFIG_TSB
    202202        uintptr_t base = ALIGN_DOWN(config.base, 1 << KERNEL_PAGE_WIDTH);
    203        
     203
    204204        assert(as->arch.itsb);
    205205        assert(as->arch.dtsb);
    206        
     206
    207207        uintptr_t tsb = (uintptr_t) as->arch.itsb;
    208        
     208
    209209        if (!overlaps(tsb, TSB_SIZE, base, 1 << KERNEL_PAGE_WIDTH)) {
    210210                /*
  • kernel/arch/sparc64/src/mm/sun4u/frame.c

    r3061bc1 ra35b458  
    4848{
    4949        unsigned int i;
    50        
     50
    5151        for (i = 0; i < memmap.cnt; i++) {
    5252                uintptr_t base;
     
    6262                size = ALIGN_DOWN(memmap.zones[i].size -
    6363                    (base - ((uintptr_t) memmap.zones[i].start)), FRAME_SIZE);
    64                
     64
    6565                if (!frame_adjust_zone_bounds(low, &base, &size))
    6666                        continue;
    67  
     67
    6868                pfn_t confdata;
    6969                pfn_t pfn = ADDR2PFN(base);
     
    7474                        if (confdata == ADDR2PFN(KA2PA(PFN2ADDR(0))))
    7575                                confdata = ADDR2PFN(KA2PA(PFN2ADDR(2)));
    76                        
     76
    7777                        zone_create(pfn, count, confdata,
    7878                            ZONE_AVAILABLE | ZONE_LOWMEM);
     
    9090        if (config.cpu_active > 1)
    9191                return;
    92        
     92
    9393        frame_common_arch_init(true);
    94        
     94
    9595        /*
    9696         * On sparc64, physical memory can start on a non-zero address.
  • kernel/arch/sparc64/src/mm/sun4u/tlb.c

    r3061bc1 ra35b458  
    178178        tag.context = t->as->asid;
    179179        tag.vpn = pg.vpn;
    180        
     180
    181181        itlb_tag_access_write(tag.value);
    182        
     182
    183183        data.value = 0;
    184184        data.v = true;
     
    190190        data.w = false;
    191191        data.g = t->g;
    192        
     192
    193193        itlb_data_in_write(data.value);
    194194}
     
    353353        tlb_data_t d;
    354354        tlb_tag_read_reg_t t;
    355        
     355
    356356        printf("I-TLB contents:\n");
    357357        for (i = 0; i < ITLB_ENTRY_COUNT; i++) {
     
    377377        tlb_data_t d;
    378378        tlb_tag_read_reg_t t;
    379        
     379
    380380        printf("TLB_ISMALL contents:\n");
    381381        for (i = 0; i < tlb_ismall_size(); i++) {
     
    384384                print_tlb_entry(i, t, d);
    385385        }
    386        
     386
    387387        printf("TLB_IBIG contents:\n");
    388388        for (i = 0; i < tlb_ibig_size(); i++) {
     
    391391                print_tlb_entry(i, t, d);
    392392        }
    393        
     393
    394394        printf("TLB_DSMALL contents:\n");
    395395        for (i = 0; i < tlb_dsmall_size(); i++) {
     
    398398                print_tlb_entry(i, t, d);
    399399        }
    400        
     400
    401401        printf("TLB_DBIG_1 contents:\n");
    402402        for (i = 0; i < tlb_dbig_size(); i++) {
     
    405405                print_tlb_entry(i, t, d);
    406406        }
    407        
     407
    408408        printf("TLB_DBIG_2 contents:\n");
    409409        for (i = 0; i < tlb_dbig_size(); i++) {
     
    423423        sfsr.value = dtlb_sfsr_read();
    424424        sfar = dtlb_sfar_read();
    425        
     425
    426426#if defined (US)
    427427        printf("DTLB SFSR: asi=%#x, ft=%#x, e=%d, ct=%d, pr=%d, w=%d, ow=%d, "
     
    433433            sfsr.e, sfsr.ct, sfsr.pr, sfsr.w, sfsr.ow, sfsr.fv);
    434434#endif
    435        
     435
    436436        printf("DTLB SFAR: address=%p\n", (void *) sfar);
    437        
     437
    438438        dtlb_sfsr_write(0);
    439439}
     
    446446        sfsr.value = dtlb_sfsr_read();
    447447        sfar = dtlb_sfar_read();
    448        
     448
    449449#if defined (US)
    450450        printf("DTLB SFSR: asi=%#x, ft=%#x, e=%d, ct=%d, pr=%d, w=%d, ow=%d, "
     
    456456            sfsr.e, sfsr.ct, sfsr.pr, sfsr.w, sfsr.ow, sfsr.fv);
    457457#endif
    458            
     458
    459459        printf("DTLB SFAR: address=%p\n", (void *) sfar);
    460        
     460
    461461        dtlb_sfsr_write(0);
    462462}
     
    467467{
    468468        int i;
    469        
     469
    470470        /*
    471471         * Walk all ITLB and DTLB entries and remove all unlocked mappings.
     
    521521{
    522522        tlb_context_reg_t pc_save, ctx;
    523        
     523
    524524        /* switch to nucleus because we are mapped by the primary context */
    525525        nucleus_enter();
    526        
     526
    527527        ctx.v = pc_save.v = mmu_primary_context_read();
    528528        ctx.context = asid;
    529529        mmu_primary_context_write(ctx.v);
    530        
     530
    531531        itlb_demap(TLB_DEMAP_CONTEXT, TLB_DEMAP_PRIMARY, 0);
    532532        dtlb_demap(TLB_DEMAP_CONTEXT, TLB_DEMAP_PRIMARY, 0);
    533        
     533
    534534        mmu_primary_context_write(pc_save.v);
    535        
     535
    536536        nucleus_leave();
    537537}
     
    548548        unsigned int i;
    549549        tlb_context_reg_t pc_save, ctx;
    550        
     550
    551551        /* switch to nucleus because we are mapped by the primary context */
    552552        nucleus_enter();
    553        
     553
    554554        ctx.v = pc_save.v = mmu_primary_context_read();
    555555        ctx.context = asid;
    556556        mmu_primary_context_write(ctx.v);
    557        
     557
    558558        for (i = 0; i < cnt * MMU_PAGES_PER_PAGE; i++) {
    559559                itlb_demap(TLB_DEMAP_PAGE, TLB_DEMAP_PRIMARY,
     
    562562                    page + i * MMU_PAGE_SIZE);
    563563        }
    564        
     564
    565565        mmu_primary_context_write(pc_save.v);
    566        
     566
    567567        nucleus_leave();
    568568}
  • kernel/arch/sparc64/src/mm/sun4u/tsb.c

    r3061bc1 ra35b458  
    5757        size_t i;
    5858        size_t cnt;
    59        
     59
    6060        assert(as->arch.itsb);
    6161        assert(as->arch.dtsb);
    62        
     62
    6363        i0 = (page >> MMU_PAGE_WIDTH) & ITSB_ENTRY_MASK;
    6464
     
    6767        else
    6868                cnt = pages * 2;
    69        
     69
    7070        for (i = 0; i < cnt; i++) {
    7171                as->arch.itsb[(i0 + i) & ITSB_ENTRY_MASK].tag.invalid = true;
     
    8686
    8787        assert(index <= 1);
    88        
     88
    8989        as = t->as;
    9090        entry = ((t->page >> MMU_PAGE_WIDTH) + index) & ITSB_ENTRY_MASK;
     
    112112        tte->data.p = t->k;     /* p as privileged, k as kernel */
    113113        tte->data.v = t->p;     /* v as valid, p as present */
    114        
     114
    115115        write_barrier();
    116        
     116
    117117        tte->tag.invalid = false;       /* mark the entry as valid */
    118118}
     
    129129        tsb_entry_t *tte;
    130130        size_t entry;
    131        
     131
    132132        assert(index <= 1);
    133133
     
    161161        tte->data.w = ro ? false : t->w;
    162162        tte->data.v = t->p;
    163        
     163
    164164        write_barrier();
    165        
     165
    166166        tte->tag.invalid = false;       /* mark the entry as valid */
    167167}
Note: See TracChangeset for help on using the changeset viewer.