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


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.

Location:
kernel/arch/sparc64/src
Files:
36 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/sparc64/src/asm.S

    r3061bc1 ra35b458  
    4747        add %o0, 7, %g1
    4848        mov 0, %g3
    49        
     49
    5050        0:
    51        
     51
    5252                brz,pn %o2, 2f
    5353                mov 0, %g2
    54        
     54
    5555        1:
    56        
     56
    5757                lduba [%g3 + %o1] ASI_AIUS, %g1
    5858                add %g2, 1, %g2
     
    6161                bne,pt %xcc, 1b
    6262                mov %g2, %g3
    63        
     63
    6464        2:
    65        
     65
    6666                jmp %o7 + 8  /* exit point */
    6767                mov %o3, %o0
    68        
     68
    6969        3:
    70        
     70
    7171                and %g1, -8, %g1
    7272                cmp %o0, %g1
     
    7676                brz,pn %g4, 5f
    7777                mov 0, %g5
    78        
     78
    7979        4:
    80        
     80
    8181                sllx %g3, 3, %g2
    8282                add %g5, 1, %g3
     
    8686                bne,pt %xcc, 4b
    8787                stx %g1, [%o0 + %g2]
    88        
     88
    8989        5:
    90        
     90
    9191                and %o2, 7, %o2
    9292                brz,pn %o2, 2b
     
    9696                add %g1, %o1, %g4
    9797                mov 0, %g3
    98        
     98
    9999        6:
    100        
     100
    101101                lduba [%g2 + %g4] ASI_AIUS, %g1
    102102                stb %g1, [%g2 + %o0]
     
    105105                bne,pt %xcc, 6b
    106106                mov %g2, %g3
    107                
     107
    108108                jmp %o7 + 8  /* exit point */
    109109                mov %o3, %o0
     
    121121        add %o0, 7, %g1
    122122        mov 0, %g3
    123        
     123
    124124        0:
    125        
     125
    126126                brz,pn %o2, 2f
    127127                mov 0, %g2
    128        
     128
    129129        1:
    130        
     130
    131131                ldub [%g3 + %o1], %g1
    132132                add %g2, 1, %g2
     
    135135                bne,pt %xcc, 1b
    136136                mov %g2, %g3
    137        
     137
    138138        2:
    139        
     139
    140140                jmp %o7 + 8  /* exit point */
    141141                mov %o3, %o0
    142        
     142
    143143        3:
    144        
     144
    145145                and %g1, -8, %g1
    146146                cmp %o0, %g1
     
    150150                brz,pn %g4, 5f
    151151                mov 0, %g5
    152        
     152
    153153        4:
    154        
     154
    155155                sllx %g3, 3, %g2
    156156                add %g5, 1, %g3
     
    160160                bne,pt %xcc, 4b
    161161                stxa %g1, [%o0 + %g2] ASI_AIUS
    162        
     162
    163163        5:
    164        
     164
    165165                and %o2, 7, %o2
    166166                brz,pn %o2, 2b
     
    170170                add %g1, %o1, %g4
    171171                mov 0, %g3
    172        
     172
    173173        6:
    174        
     174
    175175                ldub [%g2 + %g4], %g1
    176176                stba %g1, [%g2 + %o0] ASI_AIUS
     
    179179                bne,pt %xcc, 6b
    180180                mov %g2, %g3
    181                
     181
    182182                jmp     %o7 + 8  /* exit point */
    183183                mov     %o3, %o0
  • kernel/arch/sparc64/src/console.c

    r3061bc1 ra35b458  
    6969        if (!screen)
    7070                panic("Cannot find %s.", (char *) prop_scr->value);
    71        
     71
    7272        scr_init(screen);
    7373#endif
     
    8282        if (!keyboard)
    8383                panic("Cannot find %s.", (char *) prop_kbd->value);
    84        
     84
    8585        kbd_init(keyboard);
    8686#endif
     
    9595        ofw_tree_node_t *aliases;
    9696        ofw_tree_property_t *prop;
    97        
     97
    9898        aliases = ofw_tree_lookup("/aliases");
    9999        if (!aliases)
    100100                panic("Cannot find '/aliases'.");
    101        
     101
    102102        /* "def-cn" = "default console" */
    103103        prop = ofw_tree_getprop(aliases, "def-cn");
    104        
     104
    105105        if ((!prop) || (!prop->value))
    106106                standard_console_init(aliases);
  • kernel/arch/sparc64/src/cpu/sun4u/cpu.c

    r3061bc1 ra35b458  
    5959        if ((!prop) || (!prop->value))
    6060                prop = ofw_tree_getprop(node, "cpuid");
    61        
     61
    6262        if (prop && prop->value) {
    6363                mid = *((uint32_t *) prop->value);
     
    6969                }
    7070        }
    71        
     71
    7272        return -1;
    7373}
     
    8080        ofw_tree_node_t *node;
    8181        uint32_t clock_frequency = 0;
    82        
     82
    8383        CPU->arch.mid = read_mid();
    84        
     84
    8585        /*
    8686         * Detect processor frequency.
     
    109109                }
    110110        }
    111                
     111
    112112        CPU->arch.clock_frequency = clock_frequency;
    113113        tick_init();
     
    146146                break;
    147147        }
    148        
     148
    149149        switch (CPU->arch.ver.impl) {
    150150        case IMPL_ULTRASPARCI:
  • kernel/arch/sparc64/src/cpu/sun4v/cpu.c

    r3061bc1 ra35b458  
    7171                }
    7272        }
    73                
     73
    7474        tick_init();
    7575
  • kernel/arch/sparc64/src/debug/stacktrace.c

    r3061bc1 ra35b458  
    5757{
    5858        uintptr_t kstack;
    59        
     59
    6060#if defined(SUN4U)
    6161        kstack = read_from_ag_g6();
  • kernel/arch/sparc64/src/drivers/kbd.c

    r3061bc1 ra35b458  
    6262{
    6363        const char *name = ofw_tree_node_name(node);
    64        
     64
    6565        if (str_cmp(name, "su") != 0)
    6666                return false;
    67        
     67
    6868        /*
    6969         * Read 'interrupts' property.
     
    7575                return false;
    7676        }
    77        
     77
    7878        uint32_t interrupts = *((uint32_t *) prop->value);
    79        
     79
    8080        /*
    8181         * Read 'reg' property.
     
    8787                return false;
    8888        }
    89        
     89
    9090        size_t size = ((ofw_ebus_reg_t *) prop->value)->size;
    91        
     91
    9292        uintptr_t pa = 0; // Prevent -Werror=maybe-uninitialized
    9393        if (!ofw_ebus_apply_ranges(node->parent,
     
    9797                return false;
    9898        }
    99        
     99
    100100        inr_t inr;
    101101        cir_t cir;
     
    108108                return false;
    109109        }
    110        
     110
    111111        /*
    112112         * We need to pass aligned address to hw_map().
     
    117117        uintptr_t aligned_addr = ALIGN_DOWN(pa, PAGE_SIZE);
    118118        size_t offset = pa - aligned_addr;
    119        
     119
    120120        ioport8_t *ns16550 = (ioport8_t *) (km_map(aligned_addr, offset + size,
    121121            PAGE_WRITE | PAGE_NOT_CACHEABLE) + offset);
    122        
     122
    123123        ns16550_instance_t *ns16550_instance = ns16550_init(ns16550, 0, inr, cir,
    124124            cir_arg, NULL);
     
    131131                }
    132132        }
    133        
     133
    134134        /*
    135135         * This is the necessary evil until the userspace drivers are
     
    140140        sysinfo_set_item_val("kbd.address.physical", NULL, pa);
    141141        sysinfo_set_item_val("kbd.type.ns16550", NULL, true);
    142        
     142
    143143        return true;
    144144}
  • kernel/arch/sparc64/src/drivers/niagara.c

    r3061bc1 ra35b458  
    126126         * shared buffer to the console.
    127127         */
    128        
     128
    129129        while (output_buffer.read_ptr != output_buffer.write_ptr) {
    130130                do_putchar(output_buffer.data[output_buffer.read_ptr]);
     
    132132                    ((output_buffer.read_ptr) + 1) % OUTPUT_BUFFER_SIZE;
    133133        }
    134        
     134
    135135        /*
    136136         * Read character from keyboard.
    137137         */
    138        
     138
    139139        uint64_t c;
    140140        if (__hypercall_fast_ret1(0, 0, 0, 0, 0, CONS_GETCHAR, &c) == HV_EOK) {
     
    174174        if (instance)
    175175                return;
    176        
     176
    177177        instance = malloc(sizeof(niagara_instance_t), FRAME_ATOMIC);
    178178        instance->thread = thread_create(kniagarapoll, NULL, TASK,
    179179            THREAD_FLAG_UNCOUNTED, "kniagarapoll");
    180        
     180
    181181        if (!instance->thread) {
    182182                free(instance);
     
    184184                return;
    185185        }
    186        
     186
    187187        instance->srlnin = NULL;
    188        
     188
    189189        output_buffer.read_ptr = 0;
    190190        output_buffer.write_ptr = 0;
    191191        input_buffer.write_ptr = 0;
    192192        input_buffer.read_ptr = 0;
    193        
     193
    194194        /*
    195195         * Set sysinfos and pareas so that the userspace counterpart of the
     
    197197         * buffers.
    198198         */
    199        
     199
    200200        sysinfo_set_item_val("fb", NULL, true);
    201201        sysinfo_set_item_val("fb.kind", NULL, 5);
    202        
     202
    203203        sysinfo_set_item_val("niagara.outbuf.address", NULL,
    204204            KA2PA(&output_buffer));
     
    207207        sysinfo_set_item_val("niagara.outbuf.datasize", NULL,
    208208            OUTPUT_BUFFER_SIZE);
    209        
     209
    210210        sysinfo_set_item_val("niagara.inbuf.address", NULL,
    211211            KA2PA(&input_buffer));
     
    214214        sysinfo_set_item_val("niagara.inbuf.datasize", NULL,
    215215           INPUT_BUFFER_SIZE);
    216        
     216
    217217        outbuf_parea.pbase = (uintptr_t) (KA2PA(&output_buffer));
    218218        outbuf_parea.frames = 1;
     
    220220        outbuf_parea.mapped = false;
    221221        ddi_parea_register(&outbuf_parea);
    222        
     222
    223223        inbuf_parea.pbase = (uintptr_t) (KA2PA(&input_buffer));
    224224        inbuf_parea.frames = 1;
     
    226226        inbuf_parea.mapped = false;
    227227        ddi_parea_register(&inbuf_parea);
    228        
     228
    229229        outdev_t *niagara_dev = malloc(sizeof(outdev_t), FRAME_ATOMIC);
    230230        outdev_initialize("niagara_dev", niagara_dev, &niagara_ops);
     
    238238{
    239239        niagara_init();
    240        
     240
    241241        if (instance) {
    242242                srln_instance_t *srln_instance = srln_init();
     
    244244                        indev_t *sink = stdin_wire();
    245245                        indev_t *srln = srln_wire(srln_instance, sink);
    246                        
     246
    247247                        instance->srlnin = srln;
    248248                        thread_ready(instance->thread);
    249249                }
    250250        }
    251        
     251
    252252        return instance;
    253253}
  • kernel/arch/sparc64/src/drivers/pci.c

    r3061bc1 ra35b458  
    183183        if (!prop || !prop->value)
    184184                return NULL;
    185        
     185
    186186        if (str_cmp(prop->value, "SUNW,sabre") == 0) {
    187187                /*
  • kernel/arch/sparc64/src/drivers/scr.c

    r3061bc1 ra35b458  
    6767        ofw_sbus_reg_t *sbus_reg;
    6868        const char *name;
    69        
     69
    7070        name = ofw_tree_node_name(node);
    71        
     71
    7272        if (str_cmp(name, "SUNW,m64B") == 0)
    7373                scr_type = SCR_ATYFB;
     
    8080        else if (str_cmp(name, "QEMU,VGA") == 0)
    8181                scr_type = SCR_QEMU_VGA;
    82        
     82
    8383        if (scr_type == SCR_UNKNOWN) {
    8484                log(LF_ARCH, LVL_ERROR, "Unknown screen device.");
    8585                return;
    8686        }
    87        
     87
    8888        uintptr_t fb_addr;
    8989        unsigned int fb_offset = 0;
     
    121121                        return;
    122122                }
    123        
     123
    124124                pci_reg = &((ofw_pci_reg_t *) prop->value)[1];
    125                
     125
    126126                if (!ofw_pci_reg_absolutize(node, pci_reg, &pci_abs_reg)) {
    127127                        log(LF_ARCH, LVL_ERROR,
     
    129129                        return;
    130130                }
    131        
     131
    132132                if (!ofw_pci_apply_ranges(node->parent, &pci_abs_reg,
    133133                    &fb_addr)) {
     
    136136                        return;
    137137                }
    138                
     138
    139139                switch (fb_depth) {
    140140                case 8:
     
    159159                        return;
    160160                }
    161                
     161
    162162                break;
    163163        case SCR_XVR:
     
    167167                        return;
    168168                }
    169        
     169
    170170                pci_reg = &((ofw_pci_reg_t *) prop->value)[1];
    171                
     171
    172172                if (!ofw_pci_reg_absolutize(node, pci_reg, &pci_abs_reg)) {
    173173                        log(LF_ARCH, LVL_ERROR,
     
    175175                        return;
    176176                }
    177        
     177
    178178                if (!ofw_pci_apply_ranges(node->parent, &pci_abs_reg,
    179179                    &fb_addr)) {
     
    207207                        return;
    208208                }
    209                
     209
    210210                break;
    211211        case SCR_FFB:
     
    231231                        return;
    232232                }
    233                
     233
    234234                sbus_reg = &((ofw_sbus_reg_t *) prop->value)[0];
    235235                if (!ofw_sbus_apply_ranges(node->parent, sbus_reg, &fb_addr)) {
     
    238238                        return;
    239239                }
    240        
     240
    241241                break;
    242242
     
    297297                .visual = visual,
    298298        };
    299        
     299
    300300        outdev_t *fbdev = fb_init(&props);
    301301        if (fbdev)
  • kernel/arch/sparc64/src/drivers/tick.c

    r3061bc1 ra35b458  
    8989
    9090        softint.value = softint_read();
    91        
     91
    9292        /*
    9393         * Make sure we are servicing interrupt_level_14
    9494         */
    9595        assert(n == TT_INTERRUPT_LEVEL_14);
    96        
     96
    9797        /*
    9898         * Make sure we are servicing TICK_INT.
     
    106106        clear.tick_int = 1;
    107107        clear_softint_write(clear.value);
    108        
     108
    109109        /*
    110110         * Reprogram the compare register.
  • kernel/arch/sparc64/src/fpu_context.c

    r3061bc1 ra35b458  
    6767         * GCC (4.1.1) can't handle more than 30 operands in one asm statement.
    6868         */
    69        
     69
    7070        asm volatile (
    7171                "std %%f32, %0\n"
     
    9090                  "=m" (fctx->d[28]), "=m" (fctx->d[29]), "=m" (fctx->d[30]), "=m" (fctx->d[31])
    9191        );
    92        
     92
    9393        asm volatile ("stx %%fsr, %0\n" : "=m" (fctx->fsr));
    9494}
     
    119119                  "m" (fctx->d[12]), "m" (fctx->d[13]), "m" (fctx->d[14]), "m" (fctx->d[15])
    120120        );
    121        
     121
    122122        /*
    123123         * We need to split loading of the floating-point registers because
    124124         * GCC (4.1.1) can't handle more than 30 operands in one asm statement.
    125125         */
    126        
     126
    127127        asm volatile (
    128128                "ldd %0, %%f32\n"
     
    148148                  "m" (fctx->d[28]), "m" (fctx->d[29]), "m" (fctx->d[30]), "m" (fctx->d[31])
    149149        );
    150        
     150
    151151        asm volatile ("ldx %0, %%fsr\n" : : "m" (fctx->fsr));
    152152}
     
    155155{
    156156        pstate_reg_t pstate;
    157        
     157
    158158        pstate.value = pstate_read();
    159159        pstate.pef = true;
     
    164164{
    165165        pstate_reg_t pstate;
    166        
     166
    167167        pstate.value = pstate_read();
    168168        pstate.pef = false;
  • 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}
  • kernel/arch/sparc64/src/proc/sun4v/scheduler.c

    r3061bc1 ra35b458  
    7171                THREAD->arch.uspace_window_buffer =
    7272                    (uint8_t *) asi_u64_read(ASI_SCRATCHPAD, SCRATCHPAD_WBUF);
    73                
     73
    7474        }
    7575}
  • kernel/arch/sparc64/src/smp/sun4u/ipi.c

    r3061bc1 ra35b458  
    9797         * we explicitly disable preemption.
    9898         */
    99        
     99
    100100        preemption_disable();
    101        
     101
    102102        status = asi_u64_read(ASI_INTR_DISPATCH_STATUS, 0);
    103103        if (status & INTR_DISPATCH_STATUS_BUSY)
    104104                panic("Interrupt Dispatch Status busy bit set\n");
    105        
     105
    106106        assert(!(pstate_read() & PSTATE_IE_BIT));
    107        
     107
    108108        do {
    109109                set_intr_w_data(func);
     
    111111                    (mid << INTR_VEC_DISPATCH_MID_SHIFT) |
    112112                    VA_INTR_W_DISPATCH, 0);
    113        
     113
    114114                membar();
    115                
     115
    116116                do {
    117117                        status = asi_u64_read(ASI_INTR_DISPATCH_STATUS, 0);
    118118                } while (status & INTR_DISPATCH_STATUS_BUSY);
    119                
     119
    120120                done = !(status & INTR_DISPATCH_STATUS_NACK);
    121121                if (!done) {
     
    128128                }
    129129        } while (!done);
    130        
     130
    131131        preemption_enable();
    132132}
     
    147147{
    148148        unsigned int i;
    149        
     149
    150150        void (* func)(void);
    151        
     151
    152152        switch (ipi) {
    153153        case IPI_TLB_SHOOTDOWN:
     
    158158                break;
    159159        }
    160        
     160
    161161        /*
    162162         * As long as we don't support hot-plugging
     
    165165         * without locking.
    166166         */
    167        
     167
    168168        for (i = 0; i < config.cpu_active; i++) {
    169169                if (&cpus[i] == CPU)
     
    187187{
    188188        assert(&cpus[cpu_id] != CPU);
    189        
     189
    190190        if (ipi == IPI_SMP_CALL) {
    191191                cross_call(cpus[cpu_id].arch.mid, smp_call_ipi_recv);
  • kernel/arch/sparc64/src/smp/sun4u/smp.c

    r3061bc1 ra35b458  
    6262        ofw_tree_node_t *node;
    6363        unsigned int cnt = 0;
    64        
     64
    6565        if (is_us() || is_us_iii()) {
    6666                node = ofw_tree_find_child_by_device_type(cpus_parent(), "cpu");
     
    7676                }
    7777        }
    78        
     78
    7979        config.cpu_count = max(1, cnt);
    8080}
     
    8989        uint32_t mid;
    9090        ofw_tree_property_t *prop;
    91                
     91
    9292        /* 'upa-portid' for US, 'portid' for US-III, 'cpuid' for US-IV */
    9393        prop = ofw_tree_getprop(node, "upa-portid");
     
    9696        if ((!prop) || (!prop->value))
    9797                prop = ofw_tree_getprop(node, "cpuid");
    98                
     98
    9999        if (!prop || prop->value == NULL)
    100100                return;
    101                
     101
    102102        mid = *((uint32_t *) prop->value);
    103103        if (CPU->arch.mid == mid)
     
    105105
    106106        waking_up_mid = mid;
    107                
     107
    108108        if (waitq_sleep_timeout(&ap_completion_wq, 1000000,
    109109            SYNCH_FLAGS_NONE, NULL) == ETIMEOUT)
     
    117117        ofw_tree_node_t *node;
    118118        int i;
    119        
     119
    120120        if (is_us() || is_us_iii()) {
    121121                node = ofw_tree_find_child_by_device_type(cpus_parent(), "cpu");
  • kernel/arch/sparc64/src/smp/sun4v/ipi.c

    r3061bc1 ra35b458  
    9696{
    9797        void (* func)(void);
    98        
     98
    9999        switch (ipi) {
    100100        case IPI_TLB_SHOOTDOWN:
  • kernel/arch/sparc64/src/smp/sun4v/smp.c

    r3061bc1 ra35b458  
    359359        if (__hypercall_fast1(CPU_STOP, cpuid) != EOK)
    360360                return false;
    361        
     361
    362362        /* wait for the CPU to stop */
    363363        uint64_t state;
     
    365365        while (state == CPU_STATE_RUNNING)
    366366                __hypercall_fast_ret1(cpuid, 0, 0, 0, 0, CPU_STATE, &state);
    367        
     367
    368368        /* make the CPU run again and execute HelenOS code */
    369369        if (__hypercall_fast4(CPU_START, cpuid,
     
    372372                return false;
    373373#endif
    374        
     374
    375375        if (waitq_sleep_timeout(&ap_completion_wq, 10000000,
    376376            SYNCH_FLAGS_NONE, NULL) == ETIMEOUT)
    377377                printf("%s: waiting for processor (cpuid = %" PRIu64 ") timed out\n",
    378378                    __func__, cpuid);
    379        
     379
    380380        return true;
    381381}
  • kernel/arch/sparc64/src/sparc64.c

    r3061bc1 ra35b458  
    7979                if (options) {
    8080                        ofw_tree_property_t *prop;
    81                
     81
    8282                        prop = ofw_tree_getprop(options, "boot-args");
    8383                        if (prop && prop->value) {
  • kernel/arch/sparc64/src/sun4u/asm.S

    r3061bc1 ra35b458  
    102102        wrpr %g1, TSTATE_IE_BIT, %tstate
    103103        wrpr %i0, 0, %tnpc
    104        
     104
    105105        /*
    106106         * Set primary context according to secondary context.
     
    117117         */
    118118        wrpr %g0, WSTATE_OTHER(0) | WSTATE_NORMAL(1), %wstate
    119        
     119
    120120        done                            ! jump to userspace
    121121FUNCTION_END(switch_to_userspace)
  • kernel/arch/sparc64/src/sun4u/sparc64.c

    r3061bc1 ra35b458  
    7272        /* Copy init task info. */
    7373        init.cnt = min3(bootinfo->taskmap.cnt, TASKMAP_MAX_RECORDS, CONFIG_INIT_TASKS);
    74        
     74
    7575        size_t i;
    7676        for (i = 0; i < init.cnt; i++) {
     
    8080                    bootinfo->taskmap.tasks[i].name);
    8181        }
    82        
     82
    8383        /* Copy physical memory map. */
    8484        memmap.total = bootinfo->memmap.total;
     
    8888                memmap.zones[i].size = bootinfo->memmap.zones[i].size;
    8989        }
    90        
     90
    9191        /* Copy boot allocations info. */
    9292        ballocs.base = bootinfo->ballocs.base;
    9393        ballocs.size = bootinfo->ballocs.size;
    94        
     94
    9595        ofw_tree_init(bootinfo->ofw_root);
    9696}
     
    111111                /* Map OFW information into sysinfo */
    112112                ofw_sysinfo_map();
    113                
     113
    114114                /*
    115115                 * We have 2^11 different interrupt vectors.
     
    167167            (ALIGN_UP(STACK_ITEM_SIZE, STACK_ALIGNMENT) + STACK_BIAS),
    168168            (uintptr_t) kernel_uarg->uspace_uarg);
    169        
     169
    170170        /* Not reached */
    171171        while (1);
  • kernel/arch/sparc64/src/sun4u/start.S

    r3061bc1 ra35b458  
    8585        ! Get bits (PHYSMEM_ADDR_SIZE - 1):13 of physmem_base.
    8686        srlx %l6, 13, %l5
    87        
     87
    8888        ! l5 <= physmem_base[(PHYSMEM_ADDR_SIZE - 1):13]
    8989        sllx %l5, 13 + (63 - (PHYSMEM_ADDR_SIZE - 1)), %l5
     
    101101        wrpr %g0, NWINDOWS - 1, %cleanwin       ! prevent needless clean_window
    102102                                                ! traps for kernel
    103                                                
     103
    104104        wrpr %g0, 0, %wstate                    ! use default spill/fill trap
    105105
     
    132132        set (TLB_DEMAP_CONTEXT << TLB_DEMAP_TYPE_SHIFT) | (context_id << \
    133133                TLB_DEMAP_CONTEXT_SHIFT), %r1
    134        
     134
    135135        ! demap context 0
    136136        SET_TLB_DEMAP_CMD(g1, TLB_DEMAP_NUCLEUS)
     
    161161        sllx %r2, TTE_V_SHIFT, %r2; \
    162162        or %r1, %r2, %r1;
    163        
     163
    164164        ! write DTLB data and install the kernel mapping
    165165        SET_TLB_DATA(g1, g2, TTE_L | TTE_W)     ! use non-global mapping
     
    182182        stxa %g1, [%g0] ASI_DTLB_DATA_IN_REG
    183183        membar #Sync
    184        
     184
    185185        /*
    186186         * Now is time to take over the IMMU. Unfortunatelly, it cannot be done
     
    202202         * the taken over DTLB.
    203203         */
    204        
     204
    205205        set kernel_image_start, %g5
    206        
     206
    207207        ! write ITLB tag of context 1
    208208        SET_TLB_TAG(g1, MEM_CONTEXT_TEMP)
     
    215215        stxa %g1, [%g0] ASI_ITLB_DATA_IN_REG
    216216        flush %g5
    217        
     217
    218218        ! switch to context 1
    219219        mov MEM_CONTEXT_TEMP, %g1
    220220        stxa %g1, [VA_PRIMARY_CONTEXT_REG] %asi ! ASI_DMMU is correct here !!!
    221221        flush %g5
    222        
     222
    223223        ! demap context 0
    224224        SET_TLB_DEMAP_CMD(g1, TLB_DEMAP_NUCLEUS)
    225225        stxa %g0, [%g1] ASI_IMMU_DEMAP
    226226        flush %g5
    227        
     227
    228228        ! write ITLB tag of context 0
    229229        SET_TLB_TAG(g1, MEM_CONTEXT_KERNEL)
     
    244244        stxa %g0, [%g1] ASI_IMMU_DEMAP
    245245        flush %g5
    246        
     246
    247247        ! set context 0 in the primary context register
    248248        stxa %g0, [VA_PRIMARY_CONTEXT_REG] %asi ! ASI_DMMU is correct here !!!
    249249        flush %g5
    250        
     250
    251251        ! leave nucleus - using primary context, i.e. context 0
    252252        wrpr %g0, 0, %tl
     
    271271        or %l3, %l5, %l3
    272272        stx %l3, [%l4 + %lo(kernel_8k_tlb_data_template)]
    273        
     273
    274274        ! flush the whole D-cache
    275275        set (DCACHE_SIZE - DCACHE_LINE_SIZE), %g1
    276276        stxa %g0, [%g1] ASI_DCACHE_TAG
    277        
     277
    2782780:
    279279        membar #Sync
     
    282282        stxa %g0, [%g1] ASI_DCACHE_TAG
    283283        membar #Sync
    284        
     284
    285285        /*
    286286         * So far, we have not touched the stack.
     
    290290        or %sp, %lo(temporary_boot_stack), %sp
    291291        sub %sp, STACK_BIAS, %sp
    292        
     292
    293293        /*
    294294         * Call sparc64_pre_main(bootinfo)
     
    296296        call sparc64_pre_main
    297297        mov %o1, %o0
    298        
     298
    299299        /*
    300300         * Create the first stack frame.
     
    372372        /* Not reached. */
    373373#endif
    374        
     374
    3753750:
    376376        ba,a %xcc, 0b
  • kernel/arch/sparc64/src/sun4v/asm.S

    r3061bc1 ra35b458  
    5858        wrpr %g1, TSTATE_IE_BIT, %tstate
    5959        wrpr %i0, 0, %tnpc
    60        
     60
    6161        /*
    6262         * Set primary context according to secondary context.
  • kernel/arch/sparc64/src/sun4v/md.c

    r3061bc1 ra35b458  
    244244                char *head;
    245245                more = str_parse_head(&name, &head);
    246                
     246
    247247                while (md_next_child(&node)) {
    248248                        element_idx_t child = md_get_child_node(node);
     
    292292                        return true;
    293293                }
    294                
     294
    295295                (*node)++;
    296296        } while (element->tag != LIST_END);
  • kernel/arch/sparc64/src/sun4v/sparc64.c

    r3061bc1 ra35b458  
    7474        /* Copy init task info. */
    7575        init.cnt = min3(bootinfo->taskmap.cnt, TASKMAP_MAX_RECORDS, CONFIG_INIT_TASKS);
    76        
     76
    7777        size_t i;
    7878        for (i = 0; i < init.cnt; i++) {
     
    8282                    bootinfo->taskmap.tasks[i].name);
    8383        }
    84        
     84
    8585        /* Copy physical memory map. */
    8686        memmap.total = bootinfo->memmap.total;
     
    9090                memmap.zones[i].size = bootinfo->memmap.zones[i].size;
    9191        }
    92        
     92
    9393        md_init();
    9494}
     
    109109                /* Map OFW information into sysinfo */
    110110                ofw_sysinfo_map();
    111                
     111
    112112                /*
    113113                 * We have 2^11 different interrupt vectors.
     
    165165            (ALIGN_UP(STACK_ITEM_SIZE, STACK_ALIGNMENT) + STACK_BIAS),
    166166            (uintptr_t) kernel_uarg->uspace_uarg);
    167        
     167
    168168        /* Not reached */
    169169        while (1);
  • kernel/arch/sparc64/src/sun4v/start.S

    r3061bc1 ra35b458  
    115115        ! Get bits (PHYSMEM_ADDR_SIZE - 1):13 of physmem_base.
    116116        srlx %l6, 13, %l5
    117        
     117
    118118        ! l5 <= physmem_base[(PHYSMEM_ADDR_SIZE - 1):13]
    119119        sllx %l5, 13 + (63 - (PHYSMEM_ADDR_SIZE - 1)), %l5
     
    130130        wrpr %g0, NWINDOWS - 1, %cleanwin       ! prevent needless clean_window
    131131                                                ! traps for kernel
    132                                                
     132
    133133        wrpr %g0, 0, %wstate                    ! use default spill/fill trap
    134134
     
    252252        call sparc64_pre_main
    253253        or %l1, %g0, %o0
    254        
     254
    255255        /*
    256256         * Create the first stack frame.
  • kernel/arch/sparc64/src/trap/exception.c

    r3061bc1 ra35b458  
    4848        const char *tpcs = symtab_fmt_name_lookup(istate->tpc);
    4949        const char *tnpcs = symtab_fmt_name_lookup(istate->tnpc);
    50        
     50
    5151        printf("TSTATE=%#" PRIx64 "\n", istate->tstate);
    5252        printf("TPC=%#" PRIx64 " (%s)\n", istate->tpc, tpcs);
     
    100100{
    101101        fprs_reg_t fprs;
    102        
     102
    103103        fprs.value = fprs_read();
    104104        if (!fprs.fef) {
  • kernel/arch/sparc64/src/trap/sun4u/interrupt.c

    r3061bc1 ra35b458  
    5858        if (status & (!INTR_DISPATCH_STATUS_BUSY))
    5959                panic("Interrupt Dispatch Status busy bit not set\n");
    60        
     60
    6161        uint64_t intrcv = asi_u64_read(ASI_INTR_RECEIVE, 0);
    6262#if defined (US)
     
    6565        uint64_t data0 = asi_u64_read(ASI_INTR_R, VA_INTR_R_DATA_0);
    6666#endif
    67        
     67
    6868        irq_t *irq = irq_dispatch_and_lock(data0);
    6969        if (irq) {
     
    7272                 */
    7373                irq->handler(irq);
    74                
     74
    7575                /*
    7676                 * See if there is a clear-interrupt-routine and call it.
     
    7878                if (irq->cir)
    7979                        irq->cir(irq->cir_arg, irq->inr);
    80                
     80
    8181                irq_spinlock_unlock(&irq->lock, false);
    8282        } else if (data0 > config.base) {
     
    103103#endif
    104104        }
    105        
     105
    106106        membar();
    107107        asi_u64_write(ASI_INTR_RECEIVE, 0, 0);
  • kernel/arch/sparc64/src/trap/sun4u/trap_table.S

    r3061bc1 ra35b458  
    502502.if NOT(\is_syscall)
    503503        rdpr %tstate, %g3
    504        
     504
    505505        /*
    506506         * One of the ways this handler can be invoked is after a nested MMU trap from
     
    576576         */
    577577        wrpr %g0, WSTATE_OTHER(0) | WSTATE_NORMAL(0), %wstate
    578        
     578
    579579        /*
    580580         * Copy arguments.
     
    605605         */
    606606        stx %g4, [%sp + STACK_BIAS + ISTATE_OFFSET_Y]
    607        
     607
    608608        wrpr %g0, 0, %tl
    609609        wrpr %g0, PSTATE_PRIV_BIT | PSTATE_PEF_BIT, %pstate
    610610        SAVE_GLOBALS
    611        
     611
    612612.if NOT(\is_syscall)
    613613        /*
     
    629629        wrpr %g0, PSTATE_AG_BIT | PSTATE_PRIV_BIT, %pstate
    630630        wrpr %g0, 1, %tl
    631        
     631
    632632        /*
    633633         * Read TSTATE, TPC and TNPC from saved copy.
     
    742742        rd %pc, %g1
    743743        flush %g1
    744        
     744
    745745        rdpr %cwp, %g1
    746746        rdpr %otherwin, %g2
     
    800800        mov NWINDOWS - 2, %g1                   ! use dealy slot for both cases
    801801        sub %g1, %g2, %g1
    802        
     802
    803803        wrpr %g0, 0, %otherwin
    804804        wrpr %g1, 0, %cansave                   ! NWINDOWS - 2 - CANRESTORE
     
    845845        and %g1, NWINDOWS - 1, %g1
    846846        wrpr %g1, 0, %cwp                       ! CWP--
    847        
     847
    848848.if \is_syscall
    849849        done
  • kernel/arch/sparc64/src/trap/sun4v/trap_table.S

    r3061bc1 ra35b458  
    606606        and \tmpreg1, NWINDOWS - 1, \tmpreg1            ! modulo NWINDOWS
    607607        wrpr \tmpreg1, %cwp
    608        
     608
    609609        ! spill to kernel stack
    610610        stx %l0, [%sp + STACK_BIAS + L0_OFFSET]
     
    766766        ldx [%sp + STACK_BIAS + ISTATE_OFFSET_Y], %g4
    767767        wr %g4, %y
    768        
     768
    769769        /* If TSTATE.CWP + 1 == CWP, then we do not have to fix CWP. */
    770770        and %g1, TSTATE_CWP_MASK, %l0
     
    871871        and \tmpreg1, NWINDOWS - 1, \tmpreg1            ! modulo NWINDOWS
    872872        wrpr \tmpreg1, %cwp
    873        
     873
    874874        ! spill to userspace window buffer
    875875        SAVE_TO_USPACE_WBUF \tmpreg3, \tmpreg1
     
    10281028        mov NWINDOWS - 2, %g1                   ! use dealy slot for both cases
    10291029        sub %g1, %g2, %g1
    1030        
     1030
    10311031        wrpr %g0, 0, %otherwin
    10321032        wrpr %g1, 0, %cansave                   ! NWINDOWS - 2 - CANRESTORE
     
    10731073        and %g1, NWINDOWS - 1, %g1
    10741074        wrpr %g1, 0, %cwp                       ! CWP--
    1075        
     1075
    10761076.if \is_syscall
    10771077        done
Note: See TracChangeset for help on using the changeset viewer.