[POWERPC] Save trap number in bad_stack
[deliverable/linux.git] / arch / powerpc / kernel / head_64.S
index 8cdff5a1f3e223667a1bcbe20d8fbc276d82a707..1111fcec7673be71b6dd860a669886154d66a3c9 100644 (file)
@@ -278,8 +278,12 @@ exception_marker:
        beq-    1f;                                                        \
        ld      r1,PACAKSAVE(r13);      /* kernel stack to use          */ \
 1:     cmpdi   cr1,r1,0;               /* check if r1 is in userspace  */ \
-       bge-    cr1,bad_stack;          /* abort if it is               */ \
-       std     r9,_CCR(r1);            /* save CR in stackframe        */ \
+       bge-    cr1,2f;                 /* abort if it is               */ \
+       b       3f;                                                        \
+2:     li      r1,(n);                 /* will be reloaded later       */ \
+       sth     r1,PACA_TRAP_SAVE(r13);                                    \
+       b       bad_stack;                                                 \
+3:     std     r9,_CCR(r1);            /* save CR in stackframe        */ \
        std     r11,_NIP(r1);           /* save SRR0 in stackframe      */ \
        std     r12,_MSR(r1);           /* save SRR1 in stackframe      */ \
        std     r10,0(r1);              /* make stack chain pointer     */ \
@@ -613,7 +617,7 @@ system_call_pSeries:
 /*** pSeries interrupt support ***/
 
        /* moved from 0xf00 */
-       MASKABLE_EXCEPTION_PSERIES(., performance_monitor)
+       STD_EXCEPTION_PSERIES(., performance_monitor)
 
 /*
  * An interrupt came in while soft-disabled; clear EE in SRR1,
@@ -825,7 +829,7 @@ system_reset_iSeries:
 
        cmpwi   0,r23,0
        beq     iSeries_secondary_smp_loop      /* Loop until told to go */
-       bne     .__secondary_start              /* Loop until told to go */
+       bne     __secondary_start               /* Loop until told to go */
 iSeries_secondary_smp_loop:
        /* Let the Hypervisor know we are alive */
        /* 8002 is a call to HvCallCfg::getLps, a harmless Hypervisor function */
@@ -846,7 +850,6 @@ iSeries_secondary_smp_loop:
        b       1b                      /* If SMP not configured, secondaries
                                         * loop forever */
 
-       .globl decrementer_iSeries_masked
 decrementer_iSeries_masked:
        /* We may not have a valid TOC pointer in here. */
        li      r11,1
@@ -857,7 +860,6 @@ decrementer_iSeries_masked:
        mtspr   SPRN_DEC,r12
        /* fall through */
 
-       .globl hardware_interrupt_iSeries_masked
 hardware_interrupt_iSeries_masked:
        mtcrf   0x80,r9         /* Restore regs */
        ld      r12,PACALPPACAPTR(r13)
@@ -942,6 +944,8 @@ bad_stack:
        SAVE_2GPRS(7,r1)
        SAVE_10GPRS(12,r1)
        SAVE_10GPRS(22,r1)
+       lhz     r12,PACA_TRAP_SAVE(r13)
+       std     r12,_TRAP(r1)
        addi    r11,r1,INT_FRAME_SIZE
        std     r11,0(r1)
        li      r12,0
@@ -1557,7 +1561,6 @@ _GLOBAL(generic_secondary_smp_init)
        
        /* turn on 64-bit mode */
        bl      .enable_64b_mode
-       isync
 
        /* Set up a paca value for this processor. Since we have the
         * physical cpu id in r24, we need to search the pacas to find
@@ -1604,7 +1607,7 @@ _GLOBAL(generic_secondary_smp_init)
        ld      r1,PACAEMERGSP(r13)
        subi    r1,r1,STACK_FRAME_OVERHEAD
 
-       b       .__secondary_start
+       b       __secondary_start
 #endif
 
 #ifdef CONFIG_PPC_ISERIES
@@ -1737,10 +1740,6 @@ _STATIC(__boot_from_prom)
        /* We never return */
        trap
 
-/*
- * At this point, r3 contains the physical address we are running at,
- * returned by prom_init()
- */
 _STATIC(__after_prom_start)
 
 /*
@@ -1853,7 +1852,6 @@ __secondary_start_pmac_0:
 _GLOBAL(pmac_secondary_start)
        /* turn on 64-bit mode */
        bl      .enable_64b_mode
-       isync
 
        /* Copy some CPU settings from CPU 0 */
        bl      .__restore_cpu_ppc970
@@ -1873,7 +1871,7 @@ _GLOBAL(pmac_secondary_start)
        ld      r1,PACAEMERGSP(r13)
        subi    r1,r1,STACK_FRAME_OVERHEAD
 
-       b       .__secondary_start
+       b       __secondary_start
 
 #endif /* CONFIG_PPC_PMAC */
 
@@ -1890,7 +1888,7 @@ _GLOBAL(pmac_secondary_start)
  *   r13   = paca virtual address
  *   SPRG3 = paca virtual address
  */
-_GLOBAL(__secondary_start)
+__secondary_start:
        /* Set thread priority to MEDIUM */
        HMT_MEDIUM
 
This page took 0.030056 seconds and 5 git commands to generate.