1 /*===---- sgxintrin.h - X86 SGX intrinsics configuration -------------------===
3 * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 * See https://llvm.org/LICENSE.txt for license information.
5 * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 *===-----------------------------------------------------------------------===
10 #if !defined __X86INTRIN_H && !defined __IMMINTRIN_H
11 #error "Never use <sgxintrin.h> directly; include <x86intrin.h> instead."
17 #if __has_extension(gnu_asm)
19 /* Define the default attributes for the functions in this file. */
20 #define __DEFAULT_FN_ATTRS \
21 __attribute__((__always_inline__, __nodebug__, __target__("sgx")))
23 static __inline
unsigned int __DEFAULT_FN_ATTRS
24 _enclu_u32(unsigned int __leaf
, __SIZE_TYPE__ __d
[])
26 unsigned int __result
;
28 : "=a" (__result
), "=b" (__d
[0]), "=c" (__d
[1]), "=d" (__d
[2])
29 : "a" (__leaf
), "b" (__d
[0]), "c" (__d
[1]), "d" (__d
[2])
34 static __inline
unsigned int __DEFAULT_FN_ATTRS
35 _encls_u32(unsigned int __leaf
, __SIZE_TYPE__ __d
[])
37 unsigned int __result
;
39 : "=a" (__result
), "=b" (__d
[0]), "=c" (__d
[1]), "=d" (__d
[2])
40 : "a" (__leaf
), "b" (__d
[0]), "c" (__d
[1]), "d" (__d
[2])
45 static __inline
unsigned int __DEFAULT_FN_ATTRS
46 _enclv_u32(unsigned int __leaf
, __SIZE_TYPE__ __d
[])
48 unsigned int __result
;
50 : "=a" (__result
), "=b" (__d
[0]), "=c" (__d
[1]), "=d" (__d
[2])
51 : "a" (__leaf
), "b" (__d
[0]), "c" (__d
[1]), "d" (__d
[2])
56 #undef __DEFAULT_FN_ATTRS
58 #endif /* __has_extension(gnu_asm) */