Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame^] | 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 __TEE_H |
| 20 | #define __TEE_H |
| 21 | #include <linux/ioctl.h> |
| 22 | #include <linux/types.h> |
| 23 | #define TEE_IOC_MAGIC 0xa4 |
| 24 | #define TEE_IOC_BASE 0 |
| 25 | #define TEE_IOCTL_SHM_MAPPED 0x1 |
| 26 | #define TEE_IOCTL_SHM_DMA_BUF 0x2 |
| 27 | #define TEE_MAX_ARG_SIZE 1024 |
| 28 | #define TEE_GEN_CAP_GP (1 << 0) |
| 29 | #define TEE_IMPL_ID_OPTEE 1 |
| 30 | #define TEE_OPTEE_CAP_TZ (1 << 0) |
| 31 | struct tee_ioctl_version_data { |
| 32 | __u32 impl_id; |
| 33 | __u32 impl_caps; |
| 34 | __u32 gen_caps; |
| 35 | }; |
| 36 | #define TEE_IOC_VERSION _IOR(TEE_IOC_MAGIC, TEE_IOC_BASE + 0, struct tee_ioctl_version_data) |
| 37 | struct tee_ioctl_shm_alloc_data { |
| 38 | __u64 size; |
| 39 | __u32 flags; |
| 40 | __s32 id; |
| 41 | }; |
| 42 | #define TEE_IOC_SHM_ALLOC _IOWR(TEE_IOC_MAGIC, TEE_IOC_BASE + 1, struct tee_ioctl_shm_alloc_data) |
| 43 | struct tee_ioctl_buf_data { |
| 44 | __u64 buf_ptr; |
| 45 | __u64 buf_len; |
| 46 | }; |
| 47 | #define TEE_IOCTL_PARAM_ATTR_TYPE_NONE 0 |
| 48 | #define TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INPUT 1 |
| 49 | #define TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_OUTPUT 2 |
| 50 | #define TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INOUT 3 |
| 51 | #define TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INPUT 5 |
| 52 | #define TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_OUTPUT 6 |
| 53 | #define TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INOUT 7 |
| 54 | #define TEE_IOCTL_PARAM_ATTR_TYPE_MASK 0xff |
| 55 | #define TEE_IOCTL_LOGIN_PUBLIC 0 |
| 56 | #define TEE_IOCTL_LOGIN_USER 1 |
| 57 | #define TEE_IOCTL_LOGIN_GROUP 2 |
| 58 | #define TEE_IOCTL_LOGIN_APPLICATION 4 |
| 59 | #define TEE_IOCTL_LOGIN_USER_APPLICATION 5 |
| 60 | #define TEE_IOCTL_LOGIN_GROUP_APPLICATION 6 |
| 61 | struct tee_ioctl_param { |
| 62 | __u64 attr; |
| 63 | __u64 a; |
| 64 | __u64 b; |
| 65 | __u64 c; |
| 66 | }; |
| 67 | #define TEE_IOCTL_UUID_LEN 16 |
| 68 | struct tee_ioctl_open_session_arg { |
| 69 | __u8 uuid[TEE_IOCTL_UUID_LEN]; |
| 70 | __u8 clnt_uuid[TEE_IOCTL_UUID_LEN]; |
| 71 | __u32 clnt_login; |
| 72 | __u32 cancel_id; |
| 73 | __u32 session; |
| 74 | __u32 ret; |
| 75 | __u32 ret_origin; |
| 76 | __u32 num_params; |
| 77 | struct tee_ioctl_param params[]; |
| 78 | }; |
| 79 | #define TEE_IOC_OPEN_SESSION _IOR(TEE_IOC_MAGIC, TEE_IOC_BASE + 2, struct tee_ioctl_buf_data) |
| 80 | struct tee_ioctl_invoke_arg { |
| 81 | __u32 func; |
| 82 | __u32 session; |
| 83 | __u32 cancel_id; |
| 84 | __u32 ret; |
| 85 | __u32 ret_origin; |
| 86 | __u32 num_params; |
| 87 | struct tee_ioctl_param params[]; |
| 88 | }; |
| 89 | #define TEE_IOC_INVOKE _IOR(TEE_IOC_MAGIC, TEE_IOC_BASE + 3, struct tee_ioctl_buf_data) |
| 90 | struct tee_ioctl_cancel_arg { |
| 91 | __u32 cancel_id; |
| 92 | __u32 session; |
| 93 | }; |
| 94 | #define TEE_IOC_CANCEL _IOR(TEE_IOC_MAGIC, TEE_IOC_BASE + 4, struct tee_ioctl_cancel_arg) |
| 95 | struct tee_ioctl_close_session_arg { |
| 96 | __u32 session; |
| 97 | }; |
| 98 | #define TEE_IOC_CLOSE_SESSION _IOR(TEE_IOC_MAGIC, TEE_IOC_BASE + 5, struct tee_ioctl_close_session_arg) |
| 99 | struct tee_iocl_supp_recv_arg { |
| 100 | __u32 func; |
| 101 | __u32 num_params; |
| 102 | struct tee_ioctl_param params[]; |
| 103 | }; |
| 104 | #define TEE_IOC_SUPPL_RECV _IOR(TEE_IOC_MAGIC, TEE_IOC_BASE + 6, struct tee_ioctl_buf_data) |
| 105 | struct tee_iocl_supp_send_arg { |
| 106 | __u32 ret; |
| 107 | __u32 num_params; |
| 108 | struct tee_ioctl_param params[]; |
| 109 | }; |
| 110 | #define TEE_IOC_SUPPL_SEND _IOR(TEE_IOC_MAGIC, TEE_IOC_BASE + 7, struct tee_ioctl_buf_data) |
| 111 | #endif |