]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - arch/powerpc/kernel/entry_64.S
powerpc: Correct DSCR during TM context switch
[karo-tx-linux.git] / arch / powerpc / kernel / entry_64.S
index d23d7526d37a1693c2070dad0b68f3a5c36119e1..6528c5e2cc44800a201802858c23d34e92162041 100644 (file)
@@ -378,19 +378,15 @@ _GLOBAL(ret_from_fork)
 _GLOBAL(ret_from_kernel_thread)
        bl      schedule_tail
        REST_NVGPRS(r1)
-       ld      r14, 0(r14)
        mtlr    r14
        mr      r3,r15
+#if defined(_CALL_ELF) && _CALL_ELF == 2
+       mr      r12,r14
+#endif
        blrl
        li      r3,0
        b       syscall_exit
 
-       .section        ".toc","aw"
-DSCR_DEFAULT:
-       .tc dscr_default[TC],dscr_default
-
-       .section        ".text"
-
 /*
  * This routine switches between two different tasks.  The process
  * state of one is saved on its kernel stack.  Then the state
@@ -432,12 +428,6 @@ BEGIN_FTR_SECTION
        std     r24,THREAD_VRSAVE(r3)
 END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
 #endif /* CONFIG_ALTIVEC */
-#ifdef CONFIG_PPC64
-BEGIN_FTR_SECTION
-       mfspr   r25,SPRN_DSCR
-       std     r25,THREAD_DSCR(r3)
-END_FTR_SECTION_IFSET(CPU_FTR_DSCR)
-#endif
        and.    r0,r0,r22
        beq+    1f
        andc    r22,r22,r0
@@ -575,11 +565,10 @@ END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
 #ifdef CONFIG_PPC64
 BEGIN_FTR_SECTION
        lwz     r6,THREAD_DSCR_INHERIT(r4)
-       ld      r7,DSCR_DEFAULT@toc(2)
        ld      r0,THREAD_DSCR(r4)
        cmpwi   r6,0
        bne     1f
-       ld      r0,0(r7)
+       ld      r0,PACA_DSCR(r13)
 1:
 BEGIN_FTR_SECTION_NESTED(70)
        mfspr   r8, SPRN_FSCR
@@ -1173,7 +1162,7 @@ _GLOBAL(mcount)
 _GLOBAL(_mcount)
        blr
 
-_GLOBAL(ftrace_caller)
+_GLOBAL_TOC(ftrace_caller)
        /* Taken from output of objdump from lib64/glibc */
        mflr    r3
        ld      r11, 0(r1)
@@ -1197,10 +1186,7 @@ _GLOBAL(ftrace_graph_stub)
 _GLOBAL(ftrace_stub)
        blr
 #else
-_GLOBAL(mcount)
-       blr
-
-_GLOBAL(_mcount)
+_GLOBAL_TOC(_mcount)
        /* Taken from output of objdump from lib64/glibc */
        mflr    r3
        ld      r11, 0(r1)