From 28e8dea25892d12660b01d59590e5a8e70ae3880 Mon Sep 17 00:00:00 2001 From: das Date: Fri, 21 Oct 2011 06:41:46 +0000 Subject: [PATCH] People porting FreeBSD to new architectures ought not have to implement a deprecated FPU control interface in addition to the standard one. To make this clearer, further deprecate ieeefp.h by not declaring the function prototypes except on architectures that implement them already. Currently i386 and amd64 implement the ieeefp.h interface for compatibility, and for fp[gs]etprec(), which doesn't exist on most other hardware. Powerpc, sparc64, and ia64 partially implement it and probably shouldn't, and other architectures don't implement it at all. --- include/ieeefp.h | 11 ----------- sys/amd64/include/ieeefp.h | 11 ++++++++--- sys/arm/include/ieeefp.h | 2 ++ sys/i386/include/ieeefp.h | 5 ++--- sys/ia64/include/ieeefp.h | 9 +++++++++ sys/mips/include/ieeefp.h | 2 ++ sys/powerpc/include/ieeefp.h | 10 ++++++++++ sys/sparc64/include/ieeefp.h | 11 +++++++++++ 8 files changed, 44 insertions(+), 17 deletions(-) diff --git a/include/ieeefp.h b/include/ieeefp.h index e4f943d38916..3f64555d5a14 100644 --- a/include/ieeefp.h +++ b/include/ieeefp.h @@ -12,15 +12,4 @@ #include #include -#if !defined(_IEEEFP_INLINED_) -__BEGIN_DECLS -extern fp_rnd_t fpgetround(void); -extern fp_rnd_t fpsetround(fp_rnd_t); -extern fp_except_t fpgetmask(void); -extern fp_except_t fpsetmask(fp_except_t); -extern fp_except_t fpgetsticky(void); -extern fp_except_t fpsetsticky(fp_except_t); -__END_DECLS -#endif /* !_IEEEFP_INLINED_ */ - #endif /* _IEEEFP_H_ */ diff --git a/sys/amd64/include/ieeefp.h b/sys/amd64/include/ieeefp.h index 124449279d02..a40366092d57 100644 --- a/sys/amd64/include/ieeefp.h +++ b/sys/amd64/include/ieeefp.h @@ -39,6 +39,8 @@ #define _MACHINE_IEEEFP_H_ /* + * Deprecated historical FPU control interface + * * IEEE floating point type, constant and function definitions. * XXX: {FP,SSE}*FLD and {FP,SSE}*OFF are undocumented pollution. */ @@ -287,13 +289,16 @@ __fpgetsticky(void) #define fpsetprec(m) __fpsetprec(m) #define fpsetround(m) __fpsetround(m) -/* Suppress prototypes in the MI header. */ -#define _IEEEFP_INLINED_ 1 - #else /* !(!__IEEEFP_NOINLINES__ && __GNUCLIKE_ASM) */ /* Augment the userland declarations. */ __BEGIN_DECLS +extern fp_rnd_t fpgetround(void); +extern fp_rnd_t fpsetround(fp_rnd_t); +extern fp_except_t fpgetmask(void); +extern fp_except_t fpsetmask(fp_except_t); +extern fp_except_t fpgetsticky(void); +extern fp_except_t fpsetsticky(fp_except_t); fp_prec_t fpgetprec(void); fp_prec_t fpsetprec(fp_prec_t); __END_DECLS diff --git a/sys/arm/include/ieeefp.h b/sys/arm/include/ieeefp.h index 8fc9811ce60f..0b61744b450b 100644 --- a/sys/arm/include/ieeefp.h +++ b/sys/arm/include/ieeefp.h @@ -8,6 +8,8 @@ #ifndef _MACHINE_IEEEFP_H_ #define _MACHINE_IEEEFP_H_ +/* Deprecated historical FPU control interface */ + /* FP exception codes */ #define FP_EXCEPT_INV 0 #define FP_EXCEPT_DZ 1 diff --git a/sys/i386/include/ieeefp.h b/sys/i386/include/ieeefp.h index 65502ac76f21..c676c4541831 100644 --- a/sys/i386/include/ieeefp.h +++ b/sys/i386/include/ieeefp.h @@ -39,6 +39,8 @@ #define _MACHINE_IEEEFP_H_ /* + * Deprecated historical FPU control interface + * * IEEE floating point type, constant and function definitions. * XXX: FP*FLD and FP*OFF are undocumented pollution. */ @@ -253,7 +255,4 @@ fpresetsticky(fp_except_t _m) #endif /* __GNUCLIKE_ASM */ -/* Suppress prototypes in the MI header. */ -#define _IEEEFP_INLINED_ 1 - #endif /* !_MACHINE_IEEEFP_H_ */ diff --git a/sys/ia64/include/ieeefp.h b/sys/ia64/include/ieeefp.h index 3b0cd4b9b781..7cde91b4814c 100644 --- a/sys/ia64/include/ieeefp.h +++ b/sys/ia64/include/ieeefp.h @@ -29,6 +29,8 @@ #ifndef _MACHINE_IEEEFP_H_ #define _MACHINE_IEEEFP_H_ +/* Deprecated historical FPU control interface */ + #include typedef int fp_except_t; @@ -45,4 +47,11 @@ typedef enum { FP_RZ /* round toward zero */ } fp_rnd_t; +__BEGIN_DECLS +extern fp_rnd_t fpgetround(void); +extern fp_rnd_t fpsetround(fp_rnd_t); +extern fp_except_t fpgetmask(void); +extern fp_except_t fpsetmask(fp_except_t); +__END_DECLS + #endif /* !_MACHINE_IEEEFP_H_ */ diff --git a/sys/mips/include/ieeefp.h b/sys/mips/include/ieeefp.h index c7d9244ae420..fb6c21a47c43 100644 --- a/sys/mips/include/ieeefp.h +++ b/sys/mips/include/ieeefp.h @@ -11,6 +11,8 @@ #ifndef _MACHINE_IEEEFP_H_ #define _MACHINE_IEEEFP_H_ +/* Deprecated historical FPU control interface */ + typedef int fp_except; typedef int fp_except_t; diff --git a/sys/powerpc/include/ieeefp.h b/sys/powerpc/include/ieeefp.h index 820fffe1cd9c..58a4fe85a85f 100644 --- a/sys/powerpc/include/ieeefp.h +++ b/sys/powerpc/include/ieeefp.h @@ -8,6 +8,8 @@ #ifndef _MACHINE_IEEEFP_H_ #define _MACHINE_IEEEFP_H_ +/* Deprecated historical FPU control interface */ + typedef int fp_except_t; #define FP_X_IMP 0x01 /* imprecise (loss of precision) */ #define FP_X_DZ 0x02 /* divide-by-zero exception */ @@ -22,4 +24,12 @@ typedef enum { FP_RM=3 /* round toward negative infinity */ } fp_rnd_t; +__BEGIN_DECLS +extern fp_rnd_t fpgetround(void); +extern fp_rnd_t fpsetround(fp_rnd_t); +extern fp_except_t fpgetmask(void); +extern fp_except_t fpsetmask(fp_except_t); +extern fp_except_t fpgetsticky(void); +__END_DECLS + #endif /* _MACHINE_IEEEFP_H_ */ diff --git a/sys/sparc64/include/ieeefp.h b/sys/sparc64/include/ieeefp.h index 11264949acee..bb0773730aa0 100644 --- a/sys/sparc64/include/ieeefp.h +++ b/sys/sparc64/include/ieeefp.h @@ -7,6 +7,8 @@ #ifndef _MACHINE_IEEEFP_H_ #define _MACHINE_IEEEFP_H_ +/* Deprecated FPU control interface */ + #include typedef int fp_except_t; @@ -23,4 +25,13 @@ typedef enum { FP_RM = FSR_RD_NINF /* round toward negative infinity */ } fp_rnd_t; +__BEGIN_DECLS +extern fp_rnd_t fpgetround(void); +extern fp_rnd_t fpsetround(fp_rnd_t); +extern fp_except_t fpgetmask(void); +extern fp_except_t fpsetmask(fp_except_t); +extern fp_except_t fpgetsticky(void); +__END_DECLS + + #endif /* _MACHINE_IEEEFP_H_ */