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


Ignore:
Timestamp:
2009-02-17T22:47:27Z (15 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f89979b
Parents:
e662a5f
Message:

make arch_pre_main optional, don't force any specific prototype
simplify boot process
mips32: detect number of configured CPUs in msim

File:
1 edited

Legend:

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

    re662a5f r96e0748d  
    3232#include <arch/context_offset.h>
    3333#include <arch/stack.h>
    34        
     34
    3535.text
    3636
     
    153153        # Move $k0 (superveisor_sp)
    154154        lw $k0, 0($k0)
    155 1:             
     1551:
    156156.endm
    157                
     157
    158158.org 0x0
    159159kernel_image_start:
     
    162162        ori $sp, $sp, %lo(end_stack)
    163163       
     164        /* Not sure about this, but might
     165           be needed for PIC code */
     166        lui $gp, 0x8000
     167       
    164168        /* $a1 contains physical address of bootinfo_t */
    165         /* $a2 contains size of bootinfo_t */
    166        
    167         beq $a2, $0, bootinfo_end
    168        
    169         /* Not sure about this, but might be needed for PIC code???? */
    170         lui $gp, 0x8000
    171        
    172         lui $a3, %hi(bootinfo)
    173         ori $a3, $a3, %lo(bootinfo)
    174        
    175         bootinfo_loop:
    176                
    177                 lw $v0, 0($a1)
    178                 sw $v0, 0($a3)
    179                
    180                 addi $a1, $a1, 4
    181                 addi $a3, $a3, 4
    182                 addi $a2, $a2, -4
    183                
    184                 bgtz $a2, bootinfo_loop
    185                 nop
    186                
    187         bootinfo_end:
    188169       
    189170        jal arch_pre_main
     
    206187exception_entry:
    207188        j exception_handler
    208         nop     
    209        
     189        nop
     190
    210191exception_handler:
    211192        KERNEL_STACK_TO_K0
     
    216197        mfc0 $k0, $cause
    217198       
    218         sra $k0, $k0, 0x2               # cp0_exc_cause() part 1
    219         andi $k0, $k0, 0x1f             # cp0_exc_cause() part 2
    220         sub $k0, 8                      # 8 = SYSCALL
     199        sra $k0, $k0, 0x2    # cp0_exc_cause() part 1
     200        andi $k0, $k0, 0x1f  # cp0_exc_cause() part 2
     201        sub $k0, 8           # 8 = SYSCALL
    221202       
    222203        beqz $k0, syscall_shortcut
    223         add $k0, 8                      # Revert $k0 back to correct exc number
     204        add $k0, 8           # Revert $k0 back to correct exc number
    224205       
    225206        REGISTERS_STORE_AND_EXC_RESET $sp
    226207       
    227208        move $a1, $sp
    228         jal exc_dispatch                # exc_dispatch(excno, register_space)
     209        jal exc_dispatch     # exc_dispatch(excno, register_space)
    229210        move $a0, $k0
    230211
Note: See TracChangeset for help on using the changeset viewer.