未验证 提交 30212200 编写于 作者: H haosanzi 提交者: GitHub

rune/libenclave/skeleton: Fix code style of sgxutils.c

Signed-off-by: NShirong Hao <shirong@linux.alibaba.com>
上级 d5cd6b8e
......@@ -10,8 +10,8 @@
/**
* enum sgx_epage_flags - page control flags
* %SGX_PAGE_MEASURE: Measure the page contents with a sequence of
* ENCLS[EEXTEND] operations.
* %SGX_PAGE_MEASURE: Measure the page contents with a
* sequence of ENCLS[EEXTEND] operations.
*/
enum sgx_page_flags {
SGX_PAGE_MEASURE = 0x01,
......
......@@ -7,14 +7,11 @@ static inline void cpuid(int *eax, int *ebx, int *ecx, int *edx)
{
#if defined(__x86_64__)
asm volatile ("cpuid"
: "=a" (*eax),
"=b" (*ebx),
"=c" (*ecx),
"=d" (*edx)
: "=a" (*eax), "=b" (*ebx), "=c" (*ecx), "=d" (*edx)
: "0" (*eax), "2" (*ecx)
: "memory");
#else
/*on 32bit, ebx can NOT be used as PIC code*/
/* on 32bit, ebx can NOT be used as PIC code */
asm volatile ("xchgl %%ebx, %1; cpuid; xchgl %%ebx, %1"
: "=a" (*eax), "=r" (*ebx), "=c" (*ecx), "=d" (*edx)
: "0" (*eax), "2" (*ecx)
......@@ -82,8 +79,7 @@ void get_sgx_xfrm_by_cpuid(uint64_t *xfrm)
__cpuidex(cpu_info, SGX_LEAF, 1);
if (false == try_get_xcr0(xfrm))
{
if (try_get_xcr0(xfrm) == false) {
// if XSAVE is supported, while XSAVEC is not supported,
// set xfrm to legacy, because XSAVEC cannot be executed within enclave.
*xfrm = SGX_XFRM_LEGACY;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册