aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/fpu.S
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2005-10-27 08:44:39 -0400
committerPaul Mackerras <paulus@samba.org>2005-10-27 08:44:39 -0400
commit6316222ea050d469c3155881d9dee2c7671d9fef (patch)
tree2a075cbdab11e10efc868a31e378dffae90f06da /arch/powerpc/kernel/fpu.S
parent80579e1f4a6b5f5dec92faa6c3e0645961c99091 (diff)
powerpc: Introduce toreal/fromreal assembly macros
On 32-bit platforms, these convert from kernel virtual addresses to real (physical addresses), like tophys/tovirt but they use the same register for the source and destination. On 64-bit platforms, they do nothing because the hardware ignores the top two bits of the address in real mode. These new macros are used in fpu.S now. Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel/fpu.S')
-rw-r--r--arch/powerpc/kernel/fpu.S8
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/powerpc/kernel/fpu.S b/arch/powerpc/kernel/fpu.S
index 51fd78da25b7..4d6001fa1cf2 100644
--- a/arch/powerpc/kernel/fpu.S
+++ b/arch/powerpc/kernel/fpu.S
@@ -40,17 +40,17 @@ _GLOBAL(load_up_fpu)
40 */ 40 */
41#ifndef CONFIG_SMP 41#ifndef CONFIG_SMP
42 LOADBASE(r3, last_task_used_math) 42 LOADBASE(r3, last_task_used_math)
43 tophys(r3,r3) 43 toreal(r3)
44 LDL r4,OFF(last_task_used_math)(r3) 44 LDL r4,OFF(last_task_used_math)(r3)
45 CMPI 0,r4,0 45 CMPI 0,r4,0
46 beq 1f 46 beq 1f
47 tophys(r4,r4) 47 toreal(r4)
48 addi r4,r4,THREAD /* want last_task_used_math->thread */ 48 addi r4,r4,THREAD /* want last_task_used_math->thread */
49 SAVE_32FPRS(0, r4) 49 SAVE_32FPRS(0, r4)
50 mffs fr0 50 mffs fr0
51 stfd fr0,THREAD_FPSCR(r4) 51 stfd fr0,THREAD_FPSCR(r4)
52 LDL r5,PT_REGS(r4) 52 LDL r5,PT_REGS(r4)
53 tophys(r5,r5) 53 toreal(r5)
54 LDL r4,_MSR-STACK_FRAME_OVERHEAD(r5) 54 LDL r4,_MSR-STACK_FRAME_OVERHEAD(r5)
55 li r10,MSR_FP|MSR_FE0|MSR_FE1 55 li r10,MSR_FP|MSR_FE0|MSR_FE1
56 andc r4,r4,r10 /* disable FP for previous task */ 56 andc r4,r4,r10 /* disable FP for previous task */
@@ -76,7 +76,7 @@ _GLOBAL(load_up_fpu)
76 REST_32FPRS(0, r5) 76 REST_32FPRS(0, r5)
77#ifndef CONFIG_SMP 77#ifndef CONFIG_SMP
78 subi r4,r5,THREAD 78 subi r4,r5,THREAD
79 tovirt(r4,r4) 79 fromreal(r4)
80 STL r4,OFF(last_task_used_math)(r3) 80 STL r4,OFF(last_task_used_math)(r3)
81#endif /* CONFIG_SMP */ 81#endif /* CONFIG_SMP */
82 /* restore registers and return */ 82 /* restore registers and return */