1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
3 * Copyright(c) 2016-20 Intel Corporation.
5 #ifndef _UAPI_ASM_X86_SGX_H
6 #define _UAPI_ASM_X86_SGX_H
8 #include <linux/types.h>
9 #include <linux/ioctl.h>
12 * enum sgx_epage_flags - page control flags
13 * %SGX_PAGE_MEASURE: Measure the page contents with a sequence of
14 * ENCLS[EEXTEND] operations.
17 SGX_PAGE_MEASURE = 0x01,
20 #define SGX_MAGIC 0xA4
22 #define SGX_IOC_ENCLAVE_CREATE \
23 _IOW(SGX_MAGIC, 0x00, struct sgx_enclave_create)
24 #define SGX_IOC_ENCLAVE_ADD_PAGES \
25 _IOWR(SGX_MAGIC, 0x01, struct sgx_enclave_add_pages)
26 #define SGX_IOC_ENCLAVE_INIT \
27 _IOW(SGX_MAGIC, 0x02, struct sgx_enclave_init)
28 #define SGX_IOC_ENCLAVE_PROVISION \
29 _IOW(SGX_MAGIC, 0x03, struct sgx_enclave_provision)
32 * struct sgx_enclave_create - parameter structure for the
33 * %SGX_IOC_ENCLAVE_CREATE ioctl
34 * @src: address for the SECS page data
36 struct sgx_enclave_create {
41 * struct sgx_enclave_add_pages - parameter structure for the
42 * %SGX_IOC_ENCLAVE_ADD_PAGE ioctl
43 * @src: start address for the page data
44 * @offset: starting page offset
45 * @length: length of the data (multiple of the page size)
46 * @secinfo: address for the SECINFO data
47 * @flags: page control flags
48 * @count: number of bytes added (multiple of the page size)
50 struct sgx_enclave_add_pages {
60 * struct sgx_enclave_init - parameter structure for the
61 * %SGX_IOC_ENCLAVE_INIT ioctl
62 * @sigstruct: address for the SIGSTRUCT data
64 struct sgx_enclave_init {
69 * struct sgx_enclave_provision - parameter structure for the
70 * %SGX_IOC_ENCLAVE_PROVISION ioctl
71 * @fd: file handle of /dev/sgx_provision
73 struct sgx_enclave_provision {
77 #endif /* _UAPI_ASM_X86_SGX_H */