]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - arch/ppc64/kernel/entry.S
powerpc: change sys32_ to compat_sys_
[karo-tx-linux.git] / arch / ppc64 / kernel / entry.S
index bf99b4a92f20864313c7d79211a5d5a6db68a7ce..5d2fcbe384c164dc88cf96f33df8fe5a71886858 100644 (file)
@@ -28,7 +28,7 @@
 #include <asm/mmu.h>
 #include <asm/thread_info.h>
 #include <asm/ppc_asm.h>
-#include <asm/offsets.h>
+#include <asm/asm-offsets.h>
 #include <asm/cputable.h>
 
 #ifdef CONFIG_PPC_ISERIES
@@ -191,8 +191,8 @@ syscall_exit_trace_cont:
        ld      r1,GPR1(r1)
        mtlr    r4
        mtcr    r5
-       mtspr   SRR0,r7
-       mtspr   SRR1,r8
+       mtspr   SPRN_SRR0,r7
+       mtspr   SPRN_SRR1,r8
        rfid
        b       .       /* prevent speculative execution */
 
@@ -265,7 +265,7 @@ _GLOBAL(save_nvgprs)
  */
 _GLOBAL(ppc32_sigsuspend)
        bl      .save_nvgprs
-       bl      .sys32_sigsuspend
+       bl      .compat_sys_sigsuspend
        b       70f
 
 _GLOBAL(ppc64_rt_sigsuspend)
@@ -275,13 +275,23 @@ _GLOBAL(ppc64_rt_sigsuspend)
 
 _GLOBAL(ppc32_rt_sigsuspend)
        bl      .save_nvgprs
-       bl      .sys32_rt_sigsuspend
-       /* If sigsuspend() returns zero, we are going into a signal handler */
+       bl      .compat_sys_rt_sigsuspend
 70:    cmpdi   0,r3,0
-       beq     .ret_from_except
-       /* If it returned -EINTR, we need to return via syscall_exit to set
+       /* If it returned an error, we need to return via syscall_exit to set
           the SO bit in cr0 and potentially stop for ptrace. */
-       b       syscall_exit
+       bne     syscall_exit
+       /* If sigsuspend() returns zero, we are going into a signal handler. We
+          may need to call audit_syscall_exit() to mark the exit from sigsuspend() */
+#ifdef CONFIG_AUDIT
+       ld      r3,PACACURRENT(r13)
+       ld      r4,AUDITCONTEXT(r3)
+       cmpdi   0,r4,0
+       beq     .ret_from_except        /* No audit_context: Leave immediately. */
+       li      r4, 2                   /* AUDITSC_FAILURE */
+       li      r5,-4                   /* It's always -EINTR */
+       bl      .audit_syscall_exit
+#endif
+       b       .ret_from_except
 
 _GLOBAL(ppc_fork)
        bl      .save_nvgprs
@@ -300,7 +310,7 @@ _GLOBAL(ppc_clone)
 
 _GLOBAL(ppc32_swapcontext)
        bl      .save_nvgprs
-       bl      .sys32_swapcontext
+       bl      .compat_sys_swapcontext
        b       80f
        
 _GLOBAL(ppc64_swapcontext)
@@ -309,11 +319,11 @@ _GLOBAL(ppc64_swapcontext)
        b       80f
 
 _GLOBAL(ppc32_sigreturn)
-       bl      .sys32_sigreturn
+       bl      .compat_sys_sigreturn
        b       80f
 
 _GLOBAL(ppc32_rt_sigreturn)
-       bl      .sys32_rt_sigreturn
+       bl      .compat_sys_rt_sigreturn
        b       80f
 
 _GLOBAL(ppc64_rt_sigreturn)
@@ -521,7 +531,7 @@ restore:
        mtctr   r3
        mtlr    r0
        ld      r3,_XER(r1)
-       mtspr   XER,r3
+       mtspr   SPRN_XER,r3
 
        REST_8GPRS(5, r1)
 
@@ -533,12 +543,12 @@ restore:
        mtmsrd  r0,1
 
        ld      r0,_MSR(r1)
-       mtspr   SRR1,r0
+       mtspr   SPRN_SRR1,r0
 
        ld      r2,_CCR(r1)
        mtcrf   0xFF,r2
        ld      r2,_NIP(r1)
-       mtspr   SRR0,r2
+       mtspr   SPRN_SRR0,r2
 
        ld      r0,GPR0(r1)
        ld      r2,GPR2(r1)
@@ -633,7 +643,7 @@ _GLOBAL(enter_rtas)
        std     r4,_CCR(r1)
        mfctr   r5
        std     r5,_CTR(r1)
-       mfspr   r6,XER
+       mfspr   r6,SPRN_XER
        std     r6,_XER(r1)
        mfdar   r7
        std     r7,_DAR(r1)
@@ -687,14 +697,14 @@ _GLOBAL(enter_rtas)
        ld      r5,RTASENTRY(r4)        /* get the rtas->entry value */
        ld      r4,RTASBASE(r4)         /* get the rtas->base value */
        
-       mtspr   SRR0,r5
-       mtspr   SRR1,r6
+       mtspr   SPRN_SRR0,r5
+       mtspr   SPRN_SRR1,r6
        rfid
        b       .       /* prevent speculative execution */
 
 _STATIC(rtas_return_loc)
        /* relocation is off at this point */
-       mfspr   r4,SPRG3                /* Get PACA */
+       mfspr   r4,SPRN_SPRG3           /* Get PACA */
        SET_REG_TO_CONST(r5, KERNELBASE)
         sub     r4,r4,r5                /* RELOC the PACA base pointer */
 
@@ -708,8 +718,8 @@ _STATIC(rtas_return_loc)
        LOADADDR(r3,.rtas_restore_regs)
         ld     r4,PACASAVEDMSR(r4)     /* Restore our MSR */
 
-       mtspr   SRR0,r3
-       mtspr   SRR1,r4
+       mtspr   SPRN_SRR0,r3
+       mtspr   SPRN_SRR1,r4
        rfid
        b       .       /* prevent speculative execution */
 
@@ -720,14 +730,14 @@ _STATIC(rtas_restore_regs)
        REST_8GPRS(14, r1)              /* Restore the non-volatiles */
        REST_10GPRS(22, r1)             /* ditto */
 
-       mfspr   r13,SPRG3
+       mfspr   r13,SPRN_SPRG3
 
        ld      r4,_CCR(r1)
        mtcr    r4
        ld      r5,_CTR(r1)
        mtctr   r5
        ld      r6,_XER(r1)
-       mtspr   XER,r6
+       mtspr   SPRN_XER,r6
        ld      r7,_DAR(r1)
        mtdar   r7
        ld      r8,_DSISR(r1)
@@ -764,7 +774,7 @@ _GLOBAL(enter_prom)
        std     r4,_CCR(r1)
        mfctr   r5
        std     r5,_CTR(r1)
-       mfspr   r6,XER
+       mfspr   r6,SPRN_XER
        std     r6,_XER(r1)
        mfdar   r7
        std     r7,_DAR(r1)
@@ -817,7 +827,7 @@ _GLOBAL(enter_prom)
        ld      r5,_CTR(r1)
        mtctr   r5
        ld      r6,_XER(r1)
-       mtspr   XER,r6
+       mtspr   SPRN_XER,r6
        ld      r7,_DAR(r1)
        mtdar   r7
        ld      r8,_DSISR(r1)