Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[pandora-kernel.git] / arch / powerpc / kernel / head_40x.S
index e312824..56d8e5d 100644 (file)
@@ -93,6 +93,12 @@ _ENTRY(crit_r10)
        .space  4
 _ENTRY(crit_r11)
        .space  4
+_ENTRY(crit_srr0)
+       .space  4
+_ENTRY(crit_srr1)
+       .space  4
+_ENTRY(saved_ksp_limit)
+       .space  4
 
 /*
  * Exception vector entry code. This code runs with address translation
@@ -148,14 +154,14 @@ _ENTRY(crit_r11)
        mfcr    r10;                    /* save CR in r10 for now          */\
        mfspr   r11,SPRN_SRR3;          /* check whether user or kernel    */\
        andi.   r11,r11,MSR_PR;                                              \
-       lis     r11,critical_stack_top@h;                                    \
-       ori     r11,r11,critical_stack_top@l;                                \
+       lis     r11,critirq_ctx@ha;                                          \
+       tophys(r11,r11);                                                     \
+       lwz     r11,critirq_ctx@l(r11);                                      \
        beq     1f;                                                          \
        /* COMING FROM USER MODE */                                          \
        mfspr   r11,SPRN_SPRG3;         /* if from user, start at top of   */\
        lwz     r11,THREAD_INFO-THREAD(r11); /* this thread's kernel stack */\
-       addi    r11,r11,THREAD_SIZE;                                         \
-1:     subi    r11,r11,INT_FRAME_SIZE; /* Allocate an exception frame     */\
+1:     addi    r11,r11,THREAD_SIZE-INT_FRAME_SIZE; /* Alloc an excpt frm  */\
        tophys(r11,r11);                                                     \
        stw     r10,_CCR(r11);          /* save various registers          */\
        stw     r12,GPR12(r11);                                              \
@@ -289,7 +295,7 @@ label:
        /* If we are faulting a kernel address, we have to use the
         * kernel page tables.
         */
-       lis     r11, TASK_SIZE@h
+       lis     r11, PAGE_OFFSET@h
        cmplw   r10, r11
        blt+    3f
        lis     r11, swapper_pg_dir@h
@@ -481,7 +487,7 @@ label:
        /* If we are faulting a kernel address, we have to use the
         * kernel page tables.
         */
-       lis     r11, TASK_SIZE@h
+       lis     r11, PAGE_OFFSET@h
        cmplw   r10, r11
        blt+    3f
        lis     r11, swapper_pg_dir@h
@@ -581,7 +587,7 @@ label:
        /* If we are faulting a kernel address, we have to use the
         * kernel page tables.
         */
-       lis     r11, TASK_SIZE@h
+       lis     r11, PAGE_OFFSET@h
        cmplw   r10, r11
        blt+    3f
        lis     r11, swapper_pg_dir@h
@@ -994,17 +1000,7 @@ empty_zero_page:
        .space  4096
        .globl  swapper_pg_dir
 swapper_pg_dir:
-       .space  4096
-
-
-/* Stack for handling critical exceptions from kernel mode */
-       .section .bss
-        .align 12
-exception_stack_bottom:
-       .space  4096
-critical_stack_top:
-       .globl  exception_stack_top
-exception_stack_top:
+       .space  PGD_TABLE_SIZE
 
 /* Room for two PTE pointers, usually the kernel and current user pointers
  * to their respective root page table.