clocksource: pass clocksource to read() callback
[safe/jmp/linux-2.6] / arch / powerpc / kernel / head_booke.h
index b0461be..95f39f1 100644 (file)
                mtspr   SPRN_IVOR##vector_number,r26;   \
                sync
 
+#if (THREAD_SHIFT < 15)
+#define ALLOC_STACK_FRAME(reg, val)                    \
+       addi reg,reg,val
+#else
+#define ALLOC_STACK_FRAME(reg, val)                    \
+       addis   reg,reg,val@ha;                         \
+       addi    reg,reg,val@l
+#endif
+
 #define NORMAL_EXCEPTION_PROLOG                                                     \
        mtspr   SPRN_SPRG0,r10;         /* save two registers to work with */\
        mtspr   SPRN_SPRG1,r11;                                              \
@@ -20,7 +29,7 @@
        beq     1f;                                                          \
        mfspr   r1,SPRN_SPRG3;          /* if from user, start at top of   */\
        lwz     r1,THREAD_INFO-THREAD(r1); /* this thread's kernel stack   */\
-       addi    r1,r1,THREAD_SIZE;                                           \
+       ALLOC_STACK_FRAME(r1, THREAD_SIZE);                                  \
 1:     subi    r1,r1,INT_FRAME_SIZE;   /* Allocate an exception frame     */\
        mr      r11,r1;                                                      \
        stw     r10,_CCR(r11);          /* save various registers          */\
 
 /* only on e500mc/e200 */
 #define DEBUG_STACK_BASE       dbgirq_ctx
-#ifdef CONFIG_PPC_E500MC
-#define DEBUG_SPRG             SPRN_SPRG9
-#else
+#ifdef CONFIG_E200
 #define DEBUG_SPRG             SPRN_SPRG6W
+#else
+#define DEBUG_SPRG             SPRN_SPRG9
 #endif
 
 #define EXC_LVL_FRAME_OVERHEAD (THREAD_SIZE - INT_FRAME_SIZE - EXC_LVL_SIZE)
@@ -279,7 +288,7 @@ label:
        lwz     r11,GPR11(r8);                                                \
        mfspr   r8,DEBUG_SPRG;                                                \
                                                                              \
-       RFDI;                                                                 \
+       PPC_RFDI;                                                                     \
        b       .;                                                            \
                                                                              \
        /* continue normal handling for a debug exception... */               \
@@ -340,6 +349,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;                                              \