]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
sh64: Fix up the build for the thread_xstate changes.
authorPaul Mundt <lethal@linux-sh.org>
Tue, 19 Jan 2010 06:40:03 +0000 (15:40 +0900)
committerPaul Mundt <lethal@linux-sh.org>
Tue, 19 Jan 2010 06:40:03 +0000 (15:40 +0900)
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>
arch/sh/include/asm/processor.h
arch/sh/include/asm/processor_32.h
arch/sh/include/asm/processor_64.h
arch/sh/kernel/cpu/sh5/fpu.c
arch/sh/kernel/process_64.c
arch/sh/kernel/ptrace_64.c
arch/sh/kernel/signal_64.c
arch/sh/kernel/traps_64.c

index a522e5d8f44ffa88d6e99aeee2630b2b0d51a81b..87a8d1ef64e433ea09dc7e0aacaf792ebf6aa1d5 100644 (file)
@@ -98,9 +98,15 @@ extern struct sh_cpuinfo cpu_data[];
 
 /* Forward decl */
 struct seq_operations;
+struct task_struct;
 
 extern struct pt_regs fake_swapper_regs;
 
+/* arch/sh/kernel/process.c */
+extern unsigned int xstate_size;
+extern void free_thread_xstate(struct task_struct *);
+extern struct kmem_cache *task_xstate_cachep;
+
 /* arch/sh/mm/init.c */
 extern unsigned int mem_init_done;
 
index 5fd83125fb89b62e633f6289d33950a27bcb226b..488f0a906a41641eac16d828a1808334a54a68d4 100644 (file)
@@ -96,10 +96,6 @@ union thread_xstate {
        struct sh_fpu_soft_struct softfpu;
 };
 
-extern unsigned int xstate_size;
-extern void free_thread_xstate(struct task_struct *);
-extern struct kmem_cache *task_xstate_cachep;
-
 struct thread_struct {
        /* Saved registers when thread is descheduled */
        unsigned long sp;
index 5727d31b0ccfd89f6e80c5f610b36bd5f48c0dc5..7b1560f03d14b062aa927c6e36d40391e50a846c 100644 (file)
@@ -87,20 +87,21 @@ struct sh_fpu_hard_struct {
        /* long status; * software status information */
 };
 
-#if 0
 /* Dummy fpu emulator  */
 struct sh_fpu_soft_struct {
-       unsigned long long fp_regs[32];
+       unsigned long fp_regs[64];
        unsigned int fpscr;
        unsigned char lookahead;
        unsigned long entry_pc;
 };
-#endif
 
-union sh_fpu_union {
-       struct sh_fpu_hard_struct hard;
-       /* 'hard' itself only produces 32 bit alignment, yet we need
-          to access it using 64 bit load/store as well. */
+union thread_xstate {
+       struct sh_fpu_hard_struct hardfpu;
+       struct sh_fpu_soft_struct softfpu;
+       /*
+        * The structure definitions only produce 32 bit alignment, yet we need
+        * to access them using 64 bit load/store as well.
+        */
        unsigned long long alignment_dummy;
 };
 
@@ -122,7 +123,7 @@ struct thread_struct {
        /* Hardware debugging registers may come here */
 
        /* floating point info */
-       union sh_fpu_union fpu;
+       union thread_xstate *xstate;
 };
 
 #define INIT_MMAP \
@@ -137,7 +138,6 @@ struct thread_struct {
        .trap_no        = 0,                    \
        .error_code     = 0,                    \
        .address        = 0,                    \
-       .fpu            = { { { 0, } }, }       \
 }
 
 /*
index 4648ccee6c4d2b5ebdf20fb58db5387022ebc2cc..92df285fbe4bad27dec63a09d9a33296afb9aad8 100644 (file)
@@ -27,8 +27,8 @@
 #define sNAN64         0xFFFFFFFFFFFFFFFFULL
 #define sNAN32         0xFFFFFFFFUL
 
-static union sh_fpu_union init_fpuregs = {
-       .hard = {
+static union thread_xstate init_fpuregs = {
+       .hardfpu = {
                .fp_regs = { [0 ... 63] = sNAN32 },
                .fpscr = FPSCR_INIT
        }
@@ -72,7 +72,7 @@ void save_fpu(struct task_struct *tsk)
                     "fgetscr   fr63\n\t"
                     "fst.s     %0, (32*8), fr63\n\t"
                : /* no output */
-               : "r" (&tsk->thread.fpu.hard)
+               : "r" (&tsk->thread.xstate->hardfpu)
                : "memory");
 }
 
