1 /**************************************************************************** 2 **************************************************************************** 3 *** 4 *** This header was automatically generated from a Linux kernel header 5 *** of the same name, to make information necessary for userspace to 6 *** call into the kernel available to libc. It contains only constants, 7 *** structures, and macros generated from the original header, and thus, 8 *** contains no copyrightable information. 9 *** 10 *** To edit the content of this header, modify the corresponding 11 *** source file (e.g. under external/kernel-headers/original/) then 12 *** run bionic/libc/kernel/tools/update_all.py 13 *** 14 *** Any manual change here will be lost the next time this script will 15 *** be run. You've been warned! 16 *** 17 **************************************************************************** 18 ****************************************************************************/ 19 #ifndef _UAPI_LINUX_NITRO_ENCLAVES_H_ 20 #define _UAPI_LINUX_NITRO_ENCLAVES_H_ 21 #include <linux/types.h> 22 #define NE_CREATE_VM _IOR(0xAE, 0x20, __u64) 23 #define NE_ADD_VCPU _IOWR(0xAE, 0x21, __u32) 24 #define NE_GET_IMAGE_LOAD_INFO _IOWR(0xAE, 0x22, struct ne_image_load_info) 25 #define NE_SET_USER_MEMORY_REGION _IOW(0xAE, 0x23, struct ne_user_memory_region) 26 #define NE_START_ENCLAVE _IOWR(0xAE, 0x24, struct ne_enclave_start_info) 27 #define NE_ERR_VCPU_ALREADY_USED (256) 28 #define NE_ERR_VCPU_NOT_IN_CPU_POOL (257) 29 #define NE_ERR_VCPU_INVALID_CPU_CORE (258) 30 #define NE_ERR_INVALID_MEM_REGION_SIZE (259) 31 #define NE_ERR_INVALID_MEM_REGION_ADDR (260) 32 #define NE_ERR_UNALIGNED_MEM_REGION_ADDR (261) 33 #define NE_ERR_MEM_REGION_ALREADY_USED (262) 34 #define NE_ERR_MEM_NOT_HUGE_PAGE (263) 35 #define NE_ERR_MEM_DIFFERENT_NUMA_NODE (264) 36 #define NE_ERR_MEM_MAX_REGIONS (265) 37 #define NE_ERR_NO_MEM_REGIONS_ADDED (266) 38 #define NE_ERR_NO_VCPUS_ADDED (267) 39 #define NE_ERR_ENCLAVE_MEM_MIN_SIZE (268) 40 #define NE_ERR_FULL_CORES_NOT_USED (269) 41 #define NE_ERR_NOT_IN_INIT_STATE (270) 42 #define NE_ERR_INVALID_VCPU (271) 43 #define NE_ERR_NO_CPUS_AVAIL_IN_POOL (272) 44 #define NE_ERR_INVALID_PAGE_SIZE (273) 45 #define NE_ERR_INVALID_FLAG_VALUE (274) 46 #define NE_ERR_INVALID_ENCLAVE_CID (275) 47 #define NE_EIF_IMAGE (0x01) 48 #define NE_IMAGE_LOAD_MAX_FLAG_VAL (0x02) 49 struct ne_image_load_info { 50 __u64 flags; 51 __u64 memory_offset; 52 }; 53 #define NE_DEFAULT_MEMORY_REGION (0x00) 54 #define NE_MEMORY_REGION_MAX_FLAG_VAL (0x01) 55 struct ne_user_memory_region { 56 __u64 flags; 57 __u64 memory_size; 58 __u64 userspace_addr; 59 }; 60 #define NE_ENCLAVE_PRODUCTION_MODE (0x00) 61 #define NE_ENCLAVE_DEBUG_MODE (0x01) 62 #define NE_ENCLAVE_START_MAX_FLAG_VAL (0x02) 63 struct ne_enclave_start_info { 64 __u64 flags; 65 __u64 enclave_cid; 66 }; 67 #endif 68