Zhen Kong | 0e63d13 | 2017-03-07 19:01:55 -0800 | [diff] [blame] | 1 | #ifndef _UAPI_SMCINVOKE_H_ |
| 2 | #define _UAPI_SMCINVOKE_H_ |
| 3 | |
| 4 | #include <linux/types.h> |
| 5 | #include <linux/ioctl.h> |
| 6 | |
| 7 | #define SMCINVOKE_USERSPACE_OBJ_NULL -1 |
| 8 | |
| 9 | struct smcinvoke_buf { |
| 10 | uint64_t addr; |
| 11 | uint64_t size; |
| 12 | }; |
| 13 | |
| 14 | struct smcinvoke_obj { |
| 15 | int64_t fd; |
| 16 | int64_t reserved; |
| 17 | }; |
| 18 | |
| 19 | union smcinvoke_arg { |
| 20 | struct smcinvoke_buf b; |
| 21 | struct smcinvoke_obj o; |
| 22 | }; |
| 23 | |
| 24 | /* |
| 25 | * struct smcinvoke_cmd_req: This structure is transparently sent to TEE |
| 26 | * @op - Operation to be performed |
| 27 | * @counts - number of aruments passed |
| 28 | * @result - result of invoke operation |
| 29 | * @argsize - size of each of arguments |
| 30 | * @args - args is pointer to buffer having all arguments |
| 31 | */ |
| 32 | struct smcinvoke_cmd_req { |
| 33 | uint32_t op; |
| 34 | uint32_t counts; |
| 35 | int32_t result; |
| 36 | uint32_t argsize; |
| 37 | uint64_t __user args; |
| 38 | }; |
| 39 | |
| 40 | #define SMCINVOKE_IOC_MAGIC 0x98 |
| 41 | |
| 42 | #define SMCINVOKE_IOCTL_INVOKE_REQ \ |
| 43 | _IOWR(SMCINVOKE_IOC_MAGIC, 1, struct smcinvoke_cmd_req) |
| 44 | |
| 45 | #endif /* _UAPI_SMCINVOKE_H_ */ |