@@ -121,7 +121,7 @@ fpload(struct sh_fpu_hard_struct *fpregs)
 
 void fpinit(struct sh_fpu_hard_struct *fpregs)
 {
-       *fpregs = init_fpuregs.hard;
+       *fpregs = init_fpuregs.hardfpu;
 }
 
 asmlinkage void
@@ -157,10 +157,10 @@ do_fpu_state_restore(unsigned long ex, struct pt_regs *regs)
 
         last_task_used_math = current;
         if (used_math()) {
-                fpload(&current->thread.fpu.hard);
+                fpload(&current->thread.xstate->hardfpu);
         } else {
                /* First time FPU user.  */
-               fpload(&init_fpuregs.hard);
+               fpload(&init_fpuregs.hardfpu);
                 set_used_math();
         }
        disable_fpu();
index 31f80c61b031ad5ada25630e17c71a543c9fc59a..c9554a70bd0e6305496d44b2bf132f3d226dbcc7 100644 (file)
@@ -410,7 +410,7 @@ int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu)
                        regs->sr |= SR_FD;
                }
 
-               memcpy(fpu, &tsk->thread.fpu.hard, sizeof(*fpu));
+               memcpy(fpu, &tsk->thread.xstate->hardfpu, sizeof(*fpu));
        }
 
        return fpvalid;
index 873ebdc4f98efcaed37132f524f78d35fb7c9d3a..67fbcee89e7e49a96de9de2a70a6ca3687878ac2 100644 (file)
@@ -88,7 +88,7 @@ get_fpu_long(struct task_struct *task, unsigned long addr)
                regs->sr |= SR_FD;
        }
 
-       tmp = ((long *)&task->thread.fpu)[addr / sizeof(unsigned long)];
+       tmp = ((long *)task->thread.xstate)[addr / sizeof(unsigned long)];
        return tmp;
 }
 
@@ -114,7 +114,7 @@ put_fpu_long(struct task_struct *task, unsigned long addr, unsigned long data)
        regs = (struct pt_regs*)((unsigned char *)task + THREAD_SIZE) - 1;
 
        if (!tsk_used_math(task)) {
-               fpinit(&task->thread.fpu.hard);
+               fpinit(&task->thread.xstate->hardfpu);
                set_stopped_child_used_math(task);
        } else if (last_task_used_math == task) {
                enable_fpu();
@@ -124,7 +124,7 @@ put_fpu_long(struct task_struct *task, unsigned long addr, unsigned long data)
                regs->sr |= SR_FD;
        }
 
-       ((long *)&task->thread.fpu)[addr / sizeof(unsigned long)] = data;
+       ((long *)task->thread.xstate)[addr / sizeof(unsigned long)] = data;
        return 0;
 }
 
@@ -222,7 +222,7 @@ int fpregs_get(struct task_struct *target,
                return ret;
 
        return user_regset_copyout(&pos, &count, &kbuf, &ubuf,
-                                  &target->thread.fpu.hard, 0, -1);
+                                  &target->thread.xstate->hardfpu, 0, -1);
 }
 
 static int fpregs_set(struct task_struct *target,
@@ -239,7 +239,7 @@ static int fpregs_set(struct task_struct *target,
        set_stopped_child_used_math(target);
 
        return user_regset_copyin(&pos, &count, &kbuf, &ubuf,
-                                 &target->thread.fpu.hard, 0, -1);
+                                 &target->thread.xstate->hardfpu, 0, -1);
 }
 
 static int fpregs_active(struct task_struct *target,
index ce76dbdef2940fa8e920dcbc8f4bc265a0607b5f..4733bfc59d39b3af20c726a84300802530df69bd 100644 (file)
@@ -295,7 +295,7 @@ restore_sigcontext_fpu(struct pt_regs *regs, struct sigcontext __user *sc)
                regs->sr |= SR_FD;
        }
 
