Javier
On 23 Mar 2015, at 12:18, Jens Wiklander jens.wiklander@linaro.org wrote:
On Mon, Mar 23, 2015 at 11:07:57AM +0100, Joakim Bech wrote: [...]
- Identifies the generic TEE driver, and the specific TEE driver.
- */
+struct tee_version {
uint32_t gen_version;
What about uint32_t vs __u32 an so on in things shared with user space? See Documentation/CodingStyle (and an interesting discussion here: http://yarchive.net/comp/linux/kernel_headers.html)
I'm in favor of using __u32 instead after reading that link. I'll update if no one objects.
+1
[...]
+struct tee_mem_share_data {
union {
struct tee_mem_buf buf;
struct tee_mem_dma_buf dma_buf;
};
uint32_t flags;
uint32_t pad;
+};
Yet another Shared Memory structure ;) How could we make more explicit the name "tee_mem_share_data" (YASM will not be accepted ;) )
Perhaps we should tie the different structs close to the IOCTL defines in this file. These structs are only used to pass parameter to the ioctl in questsion. The subsystem will use different types internally.
I think that is a good idea. Another thing, I've touched it before, do we actually need to have the word "mem" everywhere? tee_shm (which clashes with name in the other h-file, so that exact name wouldn't work here), tee_buf and tee_dma_buf would be sufficient according to me.
I don't mind removing the "mem". I guess we should also rename TEE_IOC_MEM_SHARE and TEE_IOC_MEM_UNSHARE to TEE_IOC_SHARE and TEE_IOC_UNSHARE then?
I’m afraid it my end up being confusing if we remove all “mem” references, specially for ioctls. I would support leaving TEE_IOC_MEM_SHARE and TEE_IOC_MEM_UNSHARE as they are.
[...]
+/**
- TEE_IOC_MEM_SHARE - share a portion of user space memory with secure
OS
- Shares a portion of user space memory with secure OS.
- */
+#define TEE_IOC_MEM_SHARE _TEE_IOWR(3, struct tee_mem_share_data)
+/**
- TEE_IOC_MEM_UNSHARE - unshares a portion shared user space memory
- Unshares a portion of previously shared user space memory.
- */
+#define TEE_IOC_MEM_UNSHARE _TEE_IOWR(4, struct tee_mem_share_data)
-- Regards, Jens
Best, Javier.
Tee-dev mailing list Tee-dev@lists.linaro.org http://lists.linaro.org/mailman/listinfo/tee-dev