Changeset a35b458 in mainline for kernel/arch/sparc64/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/sparc64/src/mm
Files:
8 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}
  • kernel/arch/sparc64/src/mm/sun4v/as.c

    r3061bc1 ra35b458  
    7979        as->arch.tsb_description.reserved = 0;
    8080        as->arch.tsb_description.context = 0;
    81        
     81
    8282        memsetb(tsb, TSB_SIZE, 0);
    8383#endif
    84        
     84
    8585        return EOK;
    8686}
     
    9090#ifdef CONFIG_TSB
    9191        frame_free(as->arch.tsb_description.tsb_base, TSB_FRAMES);
    92        
     92
    9393        return TSB_FRAMES;
    9494#else
     
    102102        tsb_invalidate(as, 0, (size_t) -1);
    103103#endif
    104        
     104
    105105        return EOK;
    106106}
     
    117117{
    118118        mmu_secondary_context_write(as->asid);
    119        
     119
    120120#ifdef CONFIG_TSB
    121121        uintptr_t base = ALIGN_DOWN(config.base, 1 << KERNEL_PAGE_WIDTH);
    122        
     122
    123123        assert(as->arch.tsb_description.tsb_base);
    124124        uintptr_t tsb = PA2KA(as->arch.tsb_description.tsb_base);
    125        
     125
    126126        if (!overlaps(tsb, TSB_SIZE, base, 1 << KERNEL_PAGE_WIDTH)) {
    127127                /*
     
    134134                dtlb_insert_mapping(tsb, KA2PA(tsb), PAGESIZE_64K, true, true);
    135135        }
    136        
     136
    137137        __hypercall_fast2(MMU_TSB_CTXNON0, 1, KA2PA(&as->arch.tsb_description));
    138138#endif
     
    156156         *
    157157         */
    158        
     158
    159159#ifdef CONFIG_TSB
    160160        uintptr_t base = ALIGN_DOWN(config.base, 1 << KERNEL_PAGE_WIDTH);
    161        
     161
    162162        assert(as->arch.tsb_description.tsb_base);
    163        
     163
    164164        uintptr_t tsb = PA2KA(as->arch.tsb_description.tsb_base);
    165        
     165
    166166        if (!overlaps(tsb, TSB_SIZE, base, 1 << KERNEL_PAGE_WIDTH)) {
    167167                /*
  • kernel/arch/sparc64/src/mm/sun4v/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;
     
    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);
  • kernel/arch/sparc64/src/mm/sun4v/tlb.c

    r3061bc1 ra35b458  
    128128{
    129129        tte_data_t data;
    130        
     130
    131131        data.value = 0;
    132132        data.v = true;
     
    143143        data.w = true;
    144144        data.size = pagesize;
    145        
     145
    146146        if (locked) {
    147147                __hypercall_fast4(
     
    163163{
    164164        tte_data_t data;
    165        
     165
    166166        data.value = 0;
    167167        data.v = true;
     
    178178        data.w = ro ? false : t->w;
    179179        data.size = PAGESIZE_8K;
    180        
     180
    181181        __hypercall_hyperfast(
    182182                t->page, t->as->asid, data.value, MMU_FLAG_DTLB, 0, MMU_MAP_ADDR);
     
    190190{
    191191        tte_data_t data;
    192        
     192
    193193        data.value = 0;
    194194        data.v = true;
     
    203203        data.w = false;
    204204        data.size = PAGESIZE_8K;
    205        
     205
    206206        __hypercall_hyperfast(
    207207                t->page, t->as->asid, data.value, MMU_FLAG_ITLB, 0, MMU_MAP_ADDR);
     
    387387{
    388388        unsigned int i;
    389        
     389
    390390        /* switch to nucleus because we are mapped by the primary context */
    391391        nucleus_enter();
  • kernel/arch/sparc64/src/mm/sun4v/tsb.c

    r3061bc1 ra35b458  
    5959        size_t i0, i;
    6060        size_t cnt;
    61        
     61
    6262        assert(as->arch.tsb_description.tsb_base);
    63        
     63
    6464        i0 = (page >> MMU_PAGE_WIDTH) & TSB_ENTRY_MASK;
    6565
     
    6868        else
    6969                cnt = pages;
    70        
     70
    7171        tsb = (tsb_entry_t *) PA2KA(as->arch.tsb_description.tsb_base);
    7272        for (i = 0; i < cnt; i++)
     
    8787        as = t->as;
    8888        index = (t->page >> MMU_PAGE_WIDTH) & TSB_ENTRY_MASK;
    89        
     89
    9090        tsb = (tsb_entry_t *) PA2KA(as->arch.tsb_description.tsb_base);
    9191        tte = &tsb[index];
     
    114114        tte->data.w = false;
    115115        tte->data.size = PAGESIZE_8K;
    116        
     116
    117117        write_barrier();
    118        
     118
    119119        tte->data.v = t->p;     /* v as valid, p as present */
    120120}
     
    162162        tte->data.w = ro ? false : t->w;
    163163        tte->data.size = PAGESIZE_8K;
    164        
     164
    165165        write_barrier();
    166        
     166
    167167        tte->data.v = t->p;     /* v as valid, p as present */
    168168}
Note: See TracChangeset for help on using the changeset viewer.