powerpc: Make load_up_fpu and load_up_altivec callable
authorMichael Neuling <mikey@neuling.org>
Wed, 25 Jun 2008 04:07:18 +0000 (14:07 +1000)
committerPaul Mackerras <paulus@samba.org>
Tue, 1 Jul 2008 01:28:45 +0000 (11:28 +1000)
Make load_up_fpu and load_up_altivec callable so they can be reused by
the VSX code.

Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/kernel/fpu.S
arch/powerpc/kernel/head_32.S
arch/powerpc/kernel/head_64.S
arch/powerpc/kernel/head_booke.h

index 821e152e093c5bf4e58fe7b8b136974c7e4f2e52..8a2b3d62b9b88037b08b4491f2290c8b75758bb0 100644 (file)
@@ -85,7 +85,7 @@ _GLOBAL(load_up_fpu)
 #endif /* CONFIG_SMP */
        /* restore registers and return */
        /* we haven't used ctr or xer or lr */
-       b       fast_exception_return
+       blr
 
 /*
  * giveup_fpu(tsk)
index 785af9b56591550d2947bf211e28901ab9981e48..99ee2f0f0f2bdcef067df7179e9614c459838983 100644 (file)
@@ -421,8 +421,10 @@ BEGIN_FTR_SECTION
        b       ProgramCheck
 END_FTR_SECTION_IFSET(CPU_FTR_FPU_UNAVAILABLE)
        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)
 
 /* Decrementer */
index dd9e6595cae5190538b99635aae77f9d798e08d9..64433731d9958cc148d0458f8fdf3d1d33fbd65e 100644 (file)
@@ -741,7 +741,8 @@ fp_unavailable_common:
        ENABLE_INTS
        bl      .kernel_fp_unavailable_exception
        BUG_OPCODE
-1:     b       .load_up_fpu
+1:     bl      .load_up_fpu
+       b       fast_exception_return
 
        .align  7
        .globl altivec_unavailable_common
@@ -749,7 +750,10 @@ altivec_unavailable_common:
        EXCEPTION_PROLOG_COMMON(0xf20, PACA_EXGEN)
 #ifdef CONFIG_ALTIVEC
 BEGIN_FTR_SECTION
-       bne     .load_up_altivec        /* if from user, just load it up */
+       beq     1f
+       bl      .load_up_altivec
+       b       fast_exception_return
+1:
 END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
 #endif
        bl      .save_nvgprs
@@ -829,7 +833,7 @@ _STATIC(load_up_altivec)
        std     r4,0(r3)
 #endif /* CONFIG_SMP */
        /* restore registers and return */
-       b       fast_exception_return
+       blr
 #endif /* CONFIG_ALTIVEC */
 
 /*
index 505494f1ee7c912aba27b5d3c18c5673e594c625..b0461be1c9286bcd1b217178d20423e7a041edf7 100644 (file)
@@ -376,8 +376,10 @@ 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__