Changeset a35b458 in mainline for kernel/arch/mips32/src/start.S


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/mips32/src/start.S

    r3061bc1 ra35b458  
    8989        sw $s7, ISTATE_OFFSET_S7(\r)
    9090        sw $s8, ISTATE_OFFSET_S8(\r)
    91        
     91
    9292        mflo $at
    9393        sw $at, ISTATE_OFFSET_LO(\r)
    9494        mfhi $at
    9595        sw $at, ISTATE_OFFSET_HI(\r)
    96        
     96
    9797        sw $gp, ISTATE_OFFSET_GP(\r)
    9898        sw $ra, ISTATE_OFFSET_RA(\r)
    9999        sw $k0, ISTATE_OFFSET_KT0(\r)
    100100        sw $k1, ISTATE_OFFSET_KT1(\r)
    101        
     101
    102102        mfc0 $t0, $status
    103103        mfc0 $t1, $epc
    104        
     104
    105105        /* save only KSU, EXL, ERL, IE */
    106106        and $t2, $t0, REG_SAVE_MASK
    107        
     107
    108108        /* clear KSU, EXL, ERL, IE */
    109109        li $t3, ~(REG_SAVE_MASK)
    110110        and $t0, $t0, $t3
    111        
     111
    112112        sw $t2, ISTATE_OFFSET_STATUS(\r)
    113113        sw $t1, ISTATE_OFFSET_EPC(\r)
     
    122122        mfc0 $t0, $status
    123123        lw $t1, ISTATE_OFFSET_STATUS(\r)
    124        
     124
    125125        /* mask UM, EXL, ERL, IE */
    126126        li $t2, ~REG_SAVE_MASK
    127127        and $t0, $t0, $t2
    128        
     128
    129129        /* copy UM, EXL, ERL, IE from saved status */
    130130        or $t0, $t0, $t1
    131131        mtc0 $t0, $status
    132        
     132
    133133        lw $v0, ISTATE_OFFSET_V0(\r)
    134134        lw $v1, ISTATE_OFFSET_V1(\r)
     
    147147        lw $t8, ISTATE_OFFSET_T8(\r)
    148148        lw $t9, ISTATE_OFFSET_T9(\r)
    149        
     149
    150150        lw $gp, ISTATE_OFFSET_GP(\r)
    151151        lw $ra, ISTATE_OFFSET_RA(\r)
    152152        lw $k1, ISTATE_OFFSET_KT1(\r)
    153        
     153
    154154        lw $at, ISTATE_OFFSET_LO(\r)
    155155        mtlo $at
    156156        lw $at, ISTATE_OFFSET_HI(\r)
    157157        mthi $at
    158        
     158
    159159        lw $at, ISTATE_OFFSET_EPC(\r)
    160160        mtc0 $at, $epc
    161        
     161
    162162        lw $at, ISTATE_OFFSET_AT(\r)
    163163        lw $sp, ISTATE_OFFSET_SP(\r)
     
    172172        mfc0 $k0, $status
    173173        andi $k0, 0x10
    174        
     174
    175175        beq $k0, $0, 1f
    176176        move $k0, $sp
    177        
     177
    178178        /* move $k0 pointer to kernel stack */
    179179        la $k0, supervisor_sp
    180        
     180
    181181        /* move $k0 (supervisor_sp) */
    182182        lw $k0, ($k0)
    183        
     183
    184184        1:
    185185.endm
     
    190190        lui $sp, %hi(end_stack)
    191191        ori $sp, $sp, %lo(end_stack)
    192        
     192
    193193        /* not sure about this, but might be needed for PIC code */
    194194        lui $gp, 0x8000
    195        
     195
    196196        /* $a1 contains physical address of bootinfo_t */
    197197        jal mips32_pre_main
    198198        addiu $sp, -ABI_STACK_FRAME
    199        
     199
    200200        j main_bsp
    201201        nop
     
    219219exception_handler:
    220220        KERNEL_STACK_TO_K0
    221        
     221
    222222        sub $k0, ISTATE_SIZE
    223223        sw $sp, ISTATE_OFFSET_SP($k0)
    224224        move $sp, $k0
    225        
     225
    226226        mfc0 $k0, $cause
    227        
     227
    228228        sra $k0, $k0, 0x2    /* cp0_exc_cause() part 1 */
    229229        andi $k0, $k0, 0x1f  /* cp0_exc_cause() part 2 */
    230230        sub $k0, 8           /* 8 = SYSCALL */
    231        
     231
    232232        beqz $k0, syscall_shortcut
    233233        add $k0, 8           /* revert $k0 back to correct exc number */
    234        
     234
    235235        REGISTERS_STORE_AND_EXC_RESET $sp
    236        
     236
    237237        move $a1, $sp
    238238        move $a0, $k0
     
    240240        addiu $sp, -ABI_STACK_FRAME
    241241        addiu $sp, ABI_STACK_FRAME
    242        
     242
    243243        REGISTERS_LOAD $sp
    244244        /* the $sp is automatically restored to former value */
     
    265265        sw $t3, ISTATE_OFFSET_EPC($sp)  /* save EPC */
    266266        sw $k1, ISTATE_OFFSET_KT1($sp)  /* save $k1 not saved on context switch */
    267        
     267
    268268        and $t4, $t2, REG_SAVE_MASK  /* save only KSU, EXL, ERL, IE */
    269269        li $t5, ~(0x1f)
    270270        and $t2, $t2, $t5  /* clear KSU, EXL, ERL */
    271271        ori $t2, $t2, 0x1  /* set IE */
    272        
     272
    273273        sw $t4, ISTATE_OFFSET_STATUS($sp)
    274274        mtc0 $t2, $status
    275        
     275
    276276        /*
    277277         * Call the higher level system call handler.
     
    280280        sw $t0, ISTATE_OFFSET_T0($sp)  /* save the 5th argument on the stack */
    281281        sw $t1, ISTATE_OFFSET_T1($sp)  /* save the 6th argument on the stack */
    282        
     282
    283283        jal syscall_handler
    284284        sw $v0, ISTATE_OFFSET_V0($sp)  /* save the syscall number on the stack */
    285        
     285
    286286        /* restore status */
    287287        mfc0 $t2, $status
    288288        lw $t3, ISTATE_OFFSET_STATUS($sp)
    289        
     289
    290290        /*
    291291         * Change back to EXL = 1 (from last exception), otherwise
     
    297297        or $t2, $t2, $t3  /* copy saved UM, EXL, ERL, IE */
    298298        mtc0 $t2, $status
    299        
     299
    300300        /* restore epc + 4 */
    301301        lw $t2, ISTATE_OFFSET_EPC($sp)
     
    303303        addi $t2, $t2, 4
    304304        mtc0 $t2, $epc
    305        
     305
    306306        lw $sp, ISTATE_OFFSET_SP($sp)  /* restore $sp */
    307307        eret
     
    314314        sw $sp, ISTATE_OFFSET_SP($k0)
    315315        move $sp, $k0
    316        
     316
    317317        move $a0, $sp
    318318        jal tlb_refill
    319319        addiu $sp, -ABI_STACK_FRAME
    320320        addiu $sp, ABI_STACK_FRAME
    321        
     321
    322322        REGISTERS_LOAD $sp
    323323        eret
     
    330330        sw $sp, ISTATE_OFFSET_SP($k0)
    331331        move $sp, $k0
    332        
     332
    333333        move $a0, $sp
    334334        jal cache_error
    335335        addiu $sp, -ABI_STACK_FRAME
    336336        addiu $sp, ABI_STACK_FRAME
    337        
     337
    338338        REGISTERS_LOAD $sp
    339339        eret
Note: See TracChangeset for help on using the changeset viewer.