1.1 --- a/stage2/head2.S Tue Jun 30 16:09:27 2015 +0200
1.2 +++ b/stage2/head2.S Thu Dec 03 23:24:48 2015 +0100
1.3 @@ -22,10 +22,6 @@
1.4
1.5 .text
1.6 .extern c_main
1.7 -.extern _tlb_entry
1.8 -.extern _exc_entry
1.9 -.extern _irq_entry
1.10 -.extern _end_entries
1.11 .globl _start
1.12 .set noreorder
1.13
1.14 @@ -39,61 +35,13 @@
1.15 lui $gp, %hi(_GLOBAL_OFFSET_TABLE_)
1.16 ori $gp, $gp, %lo(_GLOBAL_OFFSET_TABLE_)
1.17
1.18 - /* Copy TLB handling instructions. */
1.19 -
1.20 - la $t0, _tlb_entry /* start */
1.21 - li $t1, 0x80000000
1.22 - la $t2, _cache_entry /* end */
1.23 -_tlb_copy:
1.24 - lw $t3, 0($t0)
1.25 - addiu $t0, $t0, 4
1.26 - sw $t3, 0($t1)
1.27 - bne $t0, $t2, _tlb_copy
1.28 - addiu $t1, $t1, 4 /* executed in delay slot before branch */
1.29 -
1.30 - /* Copy cache handling instructions. */
1.31 -
1.32 - move $t0, $t2 /* start */
1.33 - li $t1, 0x80000100
1.34 - la $t2, _exc_entry /* end */
1.35 -_cache_copy:
1.36 - lw $t3, 0($t0)
1.37 - addiu $t0, $t0, 4
1.38 - sw $t3, 0($t1)
1.39 - bne $t0, $t2, _cache_copy
1.40 - addiu $t1, $t1, 4 /* executed in delay slot before branch */
1.41 -
1.42 - /* Copy exception handling instructions. */
1.43 -
1.44 - move $t0, $t2 /* start */
1.45 - li $t1, 0x80000180
1.46 - la $t2, _irq_entry /* end */
1.47 -_exc_copy:
1.48 - lw $t3, 0($t0)
1.49 - addiu $t0, $t0, 4
1.50 - sw $t3, 0($t1)
1.51 - bne $t0, $t2, _exc_copy
1.52 - addiu $t1, $t1, 4 /* executed in delay slot before branch */
1.53 -
1.54 - /* Copy IRQ handling instructions. */
1.55 -
1.56 - move $t0, $t2 /* start */
1.57 - li $t1, 0x80000200
1.58 - la $t2, _end_entries /* end */
1.59 -_irq_copy:
1.60 - lw $t3, 0($t0)
1.61 - addiu $t0, $t0, 4
1.62 - sw $t3, 0($t1)
1.63 - bne $t0, $t2, _irq_copy
1.64 - addiu $t1, $t1, 4 /* executed in delay slot before branch */
1.65 -
1.66 /* Initialise interrupts. */
1.67
1.68 mfc0 $t3, $12 /* CP0_STATUS */
1.69 nop
1.70 - li $t4, 0xffbf00e0 /* BEV = 0 (not bootloader vectors); IM = disable all */
1.71 - and $t3, $t3, $t4 /* ... KSU = 0 (kernel mode); ERL = 0; EXL = 0; IE = 0 */
1.72 - li $t4, 0x0000ff04 /* IM = enable IM7..IM0; ERL = 1 (set by default) */
1.73 + li $t4, 0xffbf00e4 /* BEV = 0 (not bootloader vectors); IM = disable all */
1.74 + and $t3, $t3, $t4 /* ... KSU = 0 (kernel mode); EXL = 0; IE = 0 */
1.75 + li $t4, 0x0000ff00 /* IM = enable IM7..IM0 */
1.76 or $t3, $t3, $t4
1.77 mtc0 $t3, $12
1.78 nop