Changeset 89c57b6 in mainline for boot/arch/mips32/src/asm.S


Ignore:
Timestamp:
2011-04-13T14:45:41Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
88634420
Parents:
cefb126 (diff), 17279ead (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • boot/arch/mips32/src/asm.S

    rcefb126 r89c57b6  
    3636.global start
    3737.global halt
    38 .global memcpy
    3938.global jump_to_kernel
    4039
     
    4241
    4342start:
    44         /* Setup CPU map (on msim this code
    45            is executed in parallel on all CPUs,
    46            but it not an issue) */
     43        /*
     44         * Setup the CP0 configuration
     45         *  - Disable 64-bit kernel addressing mode
     46         *  - DIsable 64-bit supervisor adressing mode
     47         *  - Disable 64-bit user addressing mode
     48         */
     49        mfc0 $a0, $status
     50        la $a1, 0xffffff1f
     51        and $a0, $a1, $a0
     52        mtc0 $a0, $status
     53       
     54        /*
     55         * Setup CPU map (on msim this code
     56         * is executed in parallel on all CPUs,
     57         * but it not an issue).
     58         */
    4759        la $a0, PA2KA(CPUMAP_OFFSET)
    4860       
     
    95107        lw $k1, ($k0)
    96108       
    97         /* If we are not running on BSP
    98            then end in an infinite loop  */
     109        /*
     110         * If we are not running on BSP
     111         * then end in an infinite loop.
     112         */
    99113        beq $k1, $zero, bsp
    100114        nop
     
    127141        nop
    128142
    129 memcpy:
    130         addiu $v0, $a1, 3
    131         li $v1, -4
    132         and $v0, $v0, $v1
    133         beq $a1, $v0, 3f
    134         move $t0, $a0
    135         move $t2, $a0
    136        
    137         0:
    138                 beq $a2, $zero, 2f
    139                 move $a3, $zero
    140        
    141         1:
    142                 addu $v0, $a1, $a3
    143                 lbu $a0, 0($v0)
    144                 addu $v1, $t0, $a3
    145                 addiu $a3, $a3, 1
    146                 bne $a3, $a2, 1b
    147                 sb $a0, 0($v1)
    148        
    149         2:
    150                 jr $ra
    151                 move $v0, $t2
    152        
    153         3:
    154                 addiu $v0, $a0, 3
    155                 and $v0, $v0, $v1
    156                 bne $a0, $v0, 0b
    157                 srl $t1, $a2, 2
    158                
    159                 beq $t1, $zero, 5f
    160                 move $a3, $zero
    161                
    162                 move $a3, $zero
    163                 move $a0, $zero
    164        
    165         4:
    166                 addu $v0, $a1, $a0
    167                 lw $v1, 0($v0)
    168                 addiu $a3, $a3, 1
    169                 addu $v0, $t0, $a0
    170                 sw $v1, 0($v0)
    171                 bne $a3, $t1, 4b
    172                 addiu $a0, $a0, 4
    173        
    174         5:
    175                 andi $a2, $a2, 0x3
    176                 beq $a2, $zero, 2b
    177                 nop
    178                
    179                 sll $v0, $a3, 2
    180                 addu $t1, $v0, $t0
    181                 move $a3, $zero
    182                 addu $t0, $v0, $a1
    183        
    184         6:
    185                 addu $v0, $t0, $a3
    186                 lbu $a0, 0($v0)
    187                 addu $v1, $t1, $a3
    188                 addiu $a3, $a3, 1
    189                 bne $a3, $a2, 6b
    190                 sb $a0, 0($v1)
    191                
    192                 jr $ra
    193                 move $v0, $t2
    194 
    195143jump_to_kernel:
    196         #
    197         # TODO:
    198         # Make sure that the I-cache, D-cache and memory are mutually coherent
    199         # before passing control to the copied code.
    200         #
     144        /*
     145         * TODO:
     146         *
     147         * Make sure that the I-cache, D-cache and memory are mutually
     148         * coherent before passing control to the copied code.
     149         */
    201150        j $a0
    202151        nop
Note: See TracChangeset for help on using the changeset viewer.