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/traps.c | |
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/traps.c')
-rw-r--r-- | arch/powerpc/kernel/traps.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c index b463d48145a..878fbddb6ae 100644 --- a/arch/powerpc/kernel/traps.c +++ b/arch/powerpc/kernel/traps.c | |||
@@ -967,6 +967,20 @@ void altivec_unavailable_exception(struct pt_regs *regs) | |||
967 | die("Unrecoverable VMX/Altivec Unavailable Exception", regs, SIGABRT); | 967 | die("Unrecoverable VMX/Altivec Unavailable Exception", regs, SIGABRT); |
968 | } | 968 | } |
969 | 969 | ||
970 | void vsx_unavailable_exception(struct pt_regs *regs) | ||
971 | { | ||
972 | if (user_mode(regs)) { | ||
973 | /* A user program has executed an vsx instruction, | ||
974 | but this kernel doesn't support vsx. */ | ||
975 | _exception(SIGILL, regs, ILL_ILLOPC, regs->nip); | ||
976 | return; | ||
977 | } | ||
978 | |||
979 | printk(KERN_EMERG "Unrecoverable VSX Unavailable Exception " | ||
980 | "%lx at %lx\n", regs->trap, regs->nip); | ||
981 | die("Unrecoverable VSX Unavailable Exception", regs, SIGABRT); | ||
982 | } | ||
983 | |||
970 | void performance_monitor_exception(struct pt_regs *regs) | 984 | void performance_monitor_exception(struct pt_regs *regs) |
971 | { | 985 | { |
972 | perf_irq(regs); | 986 | perf_irq(regs); |
@@ -1099,6 +1113,21 @@ void altivec_assist_exception(struct pt_regs *regs) | |||
1099 | } | 1113 | } |
1100 | #endif /* CONFIG_ALTIVEC */ | 1114 | #endif /* CONFIG_ALTIVEC */ |
1101 | 1115 | ||
1116 | #ifdef CONFIG_VSX | ||
1117 | void vsx_assist_exception(struct pt_regs *regs) | ||
1118 | { | ||
1119 | if (!user_mode(regs)) { | ||
1120 | printk(KERN_EMERG "VSX assist exception in kernel mode" | ||
1121 | " at %lx\n", regs->nip); | ||
1122 | die("Kernel VSX assist exception", regs, SIGILL); | ||
1123 | } | ||
1124 | |||
1125 | flush_vsx_to_thread(current); | ||
1126 | printk(KERN_INFO "VSX assist not supported at %lx\n", regs->nip); | ||
1127 | _exception(SIGILL, regs, ILL_ILLOPC, regs->nip); | ||
1128 | } | ||
1129 | #endif /* CONFIG_VSX */ | ||
1130 | |||
1102 | #ifdef CONFIG_FSL_BOOKE | 1131 | #ifdef CONFIG_FSL_BOOKE |
1103 | void CacheLockingException(struct pt_regs *regs, unsigned long address, | 1132 | void CacheLockingException(struct pt_regs *regs, unsigned long address, |
1104 | unsigned long error_code) | 1133 | unsigned long error_code) |