aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-powerpc/processor.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-powerpc/processor.h')
-rw-r--r--include/asm-powerpc/processor.h28
1 files changed, 25 insertions, 3 deletions
diff --git a/include/asm-powerpc/processor.h b/include/asm-powerpc/processor.h
index cf83f2d7e2a5..101ed87f7d84 100644
--- a/include/asm-powerpc/processor.h
+++ b/include/asm-powerpc/processor.h
@@ -12,6 +12,12 @@
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
18#define TS_FPRWIDTH 1
19#endif
20
15#ifndef __ASSEMBLY__ 21#ifndef __ASSEMBLY__
16#include <linux/compiler.h> 22#include <linux/compiler.h>
17#include <asm/ptrace.h> 23#include <asm/ptrace.h>
@@ -78,9 +84,14 @@ extern long kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);
78/* Lazy FPU handling on uni-processor */ 84/* Lazy FPU handling on uni-processor */
79extern struct task_struct *last_task_used_math; 85extern struct task_struct *last_task_used_math;
80extern struct task_struct *last_task_used_altivec; 86extern struct task_struct *last_task_used_altivec;
87extern struct task_struct *last_task_used_vsx;
81extern struct task_struct *last_task_used_spe; 88extern struct task_struct *last_task_used_spe;
82 89
83#ifdef CONFIG_PPC32 90#ifdef CONFIG_PPC32
91
92#if CONFIG_TASK_SIZE > CONFIG_KERNEL_START
93#error User TASK_SIZE overlaps with KERNEL_START address
94#endif
84#define TASK_SIZE (CONFIG_TASK_SIZE) 95#define TASK_SIZE (CONFIG_TASK_SIZE)
85 96
86/* This decides where the kernel will search for a free chunk of vm 97/* This decides where the kernel will search for a free chunk of vm
@@ -136,6 +147,10 @@ typedef struct {
136 unsigned long seg; 147 unsigned long seg;
137} mm_segment_t; 148} mm_segment_t;
138 149
150#define TS_FPROFFSET 0
151#define TS_VSRLOWOFFSET 1
152#define TS_FPR(i) fpr[i][TS_FPROFFSET]
153
139struct thread_struct { 154struct thread_struct {
140 unsigned long ksp; /* Kernel stack pointer */ 155 unsigned long ksp; /* Kernel stack pointer */
141 unsigned long ksp_limit; /* if ksp <= ksp_limit stack overflow */ 156 unsigned long ksp_limit; /* if ksp <= ksp_limit stack overflow */
@@ -152,8 +167,9 @@ struct thread_struct {
152 unsigned long dbcr0; /* debug control register values */ 167 unsigned long dbcr0; /* debug control register values */
153 unsigned long dbcr1; 168 unsigned long dbcr1;
154#endif 169#endif
155 double fpr[32]; /* Complete floating point set */ 170 /* FP and VSX 0-31 register set */
156 struct { /* fpr ... fpscr must be contiguous */ 171 double fpr[32][TS_FPRWIDTH];
172 struct {
157 173
158 unsigned int pad; 174 unsigned int pad;
159 unsigned int val; /* Floating point status */ 175 unsigned int val; /* Floating point status */
@@ -173,6 +189,10 @@ struct thread_struct {
173 unsigned long vrsave; 189 unsigned long vrsave;
174 int used_vr; /* set if process has used altivec */ 190 int used_vr; /* set if process has used altivec */
175#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 */
176#ifdef CONFIG_SPE 196#ifdef CONFIG_SPE
177 unsigned long evr[32]; /* upper 32-bits of SPE regs */ 197 unsigned long evr[32]; /* upper 32-bits of SPE regs */
178 u64 acc; /* Accumulator */ 198 u64 acc; /* Accumulator */
@@ -202,7 +222,7 @@ struct thread_struct {
202 .ksp_limit = INIT_SP_LIMIT, \ 222 .ksp_limit = INIT_SP_LIMIT, \
203 .regs = (struct pt_regs *)INIT_SP - 1, /* XXX bogus, I think */ \ 223 .regs = (struct pt_regs *)INIT_SP - 1, /* XXX bogus, I think */ \
204 .fs = KERNEL_DS, \ 224 .fs = KERNEL_DS, \
205 .fpr = {0}, \ 225 .fpr = {{0}}, \
206 .fpscr = { .val = 0, }, \ 226 .fpscr = { .val = 0, }, \
207 .fpexc_mode = 0, \ 227 .fpexc_mode = 0, \
208} 228}
@@ -214,6 +234,8 @@ struct thread_struct {
214#define thread_saved_pc(tsk) \ 234#define thread_saved_pc(tsk) \
215 ((tsk)->thread.regs? (tsk)->thread.regs->nip: 0) 235 ((tsk)->thread.regs? (tsk)->thread.regs->nip: 0)
216 236
237#define task_pt_regs(tsk) ((struct pt_regs *)(tsk)->thread.regs)
238
217unsigned long get_wchan(struct task_struct *p); 239unsigned long get_wchan(struct task_struct *p);
218 240
219#define KSTK_EIP(tsk) ((tsk)->thread.regs? (tsk)->thread.regs->nip: 0) 241#define KSTK_EIP(tsk) ((tsk)->thread.regs? (tsk)->thread.regs->nip: 0)