2 * Copyright (c) 2014, STMicroelectronics International N.V.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License Version 2 as
6 * published by the Free Software Foundation.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
16 #include <linux/tee_client_api.h>
23 * struct tee_cmd_io - The command sent to an open tee device.
24 * @err: Error code (as in Global Platform TEE Client API spec)
25 * @origin: Origin for the error code (also from spec).
26 * @cmd: The command to be executed in the trusted application.
27 * @uuid: The uuid for the trusted application.
28 * @data: The trusted application or memory block.
29 * @data_size: The size of the trusted application or memory block.
30 * @op: The cmd payload operation for the trusted application.
32 * This structure is mainly used in the Linux kernel for communication
33 * with the user space.
41 * Here fd_sess is 32-bit variable. Since TEEC_Result also is defined as
42 * "uint32_t", this structure is aligned.
45 TEEC_UUID __user *uuid;
46 uint64_t padding_uuid;
50 uint64_t padding_data;
53 TEEC_Operation __user *op;
68 * Here fd_shm is 32-bit. To be compliant with the convention of file
69 * descriptor definition, fd_shm is defined as "int" type other
70 * than "int32_t". Even though using "int32_t" is more obvious to
71 * indicate that we intend to keep this structure aligned.
77 #define TEE_OPEN_SESSION_IOC _IOWR('t', 161, struct tee_cmd_io)
78 #define TEE_INVOKE_COMMAND_IOC _IOWR('t', 163, struct tee_cmd_io)
79 #define TEE_REQUEST_CANCELLATION_IOC _IOWR('t', 164, struct tee_cmd_io)
80 #define TEE_ALLOC_SHM_IOC _IOWR('t', 165, struct tee_shm_io)
81 #define TEE_GET_FD_FOR_RPC_SHM_IOC _IOWR('t', 167, struct tee_shm_io)
83 #endif /* _TEE_IOC_H */