+struct sgx_enclave_regs {
+ __u64 rdi;
+ __u64 rsi;
+ __u64 rdx;
+ __u64 r8;
+ __u64 r9;
+ __u64 r10;
+};
+/**
+ * struct sgx_enclave_exception - structure to pass register in/out of enclave
+ * by way of __vdso_sgx_enter_enclave
+ *
+ * @rdi: value of %rdi, loaded/saved on enter/exit
+ * @rsi: value of %rsi, loaded/saved on enter/exit
+ * @rdx: value of %rdx, loaded/saved on enter/exit
+ * @r8: value of %r8, loaded/saved on enter/exit
+ * @r9: value of %r9, loaded/saved on enter/exit
+ * @r10: value of %r10, loaded/saved on enter/exit
+ */
+ /* load leaf, TCS and AEP for ENCLU */
+ mov %edi, %eax
+ mov %rsi, %rbx
+ lea 1f(%rip), %rcx
+
+ /* optionally copy @regs to registers */
+ test %rdx, %rdx
+ je 1f
+
+ mov %rdx, %r11
+ mov RDI(%r11), %rdi
+ mov RSI(%r11), %rsi
+ mov RDX(%r11), %rdx
+ mov R8(%r11), %r8
+ mov R9(%r11), %r9
+ mov R10(%r11), %r10
+
+1: enclu
+
+ /* ret = 0 */
+ xor %eax, %eax
+
+ /* optionally copy registers to @regs */
+ mov -0x8(%rsp), %r11
+ test %r11, %r11
+ je 2f
+
+ mov %rdi, RDI(%r11)
+ mov %rsi, RSI(%r11)
+ mov %rdx, RDX(%r11)
+ mov %r8, R8(%r11)
+ mov %r9, R9(%r11)
+ mov %r10, R10(%r11)
+2: pop %rbx
+ pop %r12
+ pop %r13
+ pop %r14
+ pop %r15
+ pop %rbp
+ ret
Attachment:
smime.p7s
Description: S/MIME Cryptographic Signature