diff --git a/lib/libthread_db/arch/arm/libpthread_md.c b/lib/libthread_db/arch/arm/libpthread_md.c index a72df2e4bb2..a733475dbc2 100644 --- a/lib/libthread_db/arch/arm/libpthread_md.c +++ b/lib/libthread_db/arch/arm/libpthread_md.c @@ -90,7 +90,7 @@ pt_fpreg_to_ucontext(const struct fpreg *r __unused, ucontext_t *uc) mcontext_t *mc = &uc->uc_mcontext; /* XXX */ - memset(&mc->__fpu, 0, sizeof(mc->__fpu)); + memset(&mc->mc_spare, 0, sizeof(mc->mc_spare)); } void diff --git a/sys/arm/arm/vfp.c b/sys/arm/arm/vfp.c index c149aafa78d..5a403a692c0 100644 --- a/sys/arm/arm/vfp.c +++ b/sys/arm/arm/vfp.c @@ -37,7 +37,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include diff --git a/sys/arm/include/fp.h b/sys/arm/include/fp.h deleted file mode 100644 index 8817d84d570..00000000000 --- a/sys/arm/include/fp.h +++ /dev/null @@ -1,89 +0,0 @@ -/* $NetBSD: fp.h,v 1.1 2001/01/10 19:02:06 bjh21 Exp $ */ - -/*- - * Copyright (c) 1995 Mark Brinicombe. - * Copyright (c) 1995 Brini. - * All rights reserved. - * - * This code is derived from software written for Brini by Mark Brinicombe - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Brini. - * 4. The name of the company nor the name of the author may be used to - * endorse or promote products derived from this software without specific - * prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY BRINI ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL BRINI OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * RiscBSD kernel project - * - * fp.h - * - * FP info - * - * Created : 10/10/95 - * - * $FreeBSD$ - */ - -#ifndef _MACHINE_FP_H -#define _MACHINE_FP_H - -/* - * An extended precision floating point number - */ - -typedef struct fp_extended_precision { - u_int32_t fp_exponent; - u_int32_t fp_mantissa_hi; - u_int32_t fp_mantissa_lo; -} fp_extended_precision_t; - -typedef struct fp_extended_precision fp_reg_t; - -/* - * Information about the FPE-SP state that is stored in the pcb - * - * This needs to move and be hidden from userland. - */ - -struct vfp_state { - u_int64_t reg[32]; - u_int32_t fpscr; - u_int32_t fpexec; - u_int32_t fpinst; - u_int32_t fpinst2; -}; - -/* - * Type for a saved FP context, if we want to translate the context to a - * user-readable form - */ - -typedef struct { - u_int32_t fpsr; - fp_extended_precision_t regs[8]; -} fp_state_t; - -#endif /* _MACHINE_FP_H_ */ - -/* End of fp.h */ diff --git a/sys/arm/include/pcb.h b/sys/arm/include/pcb.h index 390758bb24a..886fa43f49c 100644 --- a/sys/arm/include/pcb.h +++ b/sys/arm/include/pcb.h @@ -38,8 +38,8 @@ #ifndef _MACHINE_PCB_H_ #define _MACHINE_PCB_H_ -#include #include +#include /* diff --git a/sys/arm/include/reg.h b/sys/arm/include/reg.h index d4cc4575627..ab70ae128d3 100644 --- a/sys/arm/include/reg.h +++ b/sys/arm/include/reg.h @@ -3,8 +3,6 @@ #ifndef MACHINE_REG_H #define MACHINE_REG_H -#include - struct reg { unsigned int r[13]; unsigned int r_sp; @@ -13,6 +11,14 @@ struct reg { unsigned int r_cpsr; }; +struct fp_extended_precision { + u_int32_t fp_exponent; + u_int32_t fp_mantissa_hi; + u_int32_t fp_mantissa_lo; +}; + +typedef struct fp_extended_precision fp_reg_t; + struct fpreg { unsigned int fpr_fpsr; fp_reg_t fpr[8]; diff --git a/sys/arm/include/ucontext.h b/sys/arm/include/ucontext.h index afcd88ded7a..1409b172f1b 100644 --- a/sys/arm/include/ucontext.h +++ b/sys/arm/include/ucontext.h @@ -63,38 +63,14 @@ typedef __greg_t __gregset_t[_NGREG]; #define _REG_LR _REG_R14 #define _REG_PC _REG_R15 -/* - * Floating point register state - */ -/* Note: the storage layout of this structure must be identical to ARMFPE! */ -typedef struct { - unsigned int __fp_fpsr; - struct { - unsigned int __fp_exponent; - unsigned int __fp_mantissa_hi; - unsigned int __fp_mantissa_lo; - } __fp_fr[8]; -} __fpregset_t; - -typedef struct { - unsigned int __vfp_fpscr; - unsigned int __vfp_fstmx[33]; - unsigned int __vfp_fpsid; -} __vfpregset_t; - typedef struct { __gregset_t __gregs; - union { - __fpregset_t __fpregs; - __vfpregset_t __vfpregs; - } __fpu; + + /* + * Originally, rest of this structure was named __fpu, 35 * 4 bytes + * long, never accessed from kernel. + */ + unsigned int mc_spare[35]; } mcontext_t; -/* Machine-dependent uc_flags */ -#define _UC_ARM_VFP 0x00010000 /* FPU field is VFP */ - -/* used by signal delivery to indicate status of signal stack */ -#define _UC_SETSTACK 0x00020000 -#define _UC_CLRSTACK 0x00040000 - #endif /* !_MACHINE_MCONTEXT_H_ */ diff --git a/sys/arm/include/vfp.h b/sys/arm/include/vfp.h index 2b91043a17d..1c4540e1a4f 100644 --- a/sys/arm/include/vfp.h +++ b/sys/arm/include/vfp.h @@ -133,9 +133,19 @@ #define COPROC11 (0x3 << 22) #ifndef LOCORE +struct vfp_state { + uint64_t reg[32]; + uint32_t fpscr; + uint32_t fpexec; + uint32_t fpinst; + uint32_t fpinst2; +}; + +#ifdef _KERNEL void vfp_init(void); void vfp_store(struct vfp_state *, boolean_t); void vfp_discard(struct thread *); -#endif +#endif /* _KERNEL */ +#endif /* LOCORE */ #endif