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


Ignore:
Timestamp:
2010-05-22T22:31:17Z (14 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ba7371f9
Parents:
d354d57
Message:

coding style changes, no change in functionality

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/mips32/src/start.S

    rd354d57 rd92bf462  
    4747# Which status bits should are thread-local
    4848#define REG_SAVE_MASK 0x1f # KSU(UM), EXL, ERL, IE
    49        
     49
    5050# Save registers to space defined by \r
    51 # We will change status: Disable ERL,EXL,UM,IE
     51# We will change status: Disable ERL, EXL, UM, IE
    5252# These changes will be automatically reversed in REGISTER_LOAD
    53 # SP is NOT saved as part of these registers
     53# %sp is NOT saved as part of these registers
    5454.macro REGISTERS_STORE_AND_EXC_RESET r
    5555        sw $at, EOFFSET_AT(\r)
     
    7070        sw $t8, EOFFSET_T8(\r)
    7171        sw $t9, EOFFSET_T9(\r)
    72 
     72       
    7373        mflo $at
    7474        sw $at, EOFFSET_LO(\r)
     
    7979        sw $ra, EOFFSET_RA(\r)
    8080        sw $k1, EOFFSET_K1(\r)
    81 
     81       
    8282        mfc0 $t0, $status
    8383        mfc0 $t1, $epc
    8484       
    85         and $t2, $t0, REG_SAVE_MASK     # Save only KSU,EXL,ERL,IE
    86         li $t3, ~(0x1f)
    87         and $t0, $t0, $t3               # Clear KSU,EXL,ERL,IE
    88        
    89         sw $t2,EOFFSET_STATUS(\r)
    90         sw $t1,EOFFSET_EPC(\r)
     85        # save only KSU, EXL, ERL, IE
     86        and $t2, $t0, REG_SAVE_MASK
     87       
     88        # clear KSU, EXL, ERL, IE
     89        li $t3, ~(REG_SAVE_MASK)
     90        and $t0, $t0, $t3
     91       
     92        sw $t2, EOFFSET_STATUS(\r)
     93        sw $t1, EOFFSET_EPC(\r)
    9194        mtc0 $t0, $status
    9295.endm
    9396
    9497.macro REGISTERS_LOAD r
    95         # Update only UM,EXR,IE from status, the rest
     98        # Update only UM, EXR, IE from status, the rest
    9699        # is controlled by OS and not bound to task
    97100        mfc0 $t0, $status
    98101        lw $t1,EOFFSET_STATUS(\r)
    99 
    100         li $t2, ~REG_SAVE_MASK          # Mask UM,EXL,ERL,IE
     102       
     103        # Mask UM, EXL, ERL, IE
     104        li $t2, ~REG_SAVE_MASK
    101105        and $t0, $t0, $t2
    102106       
    103         or $t0, $t0, $t1                # Copy UM,EXL, ERL, IE from saved status
     107        # Copy UM, EXL, ERL, IE from saved status
     108        or $t0, $t0, $t1
    104109        mtc0 $t0, $status
    105110       
     
    129134        lw $at, EOFFSET_HI(\r)
    130135        mthi $at
    131 
     136       
    132137        lw $at, EOFFSET_EPC(\r)
    133138        mtc0 $at, $epc
     
    138143
    139144# Move kernel stack pointer address to register K0
    140 # - if we are in user mode, load the appropriate stack
    141 # address
     145# - if we are in user mode, load the appropriate stack address
    142146.macro KERNEL_STACK_TO_K0
    143         # If we are in user mode
     147        # if we are in user mode
    144148        mfc0 $k0, $status
    145149        andi $k0, 0x10
     
    148152        add $k0, $sp, 0
    149153       
    150         # Move $k0 pointer to kernel stack
     154        # move $k0 pointer to kernel stack
    151155        lui $k0, %hi(supervisor_sp)
    152156        ori $k0, $k0, %lo(supervisor_sp)
    153         # Move $k0 (superveisor_sp)
     157       
     158        # move $k0 (supervisor_sp)
    154159        lw $k0, 0($k0)
    155 1:
     160       
     161        1:
    156162.endm
    157163
    158164.org 0x0
    159165kernel_image_start:
    160         /* Load temporary stack */
     166        # load temporary stack
    161167        lui $sp, %hi(end_stack)
    162168        ori $sp, $sp, %lo(end_stack)
    163169       
    164         /* Not sure about this, but might
    165            be needed for PIC code */
     170        # Not sure about this, but might
     171        # be needed for PIC code
    166172        lui $gp, 0x8000
    167173       
    168         /* $a1 contains physical address of bootinfo_t */
    169        
     174        # $a1 contains physical address of bootinfo_t
    170175        jal arch_pre_main
    171176        nop
     
    174179        nop
    175180
    176         .space TEMP_STACK_SIZE
     181.space TEMP_STACK_SIZE
    177182end_stack:
    178183
     
    191196exception_handler:
    192197        KERNEL_STACK_TO_K0
     198       
    193199        sub $k0, REGISTER_SPACE
    194200        sw $sp, EOFFSET_SP($k0)
     
    209215        jal exc_dispatch     # exc_dispatch(excno, register_space)
    210216        move $a0, $k0
    211 
     217       
    212218        REGISTERS_LOAD $sp
    213219        # The $sp is automatically restored to former value
     
    276282       
    277283        eret
    278                
     284
    279285tlb_refill_handler:
    280286        KERNEL_STACK_TO_K0
Note: See TracChangeset for help on using the changeset viewer.