-       err |= __copy_from_user(&current->thread.fpu.hard, &sc->sc_fpregs[0],
+       err |= __copy_from_user(&current->thread.xstate->hardfpu, &sc->sc_fpregs[0],
                                (sizeof(long long) * 32) + (sizeof(int) * 1));
 
        return err;
@@ -320,7 +320,7 @@ setup_sigcontext_fpu(struct pt_regs *regs, struct sigcontext __user *sc)
                regs->sr |= SR_FD;
        }
 
-       err |= __copy_to_user(&sc->sc_fpregs[0], &current->thread.fpu.hard,
+       err |= __copy_to_user(&sc->sc_fpregs[0], &current->thread.xstate->hardfpu,
                              (sizeof(long long) * 32) + (sizeof(int) * 1));
        clear_used_math();
 
index d86f5315a0c1422c54b888153a70927c32e5a6ca..e3f92eb05ffdb684d5392121c2cdcf0096573988 100644 (file)
@@ -611,19 +611,19 @@ static int misaligned_fpu_load(struct pt_regs *regs,
 
                switch (width_shift) {
                case 2:
-                       current->thread.fpu.hard.fp_regs[destreg] = buflo;
+                       current->thread.xstate->hardfpu.fp_regs[destreg] = buflo;
                        break;
                case 3:
                        if (do_paired_load) {
-                               current->thread.fpu.hard.fp_regs[destreg] = buflo;
-                               current->thread.fpu.hard.fp_regs[destreg+1] = bufhi;
+                               current->thread.xstate->hardfpu.fp_regs[destreg] = buflo;
+                               current->thread.xstate->hardfpu.fp_regs[destreg+1] = bufhi;
                        } else {
 #if defined(CONFIG_CPU_LITTLE_ENDIAN)
-                               current->thread.fpu.hard.fp_regs[destreg] = bufhi;
-                               current->thread.fpu.hard.fp_regs[destreg+1] = buflo;
+                               current->thread.xstate->hardfpu.fp_regs[destreg] = bufhi;
+                               current->thread.xstate->hardfpu.fp_regs[destreg+1] = buflo;
 #else
-                               current->thread.fpu.hard.fp_regs[destreg] = buflo;
-                               current->thread.fpu.hard.fp_regs[destreg+1] = bufhi;
+                               current->thread.xstate->hardfpu.fp_regs[destreg] = buflo;
+                               current->thread.xstate->hardfpu.fp_regs[destreg+1] = bufhi;
 #endif
                        }
                        break;
@@ -681,19 +681,19 @@ static int misaligned_fpu_store(struct pt_regs *regs,
 
                switch (width_shift) {
                case 2:
-                       buflo = current->thread.fpu.hard.fp_regs[srcreg];
+                       buflo = current->thread.xstate->hardfpu.fp_regs[srcreg];
                        break;
                case 3:
                        if (do_paired_load) {
-                               buflo = current->thread.fpu.hard.fp_regs[srcreg];
-                               bufhi = current->thread.fpu.hard.fp_regs[srcreg+1];
+                               buflo = current->thread.xstate->hardfpu.fp_regs[srcreg];
+                               bufhi = current->thread.xstate->hardfpu.fp_regs[srcreg+1];
                        } else {
 #if defined(CONFIG_CPU_LITTLE_ENDIAN)
-                               bufhi = current->thread.fpu.hard.fp_regs[srcreg];
-                               buflo = current->thread.fpu.hard.fp_regs[srcreg+1];
+                               bufhi = current->thread.xstate->hardfpu.fp_regs[srcreg];
+                               buflo = current->thread.xstate->hardfpu.fp_regs[srcreg+1];
 #else
-                               buflo = current->thread.fpu.hard.fp_regs[srcreg];
-                               bufhi = current->thread.fpu.hard.fp_regs[srcreg+1];
+                               buflo = current->thread.xstate->hardfpu.fp_regs[srcreg];
+                               bufhi = current->thread.xstate->hardfpu.fp_regs[srcreg+1];
 #endif
                        }
                        break;