aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-powerpc/processor.h
diff options
context:
space:
mode:
authorMichael Neuling <mikey@neuling.org>2008-06-25 00:07:18 -0400
committerPaul Mackerras <paulus@samba.org>2008-06-30 21:28:46 -0400
commitc6e6771b87d4e339d27f1383c8a808ae9b4ee5b8 (patch)
tree1900b7350ec685c3a31f2233fd88a57e34725b5c /include/asm-powerpc/processor.h
parent6f3d8e6947ec98e358514fc0f7b2e37fe88a21bb (diff)
powerpc: Introduce VSX thread_struct and CONFIG_VSX
The layout of the new VSR registers and how they overlap on top of the legacy FPR and VR registers is: VSR doubleword 0 VSR doubleword 1 ---------------------------------------------------------------- VSR[0] | FPR[0] | | ---------------------------------------------------------------- VSR[1] | FPR[1] | | ---------------------------------------------------------------- | ... | | | ... | | ---------------------------------------------------------------- VSR[30] | FPR[30] | | ---------------------------------------------------------------- VSR[31] | FPR[31] | | ---------------------------------------------------------------- VSR[32] | VR[0] | ---------------------------------------------------------------- VSR[33] | VR[1] | ---------------------------------------------------------------- | ... | | ... | ---------------------------------------------------------------- VSR[62] | VR[30] | ---------------------------------------------------------------- VSR[63] | VR[31] | ---------------------------------------------------------------- VSX has 64 128bit registers. The first 32 regs overlap with the FP registers and hence extend them with and additional 64 bits. The second 32 regs overlap with the VMX registers. This commit introduces the thread_struct changes required to reflect this register layout. Ptrace and signals code is updated so that the floating point registers are correctly accessed from the thread_struct when CONFIG_VSX is enabled. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'include/asm-powerpc/processor.h')
-rw-r--r--include/asm-powerpc/processor.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/include/asm-powerpc/processor.h b/include/asm-powerpc/processor.h
index a23da6356e06..e93e72df4bca 100644
--- a/include/asm-powerpc/processor.h
+++ b/include/asm-powerpc/processor.h
@@ -12,7 +12,11 @@
12 12
13#include <asm/reg.h> 13#include <asm/reg.h>
14 14
15#ifdef CONFIG_VSX
16#define TS_FPRWIDTH 2
17#else
15#define TS_FPRWIDTH 1 18#define TS_FPRWIDTH 1
19#endif
16 20
17#ifndef __ASSEMBLY__ 21#ifndef __ASSEMBLY__
18#include <linux/compiler.h> 22#include <linux/compiler.h>
@@ -80,6 +84,7 @@ extern long kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);
80/* Lazy FPU handling on uni-processor */ 84/* Lazy FPU handling on uni-processor */
81extern struct task_struct *last_task_used_math; 85extern struct task_struct *last_task_used_math;
82extern struct task_struct *last_task_used_altivec; 86extern struct task_struct *last_task_used_altivec;
87extern struct task_struct *last_task_used_vsx;
83extern struct task_struct *last_task_used_spe; 88extern struct task_struct *last_task_used_spe;
84 89
85#ifdef CONFIG_PPC32 90#ifdef CONFIG_PPC32
@@ -142,7 +147,9 @@ typedef struct {
142 unsigned long seg; 147 unsigned long seg;
143} mm_segment_t; 148} mm_segment_t;
144 149
145#define TS_FPR(i) fpr[i] 150#define TS_FPROFFSET 0
151#define TS_VSRLOWOFFSET 1
152#define TS_FPR(i) fpr[i][TS_FPROFFSET]
146 153
147struct thread_struct { 154struct thread_struct {
148 unsigned long ksp; /* Kernel stack pointer */ 155 unsigned long ksp; /* Kernel stack pointer */
@@ -160,8 +167,9 @@ struct thread_struct {
160 unsigned long dbcr0; /* debug control register values */ 167 unsigned long dbcr0; /* debug control register values */
161 unsigned long dbcr1; 168 unsigned long dbcr1;
162#endif 169#endif
163 double fpr[32]; /* Complete floating point set */ 170 /* FP and VSX 0-31 register set */
164 struct { /* fpr ... fpscr must be contiguous */ 171 double fpr[32][TS_FPRWIDTH];
172 struct {
165 173
166 unsigned int pad; 174 unsigned int pad;
167 unsigned int val; /* Floating point status */ 175 unsigned int val; /* Floating point status */
@@ -181,6 +189,10 @@ struct thread_struct {
181 unsigned long vrsave; 189 unsigned long vrsave;
182 int used_vr; /* set if process has used altivec */ 190 int used_vr; /* set if process has used altivec */
183#endif /* CONFIG_ALTIVEC */ 191#endif /* CONFIG_ALTIVEC */
192#ifdef CONFIG_VSX
193 /* VSR status */
194 int used_vsr; /* set if process has used altivec */
195#endif /* CONFIG_VSX */
184#ifdef CONFIG_SPE 196#ifdef CONFIG_SPE
185 unsigned long evr[32]; /* upper 32-bits of SPE regs */ 197 unsigned long evr[32]; /* upper 32-bits of SPE regs */
186 u64 acc; /* Accumulator */ 198 u64 acc; /* Accumulator */