aboutsummaryrefslogtreecommitdiffstats
path: root/arch/microblaze
diff options
context:
space:
mode:
authorMichal Simek <monstr@monstr.eu>2010-08-09 08:37:42 -0400
committerMichal Simek <monstr@monstr.eu>2010-10-21 01:51:33 -0400
commit600eb6110a3f15aedffc3cce31b6065a09e7cb31 (patch)
treef4e6df83bf2ae1284d1d5aac9882c826f839493a /arch/microblaze
parent36cf089dc648f542622eb43daaa35b3a90f510a6 (diff)
microblaze: Fix r16 and r17 reg saving
r16 and r17 should be saved across interrupt and exception handling. Signed-off-by: Michal Simek <monstr@monstr.eu>
Diffstat (limited to 'arch/microblaze')
-rw-r--r--arch/microblaze/kernel/entry.S11
1 files changed, 4 insertions, 7 deletions
diff --git a/arch/microblaze/kernel/entry.S b/arch/microblaze/kernel/entry.S
index 8539c6c0e741..819238b8a429 100644
--- a/arch/microblaze/kernel/entry.S
+++ b/arch/microblaze/kernel/entry.S
@@ -186,6 +186,8 @@
186 swi r13, r1, PTO+PT_R13; /* Save SDA2 */ \ 186 swi r13, r1, PTO+PT_R13; /* Save SDA2 */ \
187 swi r14, r1, PTO+PT_PC; /* PC, before IRQ/trap */ \ 187 swi r14, r1, PTO+PT_PC; /* PC, before IRQ/trap */ \
188 swi r15, r1, PTO+PT_R15; /* Save LP */ \ 188 swi r15, r1, PTO+PT_R15; /* Save LP */ \
189 swi r16, r1, PTO+PT_R16; \
190 swi r17, r1, PTO+PT_R17; \
189 swi r18, r1, PTO+PT_R18; /* Save asm scratch reg */ \ 191 swi r18, r1, PTO+PT_R18; /* Save asm scratch reg */ \
190 swi r19, r1, PTO+PT_R19; \ 192 swi r19, r1, PTO+PT_R19; \
191 swi r20, r1, PTO+PT_R20; \ 193 swi r20, r1, PTO+PT_R20; \
@@ -220,6 +222,8 @@
220 lwi r13, r1, PTO+PT_R13; /* restore SDA2 */ \ 222 lwi r13, r1, PTO+PT_R13; /* restore SDA2 */ \
221 lwi r14, r1, PTO+PT_PC; /* RESTORE_LINK PC, before IRQ/trap */\ 223 lwi r14, r1, PTO+PT_PC; /* RESTORE_LINK PC, before IRQ/trap */\
222 lwi r15, r1, PTO+PT_R15; /* restore LP */ \ 224 lwi r15, r1, PTO+PT_R15; /* restore LP */ \
225 lwi r16, r1, PTO+PT_R16; \
226 lwi r17, r1, PTO+PT_R17; \
223 lwi r18, r1, PTO+PT_R18; /* restore asm scratch reg */ \ 227 lwi r18, r1, PTO+PT_R18; /* restore asm scratch reg */ \
224 lwi r19, r1, PTO+PT_R19; \ 228 lwi r19, r1, PTO+PT_R19; \
225 lwi r20, r1, PTO+PT_R20; \ 229 lwi r20, r1, PTO+PT_R20; \
@@ -761,9 +765,7 @@ C_ENTRY(_debug_exception):
761 /* save all regs to pt_reg structure */ 765 /* save all regs to pt_reg structure */
762 swi r0, r1, PTO+PT_R0; /* R0 must be saved too */ 766 swi r0, r1, PTO+PT_R0; /* R0 must be saved too */
763 swi r14, r1, PTO+PT_R14 /* rewrite saved R14 value */ 767 swi r14, r1, PTO+PT_R14 /* rewrite saved R14 value */
764 swi r16, r1, PTO+PT_R16
765 swi r16, r1, PTO+PT_PC; /* PC and r16 are the same */ 768 swi r16, r1, PTO+PT_PC; /* PC and r16 are the same */
766 swi r17, r1, PTO+PT_R17
767 /* save special purpose registers to pt_regs */ 769 /* save special purpose registers to pt_regs */
768 mfs r11, rear; 770 mfs r11, rear;
769 swi r11, r1, PTO+PT_EAR; 771 swi r11, r1, PTO+PT_EAR;
@@ -797,8 +799,6 @@ C_ENTRY(_debug_exception):
797 799
798 addik r1, r1, -STATE_SAVE_SIZE; /* Make room on the stack. */ 800 addik r1, r1, -STATE_SAVE_SIZE; /* Make room on the stack. */
799 SAVE_REGS; 801 SAVE_REGS;
800 swi r17, r1, PTO+PT_R17;
801 swi r16, r1, PTO+PT_R16;
802 swi r16, r1, PTO+PT_PC; /* Save LP */ 802 swi r16, r1, PTO+PT_PC; /* Save LP */
803 swi r0, r1, PTO + PT_MODE; /* Was in user-mode. */ 803 swi r0, r1, PTO + PT_MODE; /* Was in user-mode. */
804 lwi r11, r0, TOPHYS(PER_CPU(ENTRY_SP)); 804 lwi r11, r0, TOPHYS(PER_CPU(ENTRY_SP));
@@ -844,8 +844,6 @@ dbtrap_call: /* Return point for kernel/user entry + 8 because of rtsd r15, 8 */
844 tophys(r1,r1); 844 tophys(r1,r1);
845 /* MS: Restore all regs */ 845 /* MS: Restore all regs */
846 RESTORE_REGS 846 RESTORE_REGS
847 lwi r17, r1, PTO+PT_R17;
848 lwi r16, r1, PTO+PT_R16;
849 addik r1, r1, STATE_SAVE_SIZE /* Clean up stack space */ 847 addik r1, r1, STATE_SAVE_SIZE /* Clean up stack space */
850 lwi r1, r1, PT_R1 - PT_SIZE; /* Restore user stack pointer */ 848 lwi r1, r1, PT_R1 - PT_SIZE; /* Restore user stack pointer */
851DBTRAP_return_user: /* MS: Make global symbol for debugging */ 849DBTRAP_return_user: /* MS: Make global symbol for debugging */
@@ -859,7 +857,6 @@ DBTRAP_return_user: /* MS: Make global symbol for debugging */
859 RESTORE_REGS 857 RESTORE_REGS
860 lwi r14, r1, PTO+PT_R14; 858 lwi r14, r1, PTO+PT_R14;
861 lwi r16, r1, PTO+PT_PC; 859 lwi r16, r1, PTO+PT_PC;
862 lwi r17, r1, PTO+PT_R17;
863 addik r1, r1, STATE_SAVE_SIZE; /* MS: Clean up stack space */ 860 addik r1, r1, STATE_SAVE_SIZE; /* MS: Clean up stack space */
864 tovirt(r1,r1); 861 tovirt(r1,r1);
865DBTRAP_return_kernel: /* MS: Make global symbol for debugging */ 862DBTRAP_return_kernel: /* MS: Make global symbol for debugging */