Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Mar 2017 11:46:49 +0000 (UTC)
From:      Michal Meloun <mmel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r315900 - in head: lib/libthread_db/arch/arm sys/arm/arm sys/arm/include
Message-ID:  <201703241146.v2OBknuh071271@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mmel
Date: Fri Mar 24 11:46:49 2017
New Revision: 315900
URL: https://svnweb.freebsd.org/changeset/base/315900

Log:
  Cleanup structures related to VFP and/or mcontext_t.
  - in mcontext_t, rename newer used 'union __vfp' to equaly sized 'mc_spare'.
    Space allocated by 'union __vfp' is too small and cannot hold full
    VFP context.
  - move structures defined in fp.h to more appropriate headers.
  - remove all unused VFP structures.
  
  MFC after:	2 weeks

Deleted:
  head/sys/arm/include/fp.h
Modified:
  head/lib/libthread_db/arch/arm/libpthread_md.c
  head/sys/arm/arm/vfp.c
  head/sys/arm/include/pcb.h
  head/sys/arm/include/reg.h
  head/sys/arm/include/ucontext.h
  head/sys/arm/include/vfp.h

Modified: head/lib/libthread_db/arch/arm/libpthread_md.c
==============================================================================
--- head/lib/libthread_db/arch/arm/libpthread_md.c	Fri Mar 24 10:27:05 2017	(r315899)
+++ head/lib/libthread_db/arch/arm/libpthread_md.c	Fri Mar 24 11:46:49 2017	(r315900)
@@ -90,7 +90,7 @@ pt_fpreg_to_ucontext(const struct fpreg 
 	mcontext_t *mc = &uc->uc_mcontext;
 
 	/* XXX */
-	memset(&mc->__fpu, 0, sizeof(mc->__fpu));
+	memset(&mc->mc_spare, 0, sizeof(mc->mc_spare));
 }
 
 void

Modified: head/sys/arm/arm/vfp.c
==============================================================================
--- head/sys/arm/arm/vfp.c	Fri Mar 24 10:27:05 2017	(r315899)
+++ head/sys/arm/arm/vfp.c	Fri Mar 24 11:46:49 2017	(r315900)
@@ -37,7 +37,6 @@ __FBSDID("$FreeBSD$");
 
 #include <machine/armreg.h>
 #include <machine/frame.h>
-#include <machine/fp.h>
 #include <machine/md_var.h>
 #include <machine/pcb.h>
 #include <machine/undefined.h>

Modified: head/sys/arm/include/pcb.h
==============================================================================
--- head/sys/arm/include/pcb.h	Fri Mar 24 10:27:05 2017	(r315899)
+++ head/sys/arm/include/pcb.h	Fri Mar 24 11:46:49 2017	(r315900)
@@ -38,8 +38,8 @@
 #ifndef	_MACHINE_PCB_H_
 #define	_MACHINE_PCB_H_
 
-#include <machine/fp.h>
 #include <machine/frame.h>
+#include <machine/vfp.h>
 
 
 /*

Modified: head/sys/arm/include/reg.h
==============================================================================
--- head/sys/arm/include/reg.h	Fri Mar 24 10:27:05 2017	(r315899)
+++ head/sys/arm/include/reg.h	Fri Mar 24 11:46:49 2017	(r315900)
@@ -3,8 +3,6 @@
 #ifndef MACHINE_REG_H
 #define MACHINE_REG_H
 
-#include <machine/fp.h>
-
 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];

Modified: head/sys/arm/include/ucontext.h
==============================================================================
--- head/sys/arm/include/ucontext.h	Fri Mar 24 10:27:05 2017	(r315899)
+++ head/sys/arm/include/ucontext.h	Fri Mar 24 11:46:49 2017	(r315900)
@@ -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;
-} 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
+	/*
+	 * Originally, rest of this structure was named __fpu, 35 * 4 bytes
+	 * long, never accessed from kernel. 
+	 */
+	unsigned int	mc_spare[35];
+} mcontext_t;
 
 #endif	/* !_MACHINE_MCONTEXT_H_ */

Modified: head/sys/arm/include/vfp.h
==============================================================================
--- head/sys/arm/include/vfp.h	Fri Mar 24 10:27:05 2017	(r315899)
+++ head/sys/arm/include/vfp.h	Fri Mar 24 11:46:49 2017	(r315900)
@@ -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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201703241146.v2OBknuh071271>