# HG changeset patch # User Paul Boddie # Date 1456432193 -3600 # Node ID d5fb9ec3001a6589f3ff23224d822c3131923f9a # Parent 2919aadc3118e8572d6b80237b5a5f3f4b6fddf2 Moved status register saving and adjustment, saving the unmodified value. diff -r 2919aadc3118 -r d5fb9ec3001a stage2/entry.S --- a/stage2/entry.S Thu Feb 25 18:17:27 2016 +0100 +++ b/stage2/entry.S Thu Feb 25 21:29:53 2016 +0100 @@ -26,6 +26,18 @@ .set noreorder _tlb_entry: + /* Save the status. */ + + mfc0 $k0, $12 /* CP0_STATUS */ + nop + sw $k0, -120($sp) + + /* Mask interrupts. */ + + li $k1, 0xffff03ff + and $k1, $k0, $k1 + mtc0 $k1, $12 + /* Save registers that the assembler wants to trash. */ sw $t9, -100($sp) @@ -39,6 +51,18 @@ nop _irq_entry: + /* Save the status. */ + + mfc0 $k0, $12 /* CP0_STATUS */ + nop + sw $k0, -120($sp) + + /* Mask interrupts. */ + + li $k1, 0xffff03ff + and $k1, $k0, $k1 + mtc0 $k1, $12 + /* Save registers that the assembler wants to trash. */ sw $t9, -100($sp) diff -r 2919aadc3118 -r d5fb9ec3001a stage2/handlers.S --- a/stage2/handlers.S Thu Feb 25 18:17:27 2016 +0100 +++ b/stage2/handlers.S Thu Feb 25 21:29:53 2016 +0100 @@ -55,14 +55,6 @@ nop save_state: - /* Save the status, mask interrupts. */ - - mfc0 $k0, $12 /* CP0_STATUS */ - li $k1, 0xffff03ff - and $k1, $k0, $k1 - mtc0 $k1, $12 - sw $k0, -120($sp) - sw $at, -4($sp) sw $v0, -8($sp) sw $v1, -12($sp)