aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2010-01-19 01:40:03 -0500
committerPaul Mundt <lethal@linux-sh.org>2010-01-19 01:40:03 -0500
commit3ef2932b8c1fc89408ef1fd4b1e1c2caabc7f07d (patch)
tree0b12eea51d98e1edd1ef891ed7fe0a7feec4341c /arch
parentcb6d04468d16de5a6161167ec7e76a43be540a80 (diff)
sh64: Fix up the build for the thread_xstate changes.
This updates the sh64 processor info with the sh32 changes in order to tie in to the generic task_xstate management code. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/sh/include/asm/processor.h6
-rw-r--r--arch/sh/include/asm/processor_32.h4
-rw-r--r--arch/sh/include/asm/processor_64.h18
-rw-r--r--arch/sh/kernel/cpu/sh5/fpu.c12
-rw-r--r--arch/sh/kernel/process_64.c2
-rw-r--r--arch/sh/kernel/ptrace_64.c10
-rw-r--r--arch/sh/kernel/signal_64.c4
-rw-r--r--arch/sh/kernel/traps_64.c28
8 files changed, 43 insertions, 41 deletions
diff --git a/arch/sh/include/asm/processor.h b/arch/sh/include/asm/processor.h
index a522e5d8f44f..87a8d1ef64e4 100644
--- a/arch/sh/include/asm/processor.h
+++ b/arch/sh/include/asm/processor.h
@@ -98,9 +98,15 @@ extern struct sh_cpuinfo cpu_data[];
98 98
99/* Forward decl */ 99/* Forward decl */
100struct seq_operations; 100struct seq_operations;
101struct task_struct;
101 102
102extern struct pt_regs fake_swapper_regs; 103extern struct pt_regs fake_swapper_regs;
103 104
105/* arch/sh/kernel/process.c */
106extern unsigned int xstate_size;
107extern void free_thread_xstate(struct task_struct *);
108extern struct kmem_cache *task_xstate_cachep;
109
104/* arch/sh/mm/init.c */ 110/* arch/sh/mm/init.c */
105extern unsigned int mem_init_done; 111extern unsigned int mem_init_done;
106 112
diff --git a/arch/sh/include/asm/processor_32.h b/arch/sh/include/asm/processor_32.h
index 5fd83125fb89..488f0a906a41 100644
--- a/arch/sh/include/asm/processor_32.h
+++ b/arch/sh/include/asm/processor_32.h
@@ -96,10 +96,6 @@ union thread_xstate {
96 struct sh_fpu_soft_struct softfpu; 96 struct sh_fpu_soft_struct softfpu;
97}; 97};
98 98
99extern unsigned int xstate_size;
100extern void free_thread_xstate(struct task_struct *);
101extern struct kmem_cache *task_xstate_cachep;
102
103struct thread_struct { 99struct thread_struct {
104 /* Saved registers when thread is descheduled */ 100 /* Saved registers when thread is descheduled */
105 unsigned long sp; 101 unsigned long sp;
diff --git a/arch/sh/include/asm/processor_64.h b/arch/sh/include/asm/processor_64.h
index 5727d31b0ccf..7b1560f03d14 100644
--- a/arch/sh/include/asm/processor_64.h
+++ b/arch/sh/include/asm/processor_64.h
@@ -87,20 +87,21 @@ struct sh_fpu_hard_struct {
87 /* long status; * software status information */ 87 /* long status; * software status information */
88}; 88};
89 89
90#if 0
91/* Dummy fpu emulator */ 90/* Dummy fpu emulator */
92struct sh_fpu_soft_struct { 91struct sh_fpu_soft_struct {
93 unsigned long long fp_regs[32]; 92 unsigned long fp_regs[64];
94 unsigned int fpscr; 93 unsigned int fpscr;
95 unsigned char lookahead; 94 unsigned char lookahead;
96 unsigned long entry_pc; 95 unsigned long entry_pc;
97}; 96};
98#endif
99 97
100union sh_fpu_union { 98union thread_xstate {
101 struct sh_fpu_hard_struct hard; 99 struct sh_fpu_hard_struct hardfpu;
102 /* 'hard' itself only produces 32 bit alignment, yet we need 100 struct sh_fpu_soft_struct softfpu;
103 to access it using 64 bit load/store as well. */ 101 /*
102 * The structure definitions only produce 32 bit alignment, yet we need
103 * to access them using 64 bit load/store as well.
104 */
104 unsigned long long alignment_dummy; 105 unsigned long long alignment_dummy;
105}; 106};
106 107
@@ -122,7 +123,7 @@ struct thread_struct {
122 /* Hardware debugging registers may come here */ 123 /* Hardware debugging registers may come here */
123 124
124 /* floating point info */ 125 /* floating point info */
125 union sh_fpu_union fpu; 126 union thread_xstate *xstate;
126}; 127};
127 128
128#define INIT_MMAP \ 129#define INIT_MMAP \
@@ -137,7 +138,6 @@ struct thread_struct {
137 .trap_no = 0, \ 138 .trap_no = 0, \
138 .error_code = 0, \ 139 .error_code = 0, \
139 .address = 0, \ 140 .address = 0, \
140 .fpu = { { { 0, } }, } \
141} 141}
142 142
143/* 143/*
diff --git a/arch/sh/kernel/cpu/sh5/fpu.c b/arch/sh/kernel/cpu/sh5/fpu.c
index 4648ccee6c4d..92df285fbe4b 100644
--- a/arch/sh/kernel/cpu/sh5/fpu.c
+++ b/arch/sh/kernel/cpu/sh5/fpu.c
@@ -27,8 +27,8 @@
27#define sNAN64 0xFFFFFFFFFFFFFFFFULL 27#define sNAN64 0xFFFFFFFFFFFFFFFFULL
28#define sNAN32 0xFFFFFFFFUL 28#define sNAN32 0xFFFFFFFFUL
29 29
30static union sh_fpu_union init_fpuregs = { 30static union thread_xstate init_fpuregs = {
31 .hard = { 31 .hardfpu = {
32 .fp_regs = { [0 ... 63] = sNAN32 }, 32 .fp_regs = { [0 ... 63] = sNAN32 },
33 .fpscr = FPSCR_INIT 33 .fpscr = FPSCR_INIT
34 } 34 }
@@ -72,7 +72,7 @@ void save_fpu(struct task_struct *tsk)
72 "fgetscr fr63\n\t" 72 "fgetscr fr63\n\t"
73 "fst.s %0, (32*8), fr63\n\t" 73 "fst.s %0, (32*8), fr63\n\t"
74 : /* no output */ 74 : /* no output */
75 : "r" (&tsk->thread.fpu.hard) 75 : "r" (&tsk->thread.xstate->hardfpu)
76 : "memory"); 76 : "memory");
77} 77}
78 78
@@ -121,7 +121,7 @@ fpload(struct sh_fpu_hard_struct *fpregs)
121 121
122void fpinit(struct sh_fpu_hard_struct *fpregs) 122void fpinit(struct sh_fpu_hard_struct *fpregs)
123{ 123{
124 *fpregs = init_fpuregs.hard; 124 *fpregs = init_fpuregs.hardfpu;
125} 125}
126 126
127asmlinkage void 127asmlinkage void
@@ -157,10 +157,10 @@ do_fpu_state_restore(unsigned long ex, struct pt_regs *regs)
157 157
158 last_task_used_math = current; 158 last_task_used_math = current;
159 if (used_math()) { 159 if (used_math()) {
160 fpload(&current->thread.fpu.hard); 160 fpload(&current->thread.xstate->hardfpu);
161 } else { 161 } else {
162 /* First time FPU user. */ 162 /* First time FPU user. */
163 fpload(&init_fpuregs.hard); 163 fpload(&init_fpuregs.hardfpu);
164 set_used_math(); 164 set_used_math();
165 } 165 }
166 disable_fpu(); 166 disable_fpu();
diff --git a/arch/sh/kernel/process_64.c b/arch/sh/kernel/process_64.c
index 31f80c61b031..c9554a70bd0e 100644
--- a/arch/sh/kernel/process_64.c
+++ b/arch/sh/kernel/process_64.c
@@ -410,7 +410,7 @@ int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu)
410 regs->sr |= SR_FD; 410 regs->sr |= SR_FD;
411 } 411 }
412 412
413 memcpy(fpu, &tsk->thread.fpu.hard, sizeof(*fpu)); 413 memcpy(fpu, &tsk->thread.xstate->hardfpu, sizeof(*fpu));
414 } 414 }
415 415
416 return fpvalid; 416 return fpvalid;
diff --git a/arch/sh/kernel/ptrace_64.c b/arch/sh/kernel/ptrace_64.c
index 873ebdc4f98e..67fbcee89e7e 100644
--- a/arch/sh/kernel/ptrace_64.c
+++ b/arch/sh/kernel/ptrace_64.c
@@ -88,7 +88,7 @@ get_fpu_long(struct task_struct *task, unsigned long addr)
88 regs->sr |= SR_FD; 88 regs->sr |= SR_FD;
89 } 89 }
90 90
91 tmp = ((long *)&task->thread.fpu)[addr / sizeof(unsigned long)]; 91 tmp = ((long *)task->thread.xstate)[addr / sizeof(unsigned long)];
92 return tmp; 92 return tmp;
93} 93}
94 94
@@ -114,7 +114,7 @@ put_fpu_long(struct task_struct *task, unsigned long addr, unsigned long data)
114 regs = (struct pt_regs*)((unsigned char *)task + THREAD_SIZE) - 1; 114 regs = (struct pt_regs*)((unsigned char *)task + THREAD_SIZE) - 1;
115 115
116 if (!tsk_used_math(task)) { 116 if (!tsk_used_math(task)) {
117 fpinit(&task->thread.fpu.hard); 117 fpinit(&task->thread.xstate->hardfpu);
118 set_stopped_child_used_math(task); 118 set_stopped_child_used_math(task);
119 } else if (last_task_used_math == task) { 119 } else if (last_task_used_math == task) {
120 enable_fpu(); 120 enable_fpu();
@@ -124,7 +124,7 @@ put_fpu_long(struct task_struct *task, unsigned long addr, unsigned long data)
124 regs->sr |= SR_FD; 124 regs->sr |= SR_FD;
125 } 125 }
126 126
127 ((long *)&task->thread.fpu)[addr / sizeof(unsigned long)] = data; 127 ((long *)task->thread.xstate)[addr / sizeof(unsigned long)] = data;
128 return 0; 128 return 0;
129} 129}
130 130
@@ -222,7 +222,7 @@ int fpregs_get(struct task_struct *target,
222 return ret; 222 return ret;
223 223
224 return user_regset_copyout(&pos, &count, &kbuf, &ubuf, 224 return user_regset_copyout(&pos, &count, &kbuf, &ubuf,
225 &target->thread.fpu.hard, 0, -1); 225 &target->thread.xstate->hardfpu, 0, -1);
226} 226}
227 227
228static int fpregs_set(struct task_struct *target, 228static int fpregs_set(struct task_struct *target,
@@ -239,7 +239,7 @@ static int fpregs_set(struct task_struct *target,
239 set_stopped_child_used_math(target); 239 set_stopped_child_used_math(target);
240 240
241 return user_regset_copyin(&pos, &count, &kbuf, &ubuf, 241 return user_regset_copyin(&pos, &count, &kbuf, &ubuf,
242 &target->thread.fpu.hard, 0, -1); 242 &target->thread.xstate->hardfpu, 0, -1);
243} 243}
244 244
245static int fpregs_active(struct task_struct *target, 245static int fpregs_active(struct task_struct *target,
diff --git a/arch/sh/kernel/signal_64.c b/arch/sh/kernel/signal_64.c
index ce76dbdef294..4733bfc59d39 100644
--- a/arch/sh/kernel/signal_64.c
+++ b/arch/sh/kernel/signal_64.c
@@ -295,7 +295,7 @@ restore_sigcontext_fpu(struct pt_regs *regs, struct sigcontext __user *sc)
295 regs->sr |= SR_FD; 295 regs->sr |= SR_FD;
296 } 296 }
297 297
298 err |= __copy_from_user(&current->thread.fpu.hard, &sc->sc_fpregs[0], 298 err |= __copy_from_user(&current->thread.xstate->hardfpu, &sc->sc_fpregs[0],
299 (sizeof(long long) * 32) + (sizeof(int) * 1)); 299 (sizeof(long long) * 32) + (sizeof(int) * 1));
300 300
301 return err; 301 return err;
@@ -320,7 +320,7 @@ setup_sigcontext_fpu(struct pt_regs *regs, struct sigcontext __user *sc)
320 regs->sr |= SR_FD; 320 regs->sr |= SR_FD;
321 } 321 }
322 322
323 err |= __copy_to_user(&sc->sc_fpregs[0], &current->thread.fpu.hard, 323 err |= __copy_to_user(&sc->sc_fpregs[0], &current->thread.xstate->hardfpu,
324 (sizeof(long long) * 32) + (sizeof(int) * 1)); 324 (sizeof(long long) * 32) + (sizeof(int) * 1));
325 clear_used_math(); 325 clear_used_math();
326 326
diff --git a/arch/sh/kernel/traps_64.c b/arch/sh/kernel/traps_64.c
index d86f5315a0c1..e3f92eb05ffd 100644
--- a/arch/sh/kernel/traps_64.c
+++ b/arch/sh/kernel/traps_64.c
@@ -611,19 +611,19 @@ static int misaligned_fpu_load(struct pt_regs *regs,
611 611
612 switch (width_shift) { 612 switch (width_shift) {
613 case 2: 613 case 2:
614 current->thread.fpu.hard.fp_regs[destreg] = buflo; 614 current->thread.xstate->hardfpu.fp_regs[destreg] = buflo;
615 break; 615 break;
616 case 3: 616 case 3:
617 if (do_paired_load) { 617 if (do_paired_load) {
618 current->thread.fpu.hard.fp_regs[destreg] = buflo; 618 current->thread.xstate->hardfpu.fp_regs[destreg] = buflo;
619 current->thread.fpu.hard.fp_regs[destreg+1] = bufhi; 619 current->thread.xstate->hardfpu.fp_regs[destreg+1] = bufhi;
620 } else { 620 } else {
621#if defined(CONFIG_CPU_LITTLE_ENDIAN) 621#if defined(CONFIG_CPU_LITTLE_ENDIAN)
622 current->thread.fpu.hard.fp_regs[destreg] = bufhi; 622 current->thread.xstate->hardfpu.fp_regs[destreg] = bufhi;
623 current->thread.fpu.hard.fp_regs[destreg+1] = buflo; 623 current->thread.xstate->hardfpu.fp_regs[destreg+1] = buflo;
624#else 624#else
625 current->thread.fpu.hard.fp_regs[destreg] = buflo; 625 current->thread.xstate->hardfpu.fp_regs[destreg] = buflo;
626 current->thread.fpu.hard.fp_regs[destreg+1] = bufhi; 626 current->thread.xstate->hardfpu.fp_regs[destreg+1] = bufhi;
627#endif 627#endif
628 } 628 }
629 break; 629 break;
@@ -681,19 +681,19 @@ static int misaligned_fpu_store(struct pt_regs *regs,
681 681
682 switch (width_shift) { 682 switch (width_shift) {
683 case 2: 683 case 2:
684 buflo = current->thread.fpu.hard.fp_regs[srcreg]; 684 buflo = current->thread.xstate->hardfpu.fp_regs[srcreg];
685 break; 685 break;
686 case 3: 686 case 3:
687 if (do_paired_load) { 687 if (do_paired_load) {
688 buflo = current->thread.fpu.hard.fp_regs[srcreg]; 688 buflo = current->thread.xstate->hardfpu.fp_regs[srcreg];
689 bufhi = current->thread.fpu.hard.fp_regs[srcreg+1]; 689 bufhi = current->thread.xstate->hardfpu.fp_regs[srcreg+1];
690 } else { 690 } else {
691#if defined(CONFIG_CPU_LITTLE_ENDIAN) 691#if defined(CONFIG_CPU_LITTLE_ENDIAN)
692 bufhi = current->thread.fpu.hard.fp_regs[srcreg]; 692 bufhi = current->thread.xstate->hardfpu.fp_regs[srcreg];
693 buflo = current->thread.fpu.hard.fp_regs[srcreg+1]; 693 buflo = current->thread.xstate->hardfpu.fp_regs[srcreg+1];
694#else 694#else
695 buflo = current->thread.fpu.hard.fp_regs[srcreg]; 695 buflo = current->thread.xstate->hardfpu.fp_regs[srcreg];
696 bufhi = current->thread.fpu.hard.fp_regs[srcreg+1]; 696 bufhi = current->thread.xstate->hardfpu.fp_regs[srcreg+1];
697#endif 697#endif
698 } 698 }
699 break; 699 break;