xref: /optee_os/core/include/tee/tee_pobj.h (revision 5a913ee74d3c71af2a2860ce8a4e7aeab2916f9b)
1 /* SPDX-License-Identifier: BSD-2-Clause */
2 /*
3  * Copyright (c) 2014, STMicroelectronics International N.V.
4  */
5 
6 #ifndef TEE_POBJ_H
7 #define TEE_POBJ_H
8 
9 #include <stdint.h>
10 #include <sys/queue.h>
11 #include <tee_api_types.h>
12 #include <tee/tee_fs.h>
13 
14 struct tee_pobj {
15 	TAILQ_ENTRY(tee_pobj) link;
16 	uint32_t refcnt;
17 	TEE_UUID uuid;
18 	void *obj_id;
19 	uint32_t obj_id_len;
20 	uint32_t flags;
21 	bool temporary;
22 	/* Filesystem handling this object */
23 	const struct tee_file_operations *fops;
24 };
25 
26 TEE_Result tee_pobj_get(TEE_UUID *uuid, void *obj_id, uint32_t obj_id_len,
27 			uint32_t flags, bool temporary,
28 			const struct tee_file_operations *fops,
29 			struct tee_pobj **obj);
30 
31 TEE_Result tee_pobj_release(struct tee_pobj *obj);
32 
33 TEE_Result tee_pobj_rename(struct tee_pobj *obj, void *obj_id,
34 			   uint32_t obj_id_len);
35 
36 #endif
37