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
This commit is contained in:
Andrew Turner 2021-03-23 15:28:20 +00:00
parent 2d82b47a5b
commit df7549775c
4 changed files with 3 additions and 6 deletions

View File

@ -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);

View File

@ -55,8 +55,6 @@ __FBSDID("$FreeBSD$");
#include <machine/vfp.h>
#endif
uint32_t initial_fpcr = VFPCR_DN;
#include <dev/psci/psci.h>
/*

View File

@ -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_ */

View File

@ -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 */