aboutsummaryrefslogtreecommitdiff
path: root/sys/i386/include
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2022-04-12 17:05:45 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2022-04-12 17:05:45 +0000
commit56f5947a7102554729e0400f08b0f4d50a2d0827 (patch)
tree29c94b506b2fd875a4414bbf3f374179fb3a34c1 /sys/i386/include
parent1c1bf5bd7c1e479a7889839b941f53e689aa2569 (diff)
downloadsrc-56f5947a7102554729e0400f08b0f4d50a2d0827.tar.gz
src-56f5947a7102554729e0400f08b0f4d50a2d0827.zip
Remove checks for __GNUCLIKE_ASM assuming it is always true.
All supported compilers (modern versions of GCC and clang) support this. Many places didn't have an #else so would just silently do the wrong thing. Ancient versions of icc (the original motivation for this) are no longer a compiler FreeBSD supports. PR: 263102 (exp-run) Reviewed by: brooks, imp Differential Revision: https://reviews.freebsd.org/D34797
Diffstat (limited to 'sys/i386/include')
-rw-r--r--sys/i386/include/atomic.h47
-rw-r--r--sys/i386/include/cpufunc.h6
-rw-r--r--sys/i386/include/ieeefp.h4
-rw-r--r--sys/i386/include/in_cksum.h9
-rw-r--r--sys/i386/include/pcpu.h6
-rw-r--r--sys/i386/include/profile.h6
6 files changed, 6 insertions, 72 deletions
diff --git a/sys/i386/include/atomic.h b/sys/i386/include/atomic.h
index 154144a470c6..af6d323e0396 100644
--- a/sys/i386/include/atomic.h
+++ b/sys/i386/include/atomic.h
@@ -96,42 +96,6 @@ __mbu(void)
* atomic_readandclear_long(P) (return (*(u_long *)(P)); *(u_long *)(P) = 0;)
*/
-#if !defined(__GNUCLIKE_ASM)
-#define ATOMIC_ASM(NAME, TYPE, OP, CONS, V) \
-void atomic_##NAME##_##TYPE(volatile u_##TYPE *p, u_##TYPE v); \
-void atomic_##NAME##_barr_##TYPE(volatile u_##TYPE *p, u_##TYPE v)
-
-int atomic_cmpset_char(volatile u_char *dst, u_char expect, u_char src);
-int atomic_cmpset_short(volatile u_short *dst, u_short expect, u_short src);
-int atomic_cmpset_int(volatile u_int *dst, u_int expect, u_int src);
-int atomic_fcmpset_char(volatile u_char *dst, u_char *expect, u_char src);
-int atomic_fcmpset_short(volatile u_short *dst, u_short *expect,
- u_short src);
-int atomic_fcmpset_int(volatile u_int *dst, u_int *expect, u_int src);
-u_int atomic_fetchadd_int(volatile u_int *p, u_int v);
-int atomic_testandset_int(volatile u_int *p, u_int v);
-int atomic_testandclear_int(volatile u_int *p, u_int v);
-void atomic_thread_fence_acq(void);
-void atomic_thread_fence_acq_rel(void);
-void atomic_thread_fence_rel(void);
-void atomic_thread_fence_seq_cst(void);
-
-#define ATOMIC_LOAD(TYPE) \
-u_##TYPE atomic_load_acq_##TYPE(volatile u_##TYPE *p)
-#define ATOMIC_STORE(TYPE) \
-void atomic_store_rel_##TYPE(volatile u_##TYPE *p, u_##TYPE v)
-
-int atomic_cmpset_64(volatile uint64_t *, uint64_t, uint64_t);
-int atomic_fcmpset_64(volatile uint64_t *, uint64_t *, uint64_t);
-uint64_t atomic_load_acq_64(volatile uint64_t *);
-void atomic_store_rel_64(volatile uint64_t *, uint64_t);
-uint64_t atomic_swap_64(volatile uint64_t *, uint64_t);
-uint64_t atomic_fetchadd_64(volatile uint64_t *, uint64_t);
-void atomic_add_64(volatile uint64_t *, uint64_t);
-void atomic_subtract_64(volatile uint64_t *, uint64_t);
-
-#else /* !__GNUCLIKE_ASM */
-
/*
* Always use lock prefixes. The result is slighly less optimal for
* UP systems, but it matters less now, and sometimes UP is emulated
@@ -622,8 +586,6 @@ atomic_subtract_64(volatile uint64_t *p, uint64_t v)
#endif /* _KERNEL */
-#endif /* !__GNUCLIKE_ASM */
-
ATOMIC_ASM(set, char, "orb %b1,%0", "iq", v);
ATOMIC_ASM(clear, char, "andb %b1,%0", "iq", ~v);
ATOMIC_ASM(add, char, "addb %b1,%0", "iq", v);
@@ -698,8 +660,6 @@ atomic_testandclear_long(volatile u_long *p, u_int v)
}
/* Read the current value and store a new value in the destination. */
-#ifdef __GNUCLIKE_ASM
-
static __inline u_int
atomic_swap_int(volatile u_int *p, u_int v)
{
@@ -719,13 +679,6 @@ atomic_swap_long(volatile u_long *p, u_long v)
return (atomic_swap_int((volatile u_int *)p, (u_int)v));
}
-#else /* !__GNUCLIKE_ASM */
-
-u_int atomic_swap_int(volatile u_int *p, u_int v);
-u_long atomic_swap_long(volatile u_long *p, u_long v);
-
-#endif /* __GNUCLIKE_ASM */
-
#define atomic_set_acq_char atomic_set_barr_char
#define atomic_set_rel_char atomic_set_barr_char
#define atomic_clear_acq_char atomic_clear_barr_char
diff --git a/sys/i386/include/cpufunc.h b/sys/i386/include/cpufunc.h
index 79cdd3004b77..59ee9331cf9f 100644
--- a/sys/i386/include/cpufunc.h
+++ b/sys/i386/include/cpufunc.h
@@ -54,7 +54,7 @@ struct region_descriptor;
#define writew(va, d) (*(volatile uint16_t *) (va) = (d))
#define writel(va, d) (*(volatile uint32_t *) (va) = (d))
-#if defined(__GNUCLIKE_ASM) && defined(__CC_SUPPORTS___INLINE)
+#if defined(__CC_SUPPORTS___INLINE)
static __inline void
breakpoint(void)
@@ -774,7 +774,7 @@ wrpkru(uint32_t mask)
__asm __volatile("wrpkru" : : "a" (mask), "c" (0), "d" (0));
}
-#else /* !(__GNUCLIKE_ASM && __CC_SUPPORTS___INLINE) */
+#else /* !__CC_SUPPORTS___INLINE */
int breakpoint(void);
u_int bsfl(u_int mask);
@@ -844,7 +844,7 @@ void write_cyrix_reg(u_char reg, u_char data);
void write_eflags(u_int ef);
void wrmsr(u_int msr, uint64_t newval);
-#endif /* __GNUCLIKE_ASM && __CC_SUPPORTS___INLINE */
+#endif /* __CC_SUPPORTS___INLINE */
void reset_dbregs(void);
diff --git a/sys/i386/include/ieeefp.h b/sys/i386/include/ieeefp.h
index 1d92014e9209..133c40cb271e 100644
--- a/sys/i386/include/ieeefp.h
+++ b/sys/i386/include/ieeefp.h
@@ -44,8 +44,6 @@
#include <x86/x86_ieeefp.h>
-#ifdef __GNUCLIKE_ASM
-
static __inline fp_rnd_t
fpgetround(void)
{
@@ -156,6 +154,4 @@ fpresetsticky(fp_except_t _m)
return (_p);
}
-#endif /* __GNUCLIKE_ASM */
-
#endif /* !_MACHINE_IEEEFP_H_ */
diff --git a/sys/i386/include/in_cksum.h b/sys/i386/include/in_cksum.h
index 84e369cf3c81..ac6049719364 100644
--- a/sys/i386/include/in_cksum.h
+++ b/sys/i386/include/in_cksum.h
@@ -47,7 +47,6 @@
* in the normal case (where there are no options and the header length is
* therefore always exactly five 32-bit words.
*/
-#if defined(__GNUCLIKE_ASM)
#if defined(IPVERSION) && (IPVERSION == 4)
static __inline u_int
in_cksum_hdr(const struct ip *ip)
@@ -107,19 +106,11 @@ in_pseudo(u_int sum, u_int b, u_int c)
sum -= 0xffff;
return (sum);
}
-#endif
#ifdef _KERNEL
#define HAVE_MD_IN_CKSUM
-#if !defined(__GNUCLIKE_ASM)
-#if defined(IPVERSION) && (IPVERSION == 4)
-u_int in_cksum_hdr(const struct ip *ip);
-#endif
-u_short in_addword(u_short sum, u_short b);
-u_short in_pseudo(u_int sum, u_int b, u_int c);
-#endif
u_short in_cksum_skip(struct mbuf *m, int len, int skip);
#endif /* _KERNEL */
diff --git a/sys/i386/include/pcpu.h b/sys/i386/include/pcpu.h
index a4c7968ea85f..c4099f04ded1 100644
--- a/sys/i386/include/pcpu.h
+++ b/sys/i386/include/pcpu.h
@@ -99,7 +99,7 @@ _Static_assert(sizeof(struct monitorbuf) == 128, "2x cache line");
#define MONITOR_STOPSTATE_RUNNING 0
#define MONITOR_STOPSTATE_STOPPED 1
-#if defined(__GNUCLIKE_ASM) && defined(__GNUCLIKE___TYPEOF)
+#if defined(__GNUCLIKE___TYPEOF)
/*
* Evaluates to the byte offset of the per-cpu variable name.
@@ -206,11 +206,11 @@ _Static_assert(sizeof(struct monitorbuf) == 128, "2x cache line");
#define IS_BSP() (PCPU_GET(cpuid) == 0)
-#else /* defined(__GNUCLIKE_ASM) && defined(__GNUCLIKE___TYPEOF) */
+#else /* defined(__GNUCLIKE___TYPEOF) */
#error "this file needs to be ported to your compiler"
-#endif /* __GNUCLIKE_ASM etc. */
+#endif /* __GNUCLIKE___TYPEOF */
#endif /* _KERNEL */
diff --git a/sys/i386/include/profile.h b/sys/i386/include/profile.h
index 8bb3c7af748c..e834abe33c37 100644
--- a/sys/i386/include/profile.h
+++ b/sys/i386/include/profile.h
@@ -43,7 +43,6 @@
#define _MCOUNT_DECL static __inline void _mcount
-#ifdef __GNUCLIKE_ASM
#define MCOUNT \
void \
mcount() \
@@ -75,9 +74,6 @@ mcount() \
_mcount(frompc, selfpc); \
__asm("" : : "c" (ecx)); \
}
-#else /* !__GNUCLIKE_ASM */
-#define MCOUNT
-#endif /* __GNUCLIKE_ASM */
typedef u_int uintfptr_t;
@@ -88,9 +84,7 @@ typedef u_int uintfptr_t;
typedef u_int fptrdiff_t;
__BEGIN_DECLS
-#ifdef __GNUCLIKE_ASM
void mcount(void) __asm(".mcount");
-#endif
__END_DECLS
#endif /* !_KERNEL */