Author: andrew Date: Sat Mar 29 14:17:04 2014 New Revision: 263913 URL: http://svnweb.freebsd.org/changeset/base/263913
Log: Initialise fpscr to a sane value when we create the pcb. This sets NaNs to be the default NaN and for denormalised numbers to be flushed to zero. Modified: head/sys/arm/arm/machdep.c head/sys/arm/arm/vm_machdep.c Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Sat Mar 29 11:56:33 2014 (r263912) +++ head/sys/arm/arm/machdep.c Sat Mar 29 14:17:04 2014 (r263913) @@ -101,6 +101,7 @@ __FBSDID("$FreeBSD$"); #include <machine/reg.h> #include <machine/trap.h> #include <machine/undefined.h> +#include <machine/vfp.h> #include <machine/vmparam.h> #include <machine/sysarch.h> @@ -990,6 +991,7 @@ init_proc0(vm_offset_t kstack) (thread0.td_kstack + KSTACK_PAGES * PAGE_SIZE) - 1; thread0.td_pcb->pcb_flags = 0; thread0.td_pcb->pcb_vfpcpu = -1; + thread0.td_pcb->pcb_vfpstate.fpscr = VFPSCR_DN | VFPSCR_FZ; thread0.td_frame = &proc0_tf; pcpup->pc_curpcb = thread0.td_pcb; } Modified: head/sys/arm/arm/vm_machdep.c ============================================================================== --- head/sys/arm/arm/vm_machdep.c Sat Mar 29 11:56:33 2014 (r263912) +++ head/sys/arm/arm/vm_machdep.c Sat Mar 29 14:17:04 2014 (r263913) @@ -74,6 +74,7 @@ __FBSDID("$FreeBSD$"); #include <vm/uma_int.h> #include <machine/md_var.h> +#include <machine/vfp.h> /* * struct switchframe and trapframe must both be a multiple of 8 @@ -147,6 +148,7 @@ cpu_fork(register struct thread *td1, re pcb2->un_32.pcb32_sp = td2->td_kstack + USPACE_SVC_STACK_TOP - sizeof(*pcb2); pcb2->pcb_vfpcpu = -1; + pcb2->pcb_vfpstate.fpscr = VFPSCR_DN | VFPSCR_FZ; pmap_activate(td2); td2->td_frame = tf = (struct trapframe *)STACKALIGN( pcb2->un_32.pcb32_sp - sizeof(struct trapframe)); _______________________________________________ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"