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


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/smp
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • 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}
Note: See TracChangeset for help on using the changeset viewer.