1184588Sdfr/* $NetBSD: fpsetmask.c,v 1.4 2008/04/28 20:23:00 martin Exp $ */
2184588Sdfr
3184588Sdfr/*-
4184588Sdfr * Copyright (c) 1997 The NetBSD Foundation, Inc.
5184588Sdfr * All rights reserved.
6184588Sdfr *
7184588Sdfr * This code is derived from software contributed to The NetBSD Foundation
8184588Sdfr * by Neil A. Carson and Mark Brinicombe
9184588Sdfr *
10184588Sdfr * Redistribution and use in source and binary forms, with or without
11184588Sdfr * modification, are permitted provided that the following conditions
12184588Sdfr * are met:
13184588Sdfr * 1. Redistributions of source code must retain the above copyright
14184588Sdfr *    notice, this list of conditions and the following disclaimer.
15184588Sdfr * 2. Redistributions in binary form must reproduce the above copyright
16184588Sdfr *    notice, this list of conditions and the following disclaimer in the
17184588Sdfr *    documentation and/or other materials provided with the distribution.
18184588Sdfr *
19184588Sdfr * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20184588Sdfr * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21184588Sdfr * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22184588Sdfr * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23184588Sdfr * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24184588Sdfr * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25184588Sdfr * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26184588Sdfr * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27184588Sdfr * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28184588Sdfr * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29184588Sdfr * POSSIBILITY OF SUCH DAMAGE.
30184588Sdfr */
31184588Sdfr
32184588Sdfr#include <sys/cdefs.h>
33184588Sdfr__FBSDID("$FreeBSD$");
34184588Sdfr
35184588Sdfr#include "namespace.h"
36184588Sdfr
37184588Sdfr#include <ieeefp.h>
38184588Sdfr#ifdef SOFTFLOAT_FOR_GCC
39184588Sdfr#include "softfloat-for-gcc.h"
40184588Sdfr#endif
41184588Sdfr#include "milieu.h"
42184588Sdfr#include "softfloat.h"
43184588Sdfr
44184588Sdfr#ifdef __weak_alias
45184588Sdfr__weak_alias(fpsetmask,_fpsetmask)
46184588Sdfr#endif
47184588Sdfr
48184588Sdfrfp_except
49184588Sdfrfpsetmask(fp_except mask)
50184588Sdfr{
51184588Sdfr	fp_except old;
52184588Sdfr
53184588Sdfr	old = float_exception_mask;
54184588Sdfr	float_exception_mask = mask;
55184588Sdfr	return old;
56184588Sdfr}
57184588Sdfr