]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - arch/powerpc/kernel/head_booke.h
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
[karo-tx-linux.git] / arch / powerpc / kernel / head_booke.h
index b0874d228eaf99edf15c6349d48bb66c55bfb854..fce2df988504d6e8962b31656ceec6dceff7ac44 100644 (file)
 #define MCHECK_STACK_BASE      mcheckirq_ctx
 #define CRIT_STACK_BASE                critirq_ctx
 
-/* only on e200 for now */
+/* only on e500mc/e200 */
 #define DEBUG_STACK_BASE       dbgirq_ctx
+#ifdef CONFIG_PPC_E500MC
+#define DEBUG_SPRG             SPRN_SPRG9
+#else
 #define DEBUG_SPRG             SPRN_SPRG6W
+#endif
 
-#define EXC_LVL_FRAME_OVERHEAD (THREAD_SIZE - INT_FRAME_SIZE)
+#define EXC_LVL_FRAME_OVERHEAD (THREAD_SIZE - INT_FRAME_SIZE - EXC_LVL_SIZE)
 
 #ifdef CONFIG_SMP
 #define BOOKE_LOAD_EXC_LEVEL_STACK(level)              \
@@ -240,7 +244,7 @@ label:
         * the code where the exception occurred (since exception entry       \
         * doesn't turn off DE automatically).  We simulate the effect        \
         * of turning off DE on entry to an exception handler by turning      \
-        * off DE in the CSRR1 value and clearing the debug status.           \
+        * off DE in the DSRR1 value and clearing the debug status.           \
         */                                                                   \
        mfspr   r10,SPRN_DBSR;          /* check single-step/branch taken */  \
        andis.  r10,r10,DBSR_IC@h;                                            \
@@ -278,7 +282,7 @@ label:
        RFDI;                                                                 \
        b       .;                                                            \
                                                                              \
-       /* continue normal handling for a critical exception... */            \
+       /* continue normal handling for a debug exception... */               \
 2:     mfspr   r4,SPRN_DBSR;                                                 \
        addi    r3,r1,STACK_FRAME_OVERHEAD;                                   \
        EXC_XFER_TEMPLATE(DebugException, 0x2008, (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), NOCOPY, debug_transfer_to_handler, ret_from_debug_exc)
@@ -336,6 +340,14 @@ label:
        addi    r3,r1,STACK_FRAME_OVERHEAD;                                   \
        EXC_XFER_TEMPLATE(DebugException, 0x2002, (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), NOCOPY, crit_transfer_to_handler, ret_from_crit_exc)
 
+#define DATA_STORAGE_EXCEPTION                                               \
+       START_EXCEPTION(DataStorage)                                          \
+       NORMAL_EXCEPTION_PROLOG;                                              \
+       mfspr   r5,SPRN_ESR;            /* Grab the ESR and save it */        \
+       stw     r5,_ESR(r11);                                                 \
+       mfspr   r4,SPRN_DEAR;           /* Grab the DEAR */                   \
+       EXC_XFER_EE_LITE(0x0300, handle_page_fault)
+
 #define INSTRUCTION_STORAGE_EXCEPTION                                        \
        START_EXCEPTION(InstructionStorage)                                   \
        NORMAL_EXCEPTION_PROLOG;                                              \
@@ -372,8 +384,31 @@ label:
 #define FP_UNAVAILABLE_EXCEPTION                                             \
        START_EXCEPTION(FloatingPointUnavailable)                             \
        NORMAL_EXCEPTION_PROLOG;                                              \
-       bne     load_up_fpu;            /* if from user, just load it up */   \
-       addi    r3,r1,STACK_FRAME_OVERHEAD;                                   \
+       beq     1f;                                                           \
+       bl      load_up_fpu;            /* if from user, just load it up */   \
+       b       fast_exception_return;                                        \
+1:     addi    r3,r1,STACK_FRAME_OVERHEAD;                                   \
        EXC_XFER_EE_LITE(0x800, kernel_fp_unavailable_exception)
 
+#ifndef __ASSEMBLY__
+struct exception_regs {
+       unsigned long mas0;
+       unsigned long mas1;
+       unsigned long mas2;
+       unsigned long mas3;
+       unsigned long mas6;
+       unsigned long mas7;
+       unsigned long srr0;
+       unsigned long srr1;
+       unsigned long csrr0;
+       unsigned long csrr1;
+       unsigned long dsrr0;
+       unsigned long dsrr1;
+       unsigned long saved_ksp_limit;
+};
+
+/* ensure this structure is always sized to a multiple of the stack alignment */
+#define STACK_EXC_LVL_FRAME_SIZE       _ALIGN_UP(sizeof (struct exception_regs), 16)
+
+#endif /* __ASSEMBLY__ */
 #endif /* __HEAD_BOOKE_H__ */