summaryrefslogtreecommitdiff
path: root/usr/src/compat
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/compat')
-rw-r--r--usr/src/compat/freebsd/amd64/machine/cpufunc.h19
-rw-r--r--usr/src/compat/freebsd/amd64/machine/param.h2
-rw-r--r--usr/src/compat/freebsd/amd64/machine/specialreg.h16
3 files changed, 37 insertions, 0 deletions
diff --git a/usr/src/compat/freebsd/amd64/machine/cpufunc.h b/usr/src/compat/freebsd/amd64/machine/cpufunc.h
index 005a76b305..0b7bcdaa59 100644
--- a/usr/src/compat/freebsd/amd64/machine/cpufunc.h
+++ b/usr/src/compat/freebsd/amd64/machine/cpufunc.h
@@ -288,5 +288,24 @@ load_dr7(uint64_t dr7)
__asm __volatile("movq %0,%%dr7" : : "r" (dr7));
}
+#ifdef _KERNEL
+/*
+ * Including the native sys/segments.h in userspace seriously conflicts with
+ * the FreeBSD compat/contrib headers.
+ */
+#include <sys/segments.h>
+
+static __inline void
+lldt(u_short sel)
+{
+ wr_ldtr(sel);
+}
+
+static __inline u_short
+sldt()
+{
+ return (rd_ldtr());
+}
+#endif /* _KERNEL */
#endif /* _COMPAT_FREEBSD_AMD64_MACHINE_CPUFUNC_H_ */
diff --git a/usr/src/compat/freebsd/amd64/machine/param.h b/usr/src/compat/freebsd/amd64/machine/param.h
index eaca5ab8d7..b152f4d526 100644
--- a/usr/src/compat/freebsd/amd64/machine/param.h
+++ b/usr/src/compat/freebsd/amd64/machine/param.h
@@ -36,4 +36,6 @@
/* Size of the level 4 page-map level-4 table units */
#define NPML4EPG (PAGE_SIZE/(sizeof (pml4_entry_t)))
+#define CACHE_LINE_SIZE 64
+
#endif /* _COMPAT_FREEBSD_AMD64_MACHINE_PARAM_H_ */
diff --git a/usr/src/compat/freebsd/amd64/machine/specialreg.h b/usr/src/compat/freebsd/amd64/machine/specialreg.h
index 59fc064a4c..e1e6543701 100644
--- a/usr/src/compat/freebsd/amd64/machine/specialreg.h
+++ b/usr/src/compat/freebsd/amd64/machine/specialreg.h
@@ -36,9 +36,25 @@
#undef CR4_PCE
#undef CR4_VMXE
#undef CR4_SMEP
+#undef CR4_SMAP
#undef CR4_FSGSBASE
#undef CR4_PCIDE
#endif /* _SYS_CONTROLREGS_H */
+#ifdef _SYS_X86_ARCHEXT_H
+/* Our IA32 speculation-related defines conflict with BSD header */
+#undef IA32_ARCH_CAP_RDCL_NO
+#undef IA32_ARCH_CAP_IBRS_ALL
+#undef IA32_ARCH_CAP_RSBA
+#undef IA32_ARCH_CAP_SKIP_L1DFL_VMENTRY
+#undef IA32_ARCH_CAP_SSB_NO
+#undef IA32_SPEC_CTRL_IBRS
+#undef IA32_SPEC_CTRL_STIBP
+#undef IA32_SPEC_CTRL_SSBD
+#undef IA32_FLUSH_CMD_L1D
+#undef MSR_IA32_SPEC_CTRL
+#undef MSR_IA32_PRED_CMD
+#endif /* _SYS_X86_ARCHEXT_H */
+
#include <x86/specialreg.h>
#endif /* _COMPAT_FREEBSD_AMD64_MACHINE_SPECIALREG_H_ */