git: df7549775c4e - main - Replace the arm64 initial_fpcr with a macro

Andrew Turner andrew at FreeBSD.org
Tue Mar 23 17:38:59 UTC 2021


The branch main has been updated by andrew:

URL: https://cgit.FreeBSD.org/src/commit/?id=df7549775c4e36d8ac0ed6cce2525203beb2b32c

commit df7549775c4e36d8ac0ed6cce2525203beb2b32c
Author:     Andrew Turner <andrew at FreeBSD.org>
AuthorDate: 2021-03-23 15:28:20 +0000
Commit:     Andrew Turner <andrew at FreeBSD.org>
CommitDate: 2021-03-23 17:12:43 +0000

    Replace the arm64 initial_fpcr with a macro
    
    This value was never changed from its default value. Replace it with a
    macro.
    
    Sponsored by:   Innovate UK
---
 sys/arm64/arm64/vfp.c        | 4 ++--
 sys/arm64/arm64/vm_machdep.c | 2 --
 sys/arm64/include/md_var.h   | 2 --
 sys/arm64/include/vfp.h      | 1 +
 4 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/sys/arm64/arm64/vfp.c b/sys/arm64/arm64/vfp.c
index 5fa420e668c1..4935946d2430 100644
--- a/sys/arm64/arm64/vfp.c
+++ b/sys/arm64/arm64/vfp.c
@@ -212,7 +212,7 @@ vfp_reset_state(struct thread *td, struct pcb *pcb)
 	bzero(&pcb->pcb_fpustate.vfp_regs, sizeof(pcb->pcb_fpustate.vfp_regs));
 	KASSERT(pcb->pcb_fpusaved == &pcb->pcb_fpustate,
 	    ("pcb_fpusaved should point to pcb_fpustate."));
-	pcb->pcb_fpustate.vfp_fpcr = initial_fpcr;
+	pcb->pcb_fpustate.vfp_fpcr = VFPCR_INIT;
 	pcb->pcb_fpustate.vfp_fpsr = 0;
 	pcb->pcb_vfpcpu = UINT_MAX;
 	pcb->pcb_fpflags = 0;
@@ -262,7 +262,7 @@ vfp_init(void)
 	vfp_disable();
 
 	if (PCPU_GET(cpuid) == 0)
-		thread0.td_pcb->pcb_fpusaved->vfp_fpcr = initial_fpcr;
+		thread0.td_pcb->pcb_fpusaved->vfp_fpcr = VFPCR_INIT;
 }
 
 SYSINIT(vfp, SI_SUB_CPU, SI_ORDER_ANY, vfp_init, NULL);
diff --git a/sys/arm64/arm64/vm_machdep.c b/sys/arm64/arm64/vm_machdep.c
index 0193048e2697..c37f1d849359 100644
--- a/sys/arm64/arm64/vm_machdep.c
+++ b/sys/arm64/arm64/vm_machdep.c
@@ -55,8 +55,6 @@ __FBSDID("$FreeBSD$");
 #include <machine/vfp.h>
 #endif
 
-uint32_t initial_fpcr = VFPCR_DN;
-
 #include <dev/psci/psci.h>
 
 /*
diff --git a/sys/arm64/include/md_var.h b/sys/arm64/include/md_var.h
index 73cf642148b5..0132ab0dd8fd 100644
--- a/sys/arm64/include/md_var.h
+++ b/sys/arm64/include/md_var.h
@@ -54,6 +54,4 @@ void generic_bs_poke_2(void) __asm(__STRING(generic_bs_poke_2));
 void generic_bs_poke_4(void) __asm(__STRING(generic_bs_poke_4));
 void generic_bs_poke_8(void) __asm(__STRING(generic_bs_poke_8));
 
-extern uint32_t initial_fpcr;
-
 #endif /* !_MACHINE_MD_VAR_H_ */
diff --git a/sys/arm64/include/vfp.h b/sys/arm64/include/vfp.h
index 3632e5eaa396..6689be1b15d7 100644
--- a/sys/arm64/include/vfp.h
+++ b/sys/arm64/include/vfp.h
@@ -36,6 +36,7 @@
 #define	VFPCR_AHP		(0x04000000)	/* alt. half-precision: */
 #define	VFPCR_DN		(0x02000000)	/* default NaN enable */
 #define	VFPCR_FZ		(0x01000000)	/* flush to zero enabled */
+#define	VFPCR_INIT		VFPCR_DN	/* Default fpcr after exec */
 
 #define	VFPCR_RMODE_OFF		22		/* rounding mode offset */
 #define	VFPCR_RMODE_MASK	(0x00c00000)	/* rounding mode mask */


More information about the dev-commits-src-all mailing list