diff options
author | Michael Neuling <mikey@neuling.org> | 2008-06-25 00:07:18 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-06-30 21:28:50 -0400 |
commit | ce48b2100785e5ca629fb3aa8e3b50aca808f692 (patch) | |
tree | 63532ff7cc68b18ca4902bd10e03fcbaaf01cade /arch/powerpc/kernel/fpu.S | |
parent | 72ffff5b1792b0fa4d40a8e2f3276fff999820ec (diff) |
powerpc: Add VSX context save/restore, ptrace and signal support
This patch extends the floating point save and restore code to use the
VSX load/stores when VSX is available. This will make FP context
save/restore marginally slower on FP only code, when VSX is available,
as it has to load/store 128bits rather than just 64bits.
Mixing FP, VMX and VSX code will get constant architected state.
The signals interface is extended to enable access to VSR 0-31
doubleword 1 after discussions with tool chain maintainers. Backward
compatibility is maintained.
The ptrace interface is also extended to allow access to VSR 0-31 full
registers.
Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel/fpu.S')
-rw-r--r-- | arch/powerpc/kernel/fpu.S | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/arch/powerpc/kernel/fpu.S b/arch/powerpc/kernel/fpu.S index 15247fe171a..a088c064ae4 100644 --- a/arch/powerpc/kernel/fpu.S +++ b/arch/powerpc/kernel/fpu.S | |||
@@ -57,6 +57,11 @@ END_FTR_SECTION_IFSET(CPU_FTR_VSX); \ | |||
57 | _GLOBAL(load_up_fpu) | 57 | _GLOBAL(load_up_fpu) |
58 | mfmsr r5 | 58 | mfmsr r5 |
59 | ori r5,r5,MSR_FP | 59 | ori r5,r5,MSR_FP |
60 | #ifdef CONFIG_VSX | ||
61 | BEGIN_FTR_SECTION | ||
62 | oris r5,r5,MSR_VSX@h | ||
63 | END_FTR_SECTION_IFSET(CPU_FTR_VSX) | ||
64 | #endif | ||
60 | SYNC | 65 | SYNC |
61 | MTMSRD(r5) /* enable use of fpu now */ | 66 | MTMSRD(r5) /* enable use of fpu now */ |
62 | isync | 67 | isync |
@@ -73,7 +78,7 @@ _GLOBAL(load_up_fpu) | |||
73 | beq 1f | 78 | beq 1f |
74 | toreal(r4) | 79 | toreal(r4) |
75 | addi r4,r4,THREAD /* want last_task_used_math->thread */ | 80 | addi r4,r4,THREAD /* want last_task_used_math->thread */ |
76 | SAVE_32FPRS(0, r4) | 81 | SAVE_32FPVSRS(0, r5, r4) |
77 | mffs fr0 | 82 | mffs fr0 |
78 | stfd fr0,THREAD_FPSCR(r4) | 83 | stfd fr0,THREAD_FPSCR(r4) |
79 | PPC_LL r5,PT_REGS(r4) | 84 | PPC_LL r5,PT_REGS(r4) |
@@ -100,7 +105,7 @@ _GLOBAL(load_up_fpu) | |||
100 | #endif | 105 | #endif |
101 | lfd fr0,THREAD_FPSCR(r5) | 106 | lfd fr0,THREAD_FPSCR(r5) |
102 | MTFSF_L(fr0) | 107 | MTFSF_L(fr0) |
103 | REST_32FPRS(0, r5) | 108 | REST_32FPVSRS(0, r4, r5) |
104 | #ifndef CONFIG_SMP | 109 | #ifndef CONFIG_SMP |
105 | subi r4,r5,THREAD | 110 | subi r4,r5,THREAD |
106 | fromreal(r4) | 111 | fromreal(r4) |
@@ -119,6 +124,11 @@ _GLOBAL(load_up_fpu) | |||
119 | _GLOBAL(giveup_fpu) | 124 | _GLOBAL(giveup_fpu) |
120 | mfmsr r5 | 125 | mfmsr r5 |
121 | ori r5,r5,MSR_FP | 126 | ori r5,r5,MSR_FP |
127 | #ifdef CONFIG_VSX | ||
128 | BEGIN_FTR_SECTION | ||
129 | oris r5,r5,MSR_VSX@h | ||
130 | END_FTR_SECTION_IFSET(CPU_FTR_VSX) | ||
131 | #endif | ||
122 | SYNC_601 | 132 | SYNC_601 |
123 | ISYNC_601 | 133 | ISYNC_601 |
124 | MTMSRD(r5) /* enable use of fpu now */ | 134 | MTMSRD(r5) /* enable use of fpu now */ |
@@ -129,7 +139,7 @@ _GLOBAL(giveup_fpu) | |||
129 | addi r3,r3,THREAD /* want THREAD of task */ | 139 | addi r3,r3,THREAD /* want THREAD of task */ |
130 | PPC_LL r5,PT_REGS(r3) | 140 | PPC_LL r5,PT_REGS(r3) |
131 | PPC_LCMPI 0,r5,0 | 141 | PPC_LCMPI 0,r5,0 |
132 | SAVE_32FPRS(0, r3) | 142 | SAVE_32FPVSRS(0, r4 ,r3) |
133 | mffs fr0 | 143 | mffs fr0 |
134 | stfd fr0,THREAD_FPSCR(r3) | 144 | stfd fr0,THREAD_FPSCR(r3) |
135 | beq 1f | 145 | beq 1f |