aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/head_booke.h
diff options
context:
space:
mode:
authorKumar Gala <galak@kernel.crashing.org>2008-04-30 06:23:21 -0400
committerKumar Gala <galak@kernel.crashing.org>2008-06-02 15:56:35 -0400
commitfca622c5b21a259950a2964ceca7b6c2a23c849f (patch)
tree63e8faa227230542a7f9cc17050e42ffebd9f64f /arch/powerpc/kernel/head_booke.h
parent369e757b65d4a5e49bae7cfaf671e784f891cfbe (diff)
[POWERPC] 40x/Book-E: Save/restore volatile exception registers
On machines with more than one exception level any system register that might be modified by the "normal" exception level needs to be saved and restored on taking a higher level exception. We already are saving and restoring ESR and DEAR. For critical level add SRR0/1. For debug level add CSRR0/1 and SRR0/1. For machine check level add DSRR0/1, CSRR0/1, and SRR0/1. On FSL Book-E parts we always save/restore the MAS registers for critical, debug, and machine check level exceptions. On 44x we always save/restore the MMUCR. Additionally, we save and restore the ksp_limit since we have to adjust it for each exception level. Signed-off-by: Kumar Gala <galak@kernel.crashing.org> Acked-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel/head_booke.h')
-rw-r--r--arch/powerpc/kernel/head_booke.h23
1 files changed, 22 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/head_booke.h b/arch/powerpc/kernel/head_booke.h
index b0874d228ea..f277fade193 100644
--- a/arch/powerpc/kernel/head_booke.h
+++ b/arch/powerpc/kernel/head_booke.h
@@ -72,7 +72,7 @@
72#define DEBUG_STACK_BASE dbgirq_ctx 72#define DEBUG_STACK_BASE dbgirq_ctx
73#define DEBUG_SPRG SPRN_SPRG6W 73#define DEBUG_SPRG SPRN_SPRG6W
74 74
75#define EXC_LVL_FRAME_OVERHEAD (THREAD_SIZE - INT_FRAME_SIZE) 75#define EXC_LVL_FRAME_OVERHEAD (THREAD_SIZE - INT_FRAME_SIZE - EXC_LVL_SIZE)
76 76
77#ifdef CONFIG_SMP 77#ifdef CONFIG_SMP
78#define BOOKE_LOAD_EXC_LEVEL_STACK(level) \ 78#define BOOKE_LOAD_EXC_LEVEL_STACK(level) \
@@ -376,4 +376,25 @@ label:
376 addi r3,r1,STACK_FRAME_OVERHEAD; \ 376 addi r3,r1,STACK_FRAME_OVERHEAD; \
377 EXC_XFER_EE_LITE(0x800, kernel_fp_unavailable_exception) 377 EXC_XFER_EE_LITE(0x800, kernel_fp_unavailable_exception)
378 378
379#ifndef __ASSEMBLY__
380struct exception_regs {
381 unsigned long mas0;
382 unsigned long mas1;
383 unsigned long mas2;
384 unsigned long mas3;
385 unsigned long mas6;
386 unsigned long mas7;
387 unsigned long srr0;
388 unsigned long srr1;
389 unsigned long csrr0;
390 unsigned long csrr1;
391 unsigned long dsrr0;
392 unsigned long dsrr1;
393 unsigned long saved_ksp_limit;
394};
395
396/* ensure this structure is always sized to a multiple of the stack alignment */
397#define STACK_EXC_LVL_FRAME_SIZE _ALIGN_UP(sizeof (struct exception_regs), 16)
398
399#endif /* __ASSEMBLY__ */
379#endif /* __HEAD_BOOKE_H__ */ 400#endif /* __HEAD_BOOKE_H__ */