From f98ceb5bd21a051655726425f32ce4d8ca94cea3 Mon Sep 17 00:00:00 2001 From: kib Date: Sun, 14 Jan 2018 12:39:50 +0000 Subject: [PATCH] Add STAC and CLAC instructions wrappers. Reviewed by: jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D13838 --- sys/amd64/include/cpufunc.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sys/amd64/include/cpufunc.h b/sys/amd64/include/cpufunc.h index 17f919730c08..e50deb01964f 100644 --- a/sys/amd64/include/cpufunc.h +++ b/sys/amd64/include/cpufunc.h @@ -836,6 +836,20 @@ intr_restore(register_t rflags) write_rflags(rflags); } +static __inline void +stac(void) +{ + + __asm __volatile("stac" : : : "cc"); +} + +static __inline void +clac(void) +{ + + __asm __volatile("clac" : : : "cc"); +} + enum { SGX_ECREATE = 0x0, SGX_EADD = 0x1,