Remove resolver_qual from DEFINE_IFUNC/DEFINE_UIFUNC macros.

In all practical situations, the resolver visibility is static.

Requested by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Approved by:	so (emaste)
Differential revision:	https://reviews.freebsd.org/D20281
This commit is contained in:
Konstantin Belousov 2019-05-16 22:20:54 +00:00
parent 11f8f36fb9
commit 7c5a46a1bc
19 changed files with 76 additions and 82 deletions

View File

@ -57,7 +57,7 @@ amd64_get_fsbase_syscall(void **addr)
return (sysarch(AMD64_GET_FSBASE, addr)); return (sysarch(AMD64_GET_FSBASE, addr));
} }
DEFINE_UIFUNC(, int, amd64_get_fsbase, (void **), static) DEFINE_UIFUNC(, int, amd64_get_fsbase, (void **))
{ {
if (__getosreldate() >= P_OSREL_WRFSBASE && if (__getosreldate() >= P_OSREL_WRFSBASE &&

View File

@ -57,7 +57,7 @@ amd64_get_gsbase_syscall(void **addr)
return (sysarch(AMD64_GET_GSBASE, addr)); return (sysarch(AMD64_GET_GSBASE, addr));
} }
DEFINE_UIFUNC(, int, amd64_get_gsbase, (void **), static) DEFINE_UIFUNC(, int, amd64_get_gsbase, (void **))
{ {
if (__getosreldate() >= P_OSREL_WRFSBASE && if (__getosreldate() >= P_OSREL_WRFSBASE &&

View File

@ -57,7 +57,7 @@ amd64_set_fsbase_syscall(void *addr)
return (sysarch(AMD64_SET_FSBASE, &addr)); return (sysarch(AMD64_SET_FSBASE, &addr));
} }
DEFINE_UIFUNC(, int, amd64_set_fsbase, (void *), static) DEFINE_UIFUNC(, int, amd64_set_fsbase, (void *))
{ {
if (__getosreldate() >= P_OSREL_WRFSBASE && if (__getosreldate() >= P_OSREL_WRFSBASE &&

View File

@ -57,7 +57,7 @@ amd64_set_gsbase_syscall(void *addr)
return (sysarch(AMD64_SET_GSBASE, &addr)); return (sysarch(AMD64_SET_GSBASE, &addr));
} }
DEFINE_UIFUNC(, int, amd64_set_gsbase, (void *), static) DEFINE_UIFUNC(, int, amd64_set_gsbase, (void *))
{ {
if (__getosreldate() >= P_OSREL_WRFSBASE && if (__getosreldate() >= P_OSREL_WRFSBASE &&

View File

@ -61,7 +61,7 @@ __getcontextx_size_xfpu(void)
return (sizeof(ucontext_t) + xstate_sz); return (sizeof(ucontext_t) + xstate_sz);
} }
DEFINE_UIFUNC(, int, __getcontextx_size, (void), static) DEFINE_UIFUNC(, int, __getcontextx_size, (void))
{ {
u_int p[4]; u_int p[4];
@ -100,7 +100,7 @@ __fillcontextx2_noxfpu(char *ctx)
return (0); return (0);
} }
DEFINE_UIFUNC(, int, __fillcontextx2, (char *), static) DEFINE_UIFUNC(, int, __fillcontextx2, (char *))
{ {
return ((cpu_feature2 & CPUID2_OSXSAVE) != 0 ? __fillcontextx2_xfpu : return ((cpu_feature2 & CPUID2_OSXSAVE) != 0 ? __fillcontextx2_xfpu :

View File

@ -72,7 +72,7 @@ rdtsc_mb_none(void)
{ {
} }
DEFINE_UIFUNC(static, void, rdtsc_mb, (void), static) DEFINE_UIFUNC(static, void, rdtsc_mb, (void))
{ {
u_int p[4]; u_int p[4];
/* Not a typo, string matches our do_cpuid() registers use. */ /* Not a typo, string matches our do_cpuid() registers use. */

View File

@ -71,7 +71,7 @@ x86_pkru_get_perm_hw(u_int keyidx, int *access, int *modify)
return (0); return (0);
} }
DEFINE_UIFUNC(, int, x86_pkru_get_perm, (u_int, int *, int *), static) DEFINE_UIFUNC(, int, x86_pkru_get_perm, (u_int, int *, int *))
{ {
return ((cpu_stdext_feature2 & CPUID_STDEXT2_OSPKE) == 0 ? return ((cpu_stdext_feature2 & CPUID_STDEXT2_OSPKE) == 0 ?
@ -106,7 +106,7 @@ x86_pkru_set_perm_hw(u_int keyidx, int access, int modify)
return (0); return (0);
} }
DEFINE_UIFUNC(, int, x86_pkru_set_perm, (u_int, int, int), static) DEFINE_UIFUNC(, int, x86_pkru_set_perm, (u_int, int, int))
{ {
return ((cpu_stdext_feature2 & CPUID_STDEXT2_OSPKE) == 0 ? return ((cpu_stdext_feature2 & CPUID_STDEXT2_OSPKE) == 0 ?

View File

@ -41,7 +41,7 @@ __FBSDID("$FreeBSD$");
int fubyte_nosmap(volatile const void *base); int fubyte_nosmap(volatile const void *base);
int fubyte_smap(volatile const void *base); int fubyte_smap(volatile const void *base);
DEFINE_IFUNC(, int, fubyte, (volatile const void *), static) DEFINE_IFUNC(, int, fubyte, (volatile const void *))
{ {
return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ?
@ -50,7 +50,7 @@ DEFINE_IFUNC(, int, fubyte, (volatile const void *), static)
int fuword16_nosmap(volatile const void *base); int fuword16_nosmap(volatile const void *base);
int fuword16_smap(volatile const void *base); int fuword16_smap(volatile const void *base);
DEFINE_IFUNC(, int, fuword16, (volatile const void *), static) DEFINE_IFUNC(, int, fuword16, (volatile const void *))
{ {
return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ?
@ -59,13 +59,13 @@ DEFINE_IFUNC(, int, fuword16, (volatile const void *), static)
int fueword_nosmap(volatile const void *base, long *val); int fueword_nosmap(volatile const void *base, long *val);
int fueword_smap(volatile const void *base, long *val); int fueword_smap(volatile const void *base, long *val);
DEFINE_IFUNC(, int, fueword, (volatile const void *, long *), static) DEFINE_IFUNC(, int, fueword, (volatile const void *, long *))
{ {
return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ?
fueword_smap : fueword_nosmap); fueword_smap : fueword_nosmap);
} }
DEFINE_IFUNC(, int, fueword64, (volatile const void *, int64_t *), static) DEFINE_IFUNC(, int, fueword64, (volatile const void *, int64_t *))
{ {
return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ?
@ -74,7 +74,7 @@ DEFINE_IFUNC(, int, fueword64, (volatile const void *, int64_t *), static)
int fueword32_nosmap(volatile const void *base, int32_t *val); int fueword32_nosmap(volatile const void *base, int32_t *val);
int fueword32_smap(volatile const void *base, int32_t *val); int fueword32_smap(volatile const void *base, int32_t *val);
DEFINE_IFUNC(, int, fueword32, (volatile const void *, int32_t *), static) DEFINE_IFUNC(, int, fueword32, (volatile const void *, int32_t *))
{ {
return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ?
@ -83,7 +83,7 @@ DEFINE_IFUNC(, int, fueword32, (volatile const void *, int32_t *), static)
int subyte_nosmap(volatile void *base, int byte); int subyte_nosmap(volatile void *base, int byte);
int subyte_smap(volatile void *base, int byte); int subyte_smap(volatile void *base, int byte);
DEFINE_IFUNC(, int, subyte, (volatile void *, int), static) DEFINE_IFUNC(, int, subyte, (volatile void *, int))
{ {
return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ?
@ -92,7 +92,7 @@ DEFINE_IFUNC(, int, subyte, (volatile void *, int), static)
int suword16_nosmap(volatile void *base, int word); int suword16_nosmap(volatile void *base, int word);
int suword16_smap(volatile void *base, int word); int suword16_smap(volatile void *base, int word);
DEFINE_IFUNC(, int, suword16, (volatile void *, int), static) DEFINE_IFUNC(, int, suword16, (volatile void *, int))
{ {
return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ?
@ -101,7 +101,7 @@ DEFINE_IFUNC(, int, suword16, (volatile void *, int), static)
int suword32_nosmap(volatile void *base, int32_t word); int suword32_nosmap(volatile void *base, int32_t word);
int suword32_smap(volatile void *base, int32_t word); int suword32_smap(volatile void *base, int32_t word);
DEFINE_IFUNC(, int, suword32, (volatile void *, int32_t), static) DEFINE_IFUNC(, int, suword32, (volatile void *, int32_t))
{ {
return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ?
@ -110,13 +110,13 @@ DEFINE_IFUNC(, int, suword32, (volatile void *, int32_t), static)
int suword_nosmap(volatile void *base, long word); int suword_nosmap(volatile void *base, long word);
int suword_smap(volatile void *base, long word); int suword_smap(volatile void *base, long word);
DEFINE_IFUNC(, int, suword, (volatile void *, long), static) DEFINE_IFUNC(, int, suword, (volatile void *, long))
{ {
return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ?
suword_smap : suword_nosmap); suword_smap : suword_nosmap);
} }
DEFINE_IFUNC(, int, suword64, (volatile void *, int64_t), static) DEFINE_IFUNC(, int, suword64, (volatile void *, int64_t))
{ {
return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ?
@ -128,7 +128,7 @@ int casueword32_nosmap(volatile uint32_t *base, uint32_t oldval,
int casueword32_smap(volatile uint32_t *base, uint32_t oldval, int casueword32_smap(volatile uint32_t *base, uint32_t oldval,
uint32_t *oldvalp, uint32_t newval); uint32_t *oldvalp, uint32_t newval);
DEFINE_IFUNC(, int, casueword32, (volatile uint32_t *, uint32_t, uint32_t *, DEFINE_IFUNC(, int, casueword32, (volatile uint32_t *, uint32_t, uint32_t *,
uint32_t), static) uint32_t))
{ {
return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ?
@ -139,8 +139,7 @@ int casueword_nosmap(volatile u_long *p, u_long oldval, u_long *oldvalp,
u_long newval); u_long newval);
int casueword_smap(volatile u_long *p, u_long oldval, u_long *oldvalp, int casueword_smap(volatile u_long *p, u_long oldval, u_long *oldvalp,
u_long newval); u_long newval);
DEFINE_IFUNC(, int, casueword, (volatile u_long *, u_long, u_long *, u_long), DEFINE_IFUNC(, int, casueword, (volatile u_long *, u_long, u_long *, u_long))
static)
{ {
return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ?
@ -151,8 +150,7 @@ int copyinstr_nosmap(const void *udaddr, void *kaddr, size_t len,
size_t *lencopied); size_t *lencopied);
int copyinstr_smap(const void *udaddr, void *kaddr, size_t len, int copyinstr_smap(const void *udaddr, void *kaddr, size_t len,
size_t *lencopied); size_t *lencopied);
DEFINE_IFUNC(, int, copyinstr, (const void *, void *, size_t, size_t *), DEFINE_IFUNC(, int, copyinstr, (const void *, void *, size_t, size_t *))
static)
{ {
return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ?
@ -163,7 +161,7 @@ int copyin_nosmap_std(const void *udaddr, void *kaddr, size_t len);
int copyin_smap_std(const void *udaddr, void *kaddr, size_t len); int copyin_smap_std(const void *udaddr, void *kaddr, size_t len);
int copyin_nosmap_erms(const void *udaddr, void *kaddr, size_t len); int copyin_nosmap_erms(const void *udaddr, void *kaddr, size_t len);
int copyin_smap_erms(const void *udaddr, void *kaddr, size_t len); int copyin_smap_erms(const void *udaddr, void *kaddr, size_t len);
DEFINE_IFUNC(, int, copyin, (const void *, void *, size_t), static) DEFINE_IFUNC(, int, copyin, (const void *, void *, size_t))
{ {
switch (cpu_stdext_feature & (CPUID_STDEXT_SMAP | CPUID_STDEXT_ERMS)) { switch (cpu_stdext_feature & (CPUID_STDEXT_SMAP | CPUID_STDEXT_ERMS)) {
@ -183,7 +181,7 @@ int copyout_nosmap_std(const void *kaddr, void *udaddr, size_t len);
int copyout_smap_std(const void *kaddr, void *udaddr, size_t len); int copyout_smap_std(const void *kaddr, void *udaddr, size_t len);
int copyout_nosmap_erms(const void *kaddr, void *udaddr, size_t len); int copyout_nosmap_erms(const void *kaddr, void *udaddr, size_t len);
int copyout_smap_erms(const void *kaddr, void *udaddr, size_t len); int copyout_smap_erms(const void *kaddr, void *udaddr, size_t len);
DEFINE_IFUNC(, int, copyout, (const void *, void *, size_t), static) DEFINE_IFUNC(, int, copyout, (const void *, void *, size_t))
{ {
switch (cpu_stdext_feature & (CPUID_STDEXT_SMAP | CPUID_STDEXT_ERMS)) { switch (cpu_stdext_feature & (CPUID_STDEXT_SMAP | CPUID_STDEXT_ERMS)) {

View File

@ -216,7 +216,7 @@ init_xsave(void)
TUNABLE_INT_FETCH("hw.use_xsave", &use_xsave); TUNABLE_INT_FETCH("hw.use_xsave", &use_xsave);
} }
DEFINE_IFUNC(, void, fpusave, (void *), static) DEFINE_IFUNC(, void, fpusave, (void *))
{ {
init_xsave(); init_xsave();
@ -226,7 +226,7 @@ DEFINE_IFUNC(, void, fpusave, (void *), static)
return (fpusave_fxsave); return (fpusave_fxsave);
} }
DEFINE_IFUNC(, void, fpurestore, (void *), static) DEFINE_IFUNC(, void, fpurestore, (void *))
{ {
init_xsave(); init_xsave();

View File

@ -2653,7 +2653,7 @@ set_pcb_flags_fsgsbase(struct pcb *pcb, const u_int flags)
} }
} }
DEFINE_IFUNC(, void, set_pcb_flags, (struct pcb *, const u_int), static) DEFINE_IFUNC(, void, set_pcb_flags, (struct pcb *, const u_int))
{ {
return ((cpu_stdext_feature & CPUID_STDEXT_FSGSBASE) != 0 ? return ((cpu_stdext_feature & CPUID_STDEXT_FSGSBASE) != 0 ?
@ -2700,7 +2700,7 @@ outb_(u_short port, u_char data)
void *memset_std(void *buf, int c, size_t len); void *memset_std(void *buf, int c, size_t len);
void *memset_erms(void *buf, int c, size_t len); void *memset_erms(void *buf, int c, size_t len);
DEFINE_IFUNC(, void *, memset, (void *, int, size_t), static) DEFINE_IFUNC(, void *, memset, (void *, int, size_t))
{ {
return ((cpu_stdext_feature & CPUID_STDEXT_ERMS) != 0 ? return ((cpu_stdext_feature & CPUID_STDEXT_ERMS) != 0 ?
@ -2712,7 +2712,7 @@ void *memmove_std(void * _Nonnull dst, const void * _Nonnull src,
void *memmove_erms(void * _Nonnull dst, const void * _Nonnull src, void *memmove_erms(void * _Nonnull dst, const void * _Nonnull src,
size_t len); size_t len);
DEFINE_IFUNC(, void *, memmove, (void * _Nonnull, const void * _Nonnull, DEFINE_IFUNC(, void *, memmove, (void * _Nonnull, const void * _Nonnull,
size_t), static) size_t))
{ {
return ((cpu_stdext_feature & CPUID_STDEXT_ERMS) != 0 ? return ((cpu_stdext_feature & CPUID_STDEXT_ERMS) != 0 ?
@ -2723,8 +2723,7 @@ void *memcpy_std(void * _Nonnull dst, const void * _Nonnull src,
size_t len); size_t len);
void *memcpy_erms(void * _Nonnull dst, const void * _Nonnull src, void *memcpy_erms(void * _Nonnull dst, const void * _Nonnull src,
size_t len); size_t len);
DEFINE_IFUNC(, void *, memcpy, (void * _Nonnull, const void * _Nonnull,size_t), DEFINE_IFUNC(, void *, memcpy, (void * _Nonnull, const void * _Nonnull,size_t))
static)
{ {
return ((cpu_stdext_feature & CPUID_STDEXT_ERMS) != 0 ? return ((cpu_stdext_feature & CPUID_STDEXT_ERMS) != 0 ?
@ -2733,7 +2732,7 @@ DEFINE_IFUNC(, void *, memcpy, (void * _Nonnull, const void * _Nonnull,size_t),
void pagezero_std(void *addr); void pagezero_std(void *addr);
void pagezero_erms(void *addr); void pagezero_erms(void *addr);
DEFINE_IFUNC(, void , pagezero, (void *), static) DEFINE_IFUNC(, void , pagezero, (void *))
{ {
return ((cpu_stdext_feature & CPUID_STDEXT_ERMS) != 0 ? return ((cpu_stdext_feature & CPUID_STDEXT_ERMS) != 0 ?

View File

@ -512,7 +512,7 @@ SYSCTL_PROC(_vm_pmap, OID_AUTO, di_locked, CTLTYPE_INT | CTLFLAG_RDTUN |
static bool pmap_not_in_di_l(void); static bool pmap_not_in_di_l(void);
static bool pmap_not_in_di_u(void); static bool pmap_not_in_di_u(void);
DEFINE_IFUNC(, bool, pmap_not_in_di, (void), static) DEFINE_IFUNC(, bool, pmap_not_in_di, (void))
{ {
return (pmap_di_locked() ? pmap_not_in_di_l : pmap_not_in_di_u); return (pmap_di_locked() ? pmap_not_in_di_l : pmap_not_in_di_u);
@ -953,28 +953,28 @@ pmap_delayed_invl_wait_u(vm_page_t m)
} }
} }
DEFINE_IFUNC(, void, pmap_thread_init_invl_gen, (struct thread *), static) DEFINE_IFUNC(, void, pmap_thread_init_invl_gen, (struct thread *))
{ {
return (pmap_di_locked() ? pmap_thread_init_invl_gen_l : return (pmap_di_locked() ? pmap_thread_init_invl_gen_l :
pmap_thread_init_invl_gen_u); pmap_thread_init_invl_gen_u);
} }
DEFINE_IFUNC(static, void, pmap_delayed_invl_start, (void), static) DEFINE_IFUNC(static, void, pmap_delayed_invl_start, (void))
{ {
return (pmap_di_locked() ? pmap_delayed_invl_start_l : return (pmap_di_locked() ? pmap_delayed_invl_start_l :
pmap_delayed_invl_start_u); pmap_delayed_invl_start_u);
} }
DEFINE_IFUNC(static, void, pmap_delayed_invl_finish, (void), static) DEFINE_IFUNC(static, void, pmap_delayed_invl_finish, (void))
{ {
return (pmap_di_locked() ? pmap_delayed_invl_finish_l : return (pmap_di_locked() ? pmap_delayed_invl_finish_l :
pmap_delayed_invl_finish_u); pmap_delayed_invl_finish_u);
} }
DEFINE_IFUNC(static, void, pmap_delayed_invl_wait, (vm_page_t), static) DEFINE_IFUNC(static, void, pmap_delayed_invl_wait, (vm_page_t))
{ {
return (pmap_di_locked() ? pmap_delayed_invl_wait_l : return (pmap_di_locked() ? pmap_delayed_invl_wait_l :
@ -2197,8 +2197,7 @@ pmap_invalidate_page_nopcid(pmap_t pmap, vm_offset_t va)
{ {
} }
DEFINE_IFUNC(static, void, pmap_invalidate_page_mode, (pmap_t, vm_offset_t), DEFINE_IFUNC(static, void, pmap_invalidate_page_mode, (pmap_t, vm_offset_t))
static)
{ {
if (pmap_pcid_enabled) if (pmap_pcid_enabled)
@ -2295,7 +2294,7 @@ pmap_invalidate_range_nopcid(pmap_t pmap, vm_offset_t sva, vm_offset_t eva)
} }
DEFINE_IFUNC(static, void, pmap_invalidate_range_mode, (pmap_t, vm_offset_t, DEFINE_IFUNC(static, void, pmap_invalidate_range_mode, (pmap_t, vm_offset_t,
vm_offset_t), static) vm_offset_t))
{ {
if (pmap_pcid_enabled) if (pmap_pcid_enabled)
@ -2412,7 +2411,7 @@ pmap_invalidate_all_nopcid(pmap_t pmap)
invltlb(); invltlb();
} }
DEFINE_IFUNC(static, void, pmap_invalidate_all_mode, (pmap_t), static) DEFINE_IFUNC(static, void, pmap_invalidate_all_mode, (pmap_t))
{ {
if (pmap_pcid_enabled) if (pmap_pcid_enabled)
@ -2691,7 +2690,7 @@ pmap_invalidate_pde_page(pmap_t pmap, vm_offset_t va, pd_entry_t pde)
} }
DEFINE_IFUNC(, void, pmap_invalidate_cache_range, DEFINE_IFUNC(, void, pmap_invalidate_cache_range,
(vm_offset_t sva, vm_offset_t eva), static) (vm_offset_t sva, vm_offset_t eva))
{ {
if ((cpu_feature & CPUID_SS) != 0) if ((cpu_feature & CPUID_SS) != 0)
@ -8284,7 +8283,7 @@ pmap_activate_sw_nopcid_pti(struct thread *td, pmap_t pmap,
} }
DEFINE_IFUNC(static, void, pmap_activate_sw_mode, (struct thread *, pmap_t, DEFINE_IFUNC(static, void, pmap_activate_sw_mode, (struct thread *, pmap_t,
u_int), static) u_int))
{ {
if (pmap_pcid_enabled && pti && invpcid_works) if (pmap_pcid_enabled && pti && invpcid_works)
@ -8981,7 +8980,7 @@ pmap_large_map_wb_fence_nop(void)
{ {
} }
DEFINE_IFUNC(static, void, pmap_large_map_wb_fence, (void), static) DEFINE_IFUNC(static, void, pmap_large_map_wb_fence, (void))
{ {
if (cpu_vendor_id != CPU_VENDOR_INTEL) if (cpu_vendor_id != CPU_VENDOR_INTEL)
@ -9026,8 +9025,7 @@ pmap_large_map_flush_range_nop(vm_offset_t sva __unused, vm_size_t len __unused)
{ {
} }
DEFINE_IFUNC(static, void, pmap_large_map_flush_range, (vm_offset_t, vm_size_t), DEFINE_IFUNC(static, void, pmap_large_map_flush_range, (vm_offset_t, vm_size_t))
static)
{ {
if ((cpu_stdext_feature & CPUID_STDEXT_CLWB) != 0) if ((cpu_stdext_feature & CPUID_STDEXT_CLWB) != 0)

View File

@ -284,7 +284,7 @@ linux_set_cloned_tls(struct thread *td, void *desc)
int futex_xchgl_nosmap(int oparg, uint32_t *uaddr, int *oldval); int futex_xchgl_nosmap(int oparg, uint32_t *uaddr, int *oldval);
int futex_xchgl_smap(int oparg, uint32_t *uaddr, int *oldval); int futex_xchgl_smap(int oparg, uint32_t *uaddr, int *oldval);
DEFINE_IFUNC(, int, futex_xchgl, (int, uint32_t *, int *), static) DEFINE_IFUNC(, int, futex_xchgl, (int, uint32_t *, int *))
{ {
return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ?
@ -293,7 +293,7 @@ DEFINE_IFUNC(, int, futex_xchgl, (int, uint32_t *, int *), static)
int futex_addl_nosmap(int oparg, uint32_t *uaddr, int *oldval); int futex_addl_nosmap(int oparg, uint32_t *uaddr, int *oldval);
int futex_addl_smap(int oparg, uint32_t *uaddr, int *oldval); int futex_addl_smap(int oparg, uint32_t *uaddr, int *oldval);
DEFINE_IFUNC(, int, futex_addl, (int, uint32_t *, int *), static) DEFINE_IFUNC(, int, futex_addl, (int, uint32_t *, int *))
{ {
return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ?
@ -302,7 +302,7 @@ DEFINE_IFUNC(, int, futex_addl, (int, uint32_t *, int *), static)
int futex_orl_nosmap(int oparg, uint32_t *uaddr, int *oldval); int futex_orl_nosmap(int oparg, uint32_t *uaddr, int *oldval);
int futex_orl_smap(int oparg, uint32_t *uaddr, int *oldval); int futex_orl_smap(int oparg, uint32_t *uaddr, int *oldval);
DEFINE_IFUNC(, int, futex_orl, (int, uint32_t *, int *), static) DEFINE_IFUNC(, int, futex_orl, (int, uint32_t *, int *))
{ {
return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ?
@ -311,7 +311,7 @@ DEFINE_IFUNC(, int, futex_orl, (int, uint32_t *, int *), static)
int futex_andl_nosmap(int oparg, uint32_t *uaddr, int *oldval); int futex_andl_nosmap(int oparg, uint32_t *uaddr, int *oldval);
int futex_andl_smap(int oparg, uint32_t *uaddr, int *oldval); int futex_andl_smap(int oparg, uint32_t *uaddr, int *oldval);
DEFINE_IFUNC(, int, futex_andl, (int, uint32_t *, int *), static) DEFINE_IFUNC(, int, futex_andl, (int, uint32_t *, int *))
{ {
return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ?
@ -320,7 +320,7 @@ DEFINE_IFUNC(, int, futex_andl, (int, uint32_t *, int *), static)
int futex_xorl_nosmap(int oparg, uint32_t *uaddr, int *oldval); int futex_xorl_nosmap(int oparg, uint32_t *uaddr, int *oldval);
int futex_xorl_smap(int oparg, uint32_t *uaddr, int *oldval); int futex_xorl_smap(int oparg, uint32_t *uaddr, int *oldval);
DEFINE_IFUNC(, int, futex_xorl, (int, uint32_t *, int *), static) DEFINE_IFUNC(, int, futex_xorl, (int, uint32_t *, int *))
{ {
return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ?

View File

@ -739,7 +739,7 @@ linux_set_thread_area(struct thread *td,
int futex_xchgl_nosmap(int oparg, uint32_t *uaddr, int *oldval); int futex_xchgl_nosmap(int oparg, uint32_t *uaddr, int *oldval);
int futex_xchgl_smap(int oparg, uint32_t *uaddr, int *oldval); int futex_xchgl_smap(int oparg, uint32_t *uaddr, int *oldval);
DEFINE_IFUNC(, int, futex_xchgl, (int, uint32_t *, int *), static) DEFINE_IFUNC(, int, futex_xchgl, (int, uint32_t *, int *))
{ {
return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ?
@ -748,7 +748,7 @@ DEFINE_IFUNC(, int, futex_xchgl, (int, uint32_t *, int *), static)
int futex_addl_nosmap(int oparg, uint32_t *uaddr, int *oldval); int futex_addl_nosmap(int oparg, uint32_t *uaddr, int *oldval);
int futex_addl_smap(int oparg, uint32_t *uaddr, int *oldval); int futex_addl_smap(int oparg, uint32_t *uaddr, int *oldval);
DEFINE_IFUNC(, int, futex_addl, (int, uint32_t *, int *), static) DEFINE_IFUNC(, int, futex_addl, (int, uint32_t *, int *))
{ {
return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ?
@ -757,7 +757,7 @@ DEFINE_IFUNC(, int, futex_addl, (int, uint32_t *, int *), static)
int futex_orl_nosmap(int oparg, uint32_t *uaddr, int *oldval); int futex_orl_nosmap(int oparg, uint32_t *uaddr, int *oldval);
int futex_orl_smap(int oparg, uint32_t *uaddr, int *oldval); int futex_orl_smap(int oparg, uint32_t *uaddr, int *oldval);
DEFINE_IFUNC(, int, futex_orl, (int, uint32_t *, int *), static) DEFINE_IFUNC(, int, futex_orl, (int, uint32_t *, int *))
{ {
return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ?
@ -766,7 +766,7 @@ DEFINE_IFUNC(, int, futex_orl, (int, uint32_t *, int *), static)
int futex_andl_nosmap(int oparg, uint32_t *uaddr, int *oldval); int futex_andl_nosmap(int oparg, uint32_t *uaddr, int *oldval);
int futex_andl_smap(int oparg, uint32_t *uaddr, int *oldval); int futex_andl_smap(int oparg, uint32_t *uaddr, int *oldval);
DEFINE_IFUNC(, int, futex_andl, (int, uint32_t *, int *), static) DEFINE_IFUNC(, int, futex_andl, (int, uint32_t *, int *))
{ {
return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ?
@ -775,7 +775,7 @@ DEFINE_IFUNC(, int, futex_andl, (int, uint32_t *, int *), static)
int futex_xorl_nosmap(int oparg, uint32_t *uaddr, int *oldval); int futex_xorl_nosmap(int oparg, uint32_t *uaddr, int *oldval);
int futex_xorl_smap(int oparg, uint32_t *uaddr, int *oldval); int futex_xorl_smap(int oparg, uint32_t *uaddr, int *oldval);
DEFINE_IFUNC(, int, futex_xorl, (int, uint32_t *, int *), static) DEFINE_IFUNC(, int, futex_xorl, (int, uint32_t *, int *))
{ {
return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ?

View File

@ -32,17 +32,17 @@
#ifndef __ARM64_IFUNC_H #ifndef __ARM64_IFUNC_H
#define __ARM64_IFUNC_H #define __ARM64_IFUNC_H
#define DEFINE_IFUNC(qual, ret_type, name, args, resolver_qual) \ #define DEFINE_IFUNC(qual, ret_type, name, args) \
resolver_qual ret_type (*name##_resolver(void))args __used; \ static ret_type (*name##_resolver(void))args __used; \
qual ret_type name args __attribute__((ifunc(#name "_resolver"))); \ qual ret_type name args __attribute__((ifunc(#name "_resolver"))); \
resolver_qual ret_type (*name##_resolver(void))args static ret_type (*name##_resolver(void))args
#define DEFINE_UIFUNC(qual, ret_type, name, args, resolver_qual) \ #define DEFINE_UIFUNC(qual, ret_type, name, args) \
resolver_qual ret_type (*name##_resolver(uint64_t, uint64_t, \ static ret_type (*name##_resolver(uint64_t, uint64_t, \
uint64_t, uint64_t, uint64_t, uint64_t, uint64_t, \ uint64_t, uint64_t, uint64_t, uint64_t, uint64_t, \
uint64_t))args __used; \ uint64_t))args __used; \
qual ret_type name args __attribute__((ifunc(#name "_resolver"))); \ qual ret_type name args __attribute__((ifunc(#name "_resolver"))); \
resolver_qual ret_type (*name##_resolver(uint64_t _arg1 __unused, \ static ret_type (*name##_resolver(uint64_t _arg1 __unused, \
uint64_t _arg2 __unused, uint64_t _arg3 __unused, \ uint64_t _arg2 __unused, uint64_t _arg3 __unused, \
uint64_t _arg4 __unused, uint64_t _arg5 __unused, \ uint64_t _arg4 __unused, uint64_t _arg5 __unused, \
uint64_t _arg6 __unused, uint64_t _arg7 __unused, \ uint64_t _arg6 __unused, uint64_t _arg7 __unused, \

View File

@ -671,7 +671,7 @@ dtrace_fuword64(void *uaddr)
*/ */
void dtrace_copy_nosmap(uintptr_t, uintptr_t, size_t); void dtrace_copy_nosmap(uintptr_t, uintptr_t, size_t);
void dtrace_copy_smap(uintptr_t, uintptr_t, size_t); void dtrace_copy_smap(uintptr_t, uintptr_t, size_t);
DEFINE_IFUNC(, void, dtrace_copy, (uintptr_t, uintptr_t, size_t), static) DEFINE_IFUNC(, void, dtrace_copy, (uintptr_t, uintptr_t, size_t))
{ {
return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ?
@ -681,7 +681,7 @@ DEFINE_IFUNC(, void, dtrace_copy, (uintptr_t, uintptr_t, size_t), static)
void dtrace_copystr_nosmap(uintptr_t, uintptr_t, size_t, volatile uint16_t *); void dtrace_copystr_nosmap(uintptr_t, uintptr_t, size_t, volatile uint16_t *);
void dtrace_copystr_smap(uintptr_t, uintptr_t, size_t, volatile uint16_t *); void dtrace_copystr_smap(uintptr_t, uintptr_t, size_t, volatile uint16_t *);
DEFINE_IFUNC(, void, dtrace_copystr, (uintptr_t, uintptr_t, size_t, DEFINE_IFUNC(, void, dtrace_copystr, (uintptr_t, uintptr_t, size_t,
volatile uint16_t *), static) volatile uint16_t *))
{ {
return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ?
@ -690,7 +690,7 @@ DEFINE_IFUNC(, void, dtrace_copystr, (uintptr_t, uintptr_t, size_t,
uintptr_t dtrace_fulword_nosmap(void *); uintptr_t dtrace_fulword_nosmap(void *);
uintptr_t dtrace_fulword_smap(void *); uintptr_t dtrace_fulword_smap(void *);
DEFINE_IFUNC(, uintptr_t, dtrace_fulword, (void *), static) DEFINE_IFUNC(, uintptr_t, dtrace_fulword, (void *))
{ {
return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ?
@ -699,7 +699,7 @@ DEFINE_IFUNC(, uintptr_t, dtrace_fulword, (void *), static)
uint8_t dtrace_fuword8_nocheck_nosmap(void *); uint8_t dtrace_fuword8_nocheck_nosmap(void *);
uint8_t dtrace_fuword8_nocheck_smap(void *); uint8_t dtrace_fuword8_nocheck_smap(void *);
DEFINE_IFUNC(, uint8_t, dtrace_fuword8_nocheck, (void *), static) DEFINE_IFUNC(, uint8_t, dtrace_fuword8_nocheck, (void *))
{ {
return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ?
@ -708,7 +708,7 @@ DEFINE_IFUNC(, uint8_t, dtrace_fuword8_nocheck, (void *), static)
uint16_t dtrace_fuword16_nocheck_nosmap(void *); uint16_t dtrace_fuword16_nocheck_nosmap(void *);
uint16_t dtrace_fuword16_nocheck_smap(void *); uint16_t dtrace_fuword16_nocheck_smap(void *);
DEFINE_IFUNC(, uint16_t, dtrace_fuword16_nocheck, (void *), static) DEFINE_IFUNC(, uint16_t, dtrace_fuword16_nocheck, (void *))
{ {
return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ?
@ -717,7 +717,7 @@ DEFINE_IFUNC(, uint16_t, dtrace_fuword16_nocheck, (void *), static)
uint32_t dtrace_fuword32_nocheck_nosmap(void *); uint32_t dtrace_fuword32_nocheck_nosmap(void *);
uint32_t dtrace_fuword32_nocheck_smap(void *); uint32_t dtrace_fuword32_nocheck_smap(void *);
DEFINE_IFUNC(, uint32_t, dtrace_fuword32_nocheck, (void *), static) DEFINE_IFUNC(, uint32_t, dtrace_fuword32_nocheck, (void *))
{ {
return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ?
@ -726,7 +726,7 @@ DEFINE_IFUNC(, uint32_t, dtrace_fuword32_nocheck, (void *), static)
uint64_t dtrace_fuword64_nocheck_nosmap(void *); uint64_t dtrace_fuword64_nocheck_nosmap(void *);
uint64_t dtrace_fuword64_nocheck_smap(void *); uint64_t dtrace_fuword64_nocheck_smap(void *);
DEFINE_IFUNC(, uint64_t, dtrace_fuword64_nocheck, (void *), static) DEFINE_IFUNC(, uint64_t, dtrace_fuword64_nocheck, (void *))
{ {
return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ?

View File

@ -104,7 +104,7 @@ x86_unimpl_store(u_long *buf __unused)
panic("%s called", __func__); panic("%s called", __func__);
} }
DEFINE_IFUNC(static, int, x86_rng_store, (u_long *buf), static) DEFINE_IFUNC(static, int, x86_rng_store, (u_long *buf))
{ {
has_rdrand = (cpu_feature2 & CPUID2_RDRAND); has_rdrand = (cpu_feature2 & CPUID2_RDRAND);
has_rdseed = (cpu_stdext_feature & CPUID_STDEXT_RDSEED); has_rdseed = (cpu_stdext_feature & CPUID_STDEXT_RDSEED);

View File

@ -352,7 +352,7 @@ init_xsave(void)
TUNABLE_INT_FETCH("hw.use_xsave", &use_xsave); TUNABLE_INT_FETCH("hw.use_xsave", &use_xsave);
} }
DEFINE_IFUNC(, void, fpusave, (union savefpu *), static) DEFINE_IFUNC(, void, fpusave, (union savefpu *))
{ {
init_xsave(); init_xsave();

View File

@ -288,8 +288,7 @@ pmap_flush_page(vm_page_t m)
pmap_methods_ptr->pm_flush_page(m); pmap_methods_ptr->pm_flush_page(m);
} }
DEFINE_IFUNC(, void, pmap_invalidate_cache_range, (vm_offset_t, vm_offset_t), DEFINE_IFUNC(, void, pmap_invalidate_cache_range, (vm_offset_t, vm_offset_t))
static)
{ {
if ((cpu_feature & CPUID_SS) != 0) if ((cpu_feature & CPUID_SS) != 0)

View File

@ -32,16 +32,16 @@
#ifndef __X86_IFUNC_H #ifndef __X86_IFUNC_H
#define __X86_IFUNC_H #define __X86_IFUNC_H
#define DEFINE_IFUNC(qual, ret_type, name, args, resolver_qual) \ #define DEFINE_IFUNC(qual, ret_type, name, args) \
resolver_qual ret_type (*name##_resolver(void))args __used; \ static ret_type (*name##_resolver(void))args __used; \
qual ret_type name args __attribute__((ifunc(#name "_resolver"))); \ qual ret_type name args __attribute__((ifunc(#name "_resolver"))); \
resolver_qual ret_type (*name##_resolver(void))args static ret_type (*name##_resolver(void))args
#define DEFINE_UIFUNC(qual, ret_type, name, args, resolver_qual) \ #define DEFINE_UIFUNC(qual, ret_type, name, args) \
resolver_qual ret_type (*name##_resolver(uint32_t, uint32_t, \ static ret_type (*name##_resolver(uint32_t, uint32_t, uint32_t, \
uint32_t, uint32_t))args __used; \ uint32_t))args __used; \
qual ret_type name args __attribute__((ifunc(#name "_resolver"))); \ qual ret_type name args __attribute__((ifunc(#name "_resolver"))); \
resolver_qual ret_type (*name##_resolver( \ static ret_type (*name##_resolver( \
uint32_t cpu_feature __unused, \ uint32_t cpu_feature __unused, \
uint32_t cpu_feature2 __unused, \ uint32_t cpu_feature2 __unused, \
uint32_t cpu_stdext_feature __unused, \ uint32_t cpu_stdext_feature __unused, \