Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make up for the lack of intrinsic headers in Open Enclave #195

Merged
merged 1 commit into from
May 21, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/aal/aal_x86_sgx.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
#ifdef _MSC_VER
# include <immintrin.h>
# include <intrin.h>
#else
# include <emmintrin.h>
#endif

#if defined(__amd64__) || defined(__x86_64__) || defined(_M_X64) || \
Expand Down Expand Up @@ -34,15 +32,23 @@ namespace snmalloc
*/
static inline void pause()
{
#ifdef _MSC_VER
_mm_pause();
#else
asm volatile("pause");
#endif
}

/**
* Issue a prefetch hint at the specified address.
*/
static inline void prefetch(void* ptr)
{
#ifdef _MSC_VER
_mm_prefetch(reinterpret_cast<const char*>(ptr), _MM_HINT_T0);
#else
asm volatile("prefetcht0 %0" ::"m"(ptr));
#endif
}

/**
Expand Down