From 11e9fa3a9bbbb1e9b69e0ad6954501929930063e Mon Sep 17 00:00:00 2001 From: scw Date: Mon, 20 Jan 2003 20:09:59 +0000 Subject: [PATCH] Initialise the FPSCR to a sane value. --- lib/libc/arch/sh5/gen/_lwp.c | 8 +++++++- lib/libc/arch/sh5/gen/makecontext.c | 10 ++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/lib/libc/arch/sh5/gen/_lwp.c b/lib/libc/arch/sh5/gen/_lwp.c index 2970444f80ac..704244e0f746 100644 --- a/lib/libc/arch/sh5/gen/_lwp.c +++ b/lib/libc/arch/sh5/gen/_lwp.c @@ -1,4 +1,4 @@ -/* $NetBSD: _lwp.c,v 1.1 2003/01/19 23:05:01 scw Exp $ */ +/* $NetBSD: _lwp.c,v 1.2 2003/01/20 20:09:59 scw Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -40,6 +40,7 @@ #include #include #include +#include void _lwp_makecontext(ucontext_t *u, void (*start)(void *), @@ -87,4 +88,9 @@ _lwp_makecontext(ucontext_t *u, void (*start)(void *), gr[_REG_TR(5)] = 0; gr[_REG_TR(6)] = 0; gr[_REG_TR(7)] = 0; + + /* + * Ensure the FPSCR is valid + */ + u->uc_mcontext.__fpregs.__fp_scr = SH5_FPSCR_DN_FLUSH_ZERO; } diff --git a/lib/libc/arch/sh5/gen/makecontext.c b/lib/libc/arch/sh5/gen/makecontext.c index 763c7eb19ae4..4a5ac40779d6 100644 --- a/lib/libc/arch/sh5/gen/makecontext.c +++ b/lib/libc/arch/sh5/gen/makecontext.c @@ -1,4 +1,4 @@ -/* $NetBSD: makecontext.c,v 1.1 2003/01/19 23:05:02 scw Exp $ */ +/* $NetBSD: makecontext.c,v 1.2 2003/01/20 20:09:59 scw Exp $ */ /* * Copyright 2003 Wasabi Systems, Inc. @@ -38,7 +38,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: makecontext.c,v 1.1 2003/01/19 23:05:02 scw Exp $"); +__RCSID("$NetBSD: makecontext.c,v 1.2 2003/01/20 20:09:59 scw Exp $"); #endif #include @@ -47,6 +47,7 @@ __RCSID("$NetBSD: makecontext.c,v 1.1 2003/01/19 23:05:02 scw Exp $"); #include "extern.h" #include +#include void makecontext(ucontext_t *ucp, void (*func)(void), int argc, ...) @@ -94,6 +95,11 @@ makecontext(ucontext_t *ucp, void (*func)(void), int argc, ...) gr[_REG_TR(6)] = 0; gr[_REG_TR(7)] = 0; + /* + * Ensure the FPSCR is valid + */ + ucp->uc_mcontext.__fpregs.__fp_scr = SH5_FPSCR_DN_FLUSH_ZERO; + va_start(ap, argc); /*