Merge branch 'for_linus' of git://git.infradead.org/~dedekind/ubifs-2.6
[pandora-kernel.git] / arch / powerpc / kernel / misc_64.S
index 519861d..4dd70cf 100644 (file)
 
        .text
 
-_GLOBAL(get_msr)
-       mfmsr   r3
-       blr
-
-_GLOBAL(get_srr0)
-       mfsrr0  r3
-       blr
-
-_GLOBAL(get_srr1)
-       mfsrr1  r3
-       blr
-
 #ifdef CONFIG_IRQSTACKS
 _GLOBAL(call_do_softirq)
        mflr    r0
        std     r0,16(r1)
-       stdu    r1,THREAD_SIZE-112(r3)
+       stdu    r1,THREAD_SIZE-STACK_FRAME_OVERHEAD(r3)
        mr      r1,r3
        bl      .__do_softirq
        ld      r1,0(r1)
@@ -56,7 +44,7 @@ _GLOBAL(call_handle_irq)
        mflr    r0
        std     r0,16(r1)
        mtctr   r8
-       stdu    r1,THREAD_SIZE-112(r5)
+       stdu    r1,THREAD_SIZE-STACK_FRAME_OVERHEAD(r5)
        mr      r1,r5
        bctrl
        ld      r1,0(r1)
@@ -518,13 +506,39 @@ _GLOBAL(giveup_altivec)
 
 #endif /* CONFIG_ALTIVEC */
 
-_GLOBAL(kernel_execve)
-       li      r0,__NR_execve
-       sc
-       bnslr
-       neg     r3,r3
+#ifdef CONFIG_VSX
+/*
+ * __giveup_vsx(tsk)
+ * Disable VSX for the task given as the argument.
+ * Does NOT save vsx registers.
+ * Enables the VSX for use in the kernel on return.
+ */
+_GLOBAL(__giveup_vsx)
+       mfmsr   r5
+       oris    r5,r5,MSR_VSX@h
+       mtmsrd  r5                      /* enable use of VSX now */
+       isync
+
+       cmpdi   0,r3,0
+       beqlr-                          /* if no previous owner, done */
+       addi    r3,r3,THREAD            /* want THREAD of task */
+       ld      r5,PT_REGS(r3)
+       cmpdi   0,r5,0
+       beq     1f
+       ld      r4,_MSR-STACK_FRAME_OVERHEAD(r5)
+       lis     r3,MSR_VSX@h
+       andc    r4,r4,r3                /* disable VSX for previous task */
+       std     r4,_MSR-STACK_FRAME_OVERHEAD(r5)
+1:
+#ifndef CONFIG_SMP
+       li      r5,0
+       ld      r4,last_task_used_vsx@got(r2)
+       std     r5,0(r4)
+#endif /* CONFIG_SMP */
        blr
 
+#endif /* CONFIG_VSX */
+
 /* kexec_wait(phys_cpu)
  *
  * wait for the flag to change, indicating this kernel is going away but
@@ -606,7 +620,7 @@ _GLOBAL(kexec_sequence)
        std     r0,16(r1)
 
        /* switch stacks to newstack -- &kexec_stack.stack */
-       stdu    r1,THREAD_SIZE-112(r3)
+       stdu    r1,THREAD_SIZE-STACK_FRAME_OVERHEAD(r3)
        mr      r1,r3
 
        li      r0,0
@@ -623,7 +637,7 @@ _GLOBAL(kexec_sequence)
        std     r26,-48(r1)
        std     r25,-56(r1)
 
-       stdu    r1,-112-64(r1)
+       stdu    r1,-STACK_FRAME_OVERHEAD-64(r1)
 
        /* save args into preserved regs */
        mr      r31,r3                  /* newstack (both) */
@@ -646,6 +660,19 @@ _GLOBAL(kexec_sequence)
        /* turn off mmu */
        bl      real_mode
 
+       /* copy  0x100 bytes starting at start to 0 */
+       li      r3,0
+       mr      r4,r30          /* start, aka phys mem offset */
+       li      r5,0x100
+       li      r6,0
+       bl      .copy_and_flush /* (dest, src, copy limit, start offset) */
+1:     /* assume normal blr return */
+
+       /* release other cpus to the new kernel secondary start at 0x60 */
+       mflr    r5
+       li      r6,1
+       stw     r6,kexec_flag-1b(5)
+
        /* clear out hardware hash page table and tlb */
        ld      r5,0(r27)               /* deref function descriptor */
        mtctr   r5
@@ -676,19 +703,6 @@ _GLOBAL(kexec_sequence)
  *    are the boot cpu ?????
  *    other device tree differences (prop sizes, va vs pa, etc)...
  */
-
-       /* copy  0x100 bytes starting at start to 0 */
-       li      r3,0
-       mr      r4,r30
-       li      r5,0x100
-       li      r6,0
-       bl      .copy_and_flush /* (dest, src, copy limit, start offset) */
-1:     /* assume normal blr return */
-
-       /* release other cpus to the new kernel secondary start at 0x60 */
-       mflr    r5
-       li      r6,1
-       stw     r6,kexec_flag-1b(5)
        mr      r3,r25  # my phys cpu
        mr      r4,r30  # start, aka phys mem offset
        mtlr    4