Changeset 46c20c8 in mainline for boot/arch/mips32/src/asm.S
- Timestamp:
- 2010-11-26T20:08:10Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 45df59a
- Parents:
- fb150d78 (diff), ffdd2b9 (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. - File:
-
- 1 moved
-
boot/arch/mips32/src/asm.S (moved) (moved from boot/arch/mips32/loader/asm.S ) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
boot/arch/mips32/src/asm.S
rfb150d78 r46c20c8 27 27 # 28 28 29 #include "regname.h" 29 #include <arch/arch.h> 30 #include <arch/regname.h> 30 31 31 32 .set noat … … 33 34 .set nomacro 34 35 36 .global start 37 .global halt 38 .global jump_to_kernel 39 40 .section BOOTSTRAP 41 42 start: 43 /* Setup CPU map (on msim this code 44 is executed in parallel on all CPUs, 45 but it not an issue) */ 46 la $a0, PA2KA(CPUMAP_OFFSET) 47 48 sw $zero, 0($a0) 49 sw $zero, 4($a0) 50 sw $zero, 8($a0) 51 sw $zero, 12($a0) 52 53 sw $zero, 16($a0) 54 sw $zero, 20($a0) 55 sw $zero, 24($a0) 56 sw $zero, 28($a0) 57 58 sw $zero, 32($a0) 59 sw $zero, 36($a0) 60 sw $zero, 40($a0) 61 sw $zero, 44($a0) 62 63 sw $zero, 48($a0) 64 sw $zero, 52($a0) 65 sw $zero, 56($a0) 66 sw $zero, 60($a0) 67 68 sw $zero, 64($a0) 69 sw $zero, 68($a0) 70 sw $zero, 72($a0) 71 sw $zero, 76($a0) 72 73 sw $zero, 80($a0) 74 sw $zero, 84($a0) 75 sw $zero, 88($a0) 76 sw $zero, 92($a0) 77 78 sw $zero, 96($a0) 79 sw $zero, 100($a0) 80 sw $zero, 104($a0) 81 sw $zero, 108($a0) 82 83 sw $zero, 112($a0) 84 sw $zero, 116($a0) 85 sw $zero, 120($a0) 86 sw $zero, 124($a0) 87 88 lui $a1, 1 89 90 #ifdef MACHINE_msim 91 92 /* Read dorder value */ 93 la $k0, MSIM_DORDER_ADDRESS 94 lw $k1, ($k0) 95 96 /* If we are not running on BSP 97 then end in an infinite loop */ 98 beq $k1, $zero, bsp 99 nop 100 101 /* Record CPU presence */ 102 sll $a2, $k1, 2 103 addu $a2, $a2, $a0 104 sw $a1, ($a2) 105 106 loop: 107 j loop 108 nop 109 110 #endif 111 112 bsp: 113 /* Record CPU presence */ 114 sw $a1, ($a0) 115 116 /* Setup initial stack */ 117 la $sp, PA2KA(STACK_OFFSET) 118 119 j bootstrap 120 nop 121 35 122 .text 36 123 37 .global halt38 .global memcpy39 .global jump_to_kernel40 41 124 halt: 42 bhalt125 j halt 43 126 nop 44 45 memcpy:46 addiu $v0,$a1,347 li $v1,-4 # 0xfffffffffffffffc48 and $v0,$v0,$v149 beq $a1,$v0,3f50 move $t0,$a051 move $t2,$a0 # save dst52 53 0:54 beq $a2,$zero,2f55 move $a3,$zero56 57 1:58 addu $v0,$a1,$a359 lbu $a0,0($v0)60 addu $v1,$t0,$a361 addiu $a3,$a3,162 bne $a3,$a2,1b63 sb $a0,0($v1)64 65 2:66 jr $ra67 move $v0,$t268 69 3:70 addiu $v0,$a0,371 and $v0,$v0,$v172 bne $a0,$v0,0b73 srl $t1,$a2,274 75 beq $t1,$zero,5f76 move $a3,$zero77 78 move $a3,$zero79 move $a0,$zero80 4:81 addu $v0,$a1,$a082 lw $v1,0($v0)83 addiu $a3,$a3,184 addu $v0,$t0,$a085 sw $v1,0($v0)86 bne $a3,$t1,4b87 addiu $a0,$a0,488 89 5:90 andi $a2,$a2,0x391 beq $a2,$zero,2b92 nop93 94 sll $v0,$a3,295 addu $t1,$v0,$t096 move $a3,$zero97 addu $t0,$v0,$a198 6:99 addu $v0,$t0,$a3100 lbu $a0,0($v0)101 addu $v1,$t1,$a3102 addiu $a3,$a3,1103 bne $a3,$a2,6b104 sb $a0,0($v1)105 106 jr $ra107 move $v0,$t2108 127 109 128 jump_to_kernel: 110 129 # 111 # TODO 130 # TODO: 112 131 # Make sure that the I-cache, D-cache and memory are mutually coherent 113 132 # before passing control to the copied code.
Note:
See TracChangeset
for help on using the changeset viewer.
