From 6c788325fac88eebc377a7bdf2e90c2e8baf79e2 Mon Sep 17 00:00:00 2001 From: Thomas Moestl Date: Sat, 14 Sep 2002 18:07:03 +0000 Subject: [PATCH] Use the macros from machine/fsr.h; some minor cleanups. --- lib/libc/sparc64/gen/fpsetmask.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/libc/sparc64/gen/fpsetmask.c b/lib/libc/sparc64/gen/fpsetmask.c index a1ef3be9739d..9aefb137837a 100644 --- a/lib/libc/sparc64/gen/fpsetmask.c +++ b/lib/libc/sparc64/gen/fpsetmask.c @@ -6,6 +6,7 @@ #include __FBSDID("$FreeBSD$"); +#include #include fp_except_t @@ -15,13 +16,13 @@ fpsetmask(mask) fp_except_t old; fp_except_t new; - __asm__("st %%fsr,%0" : "=m" (*&old)); + __asm__("st %%fsr,%0" : "=m" (old)); new = old; - new &= ~(0x1f << 23); - new |= ((mask & 0x1f) << 23); + new &= ~FSR_TEM_MASK; + new |= FSR_TEM(mask & FSR_EXC_MASK); - __asm__("ld %0,%%fsr" : : "m" (*&new)); + __asm__("ld %0,%%fsr" : : "m" (new)); - return (old >> 23) & 0x1f; + return (FSR_GET_TEM(old)); }