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 enum tee_pobj_usage { 27 TEE_POBJ_USAGE_OPEN, 28 TEE_POBJ_USAGE_RENAME, 29 TEE_POBJ_USAGE_CREATE, 30 }; 31 32 TEE_Result tee_pobj_get(TEE_UUID *uuid, void *obj_id, uint32_t obj_id_len, 33 uint32_t flags, enum tee_pobj_usage usage, 34 const struct tee_file_operations *fops, 35 struct tee_pobj **obj); 36 37 TEE_Result tee_pobj_release(struct tee_pobj *obj); 38 39 TEE_Result tee_pobj_rename(struct tee_pobj *obj, void *obj_id, 40 uint32_t obj_id_len); 41 42 #endif 43