From 8684fde8008aa1569bedf4f8daa671461fd8d8b7 Mon Sep 17 00:00:00 2001 From: Jens Wiklander Date: Thu, 26 Nov 2015 14:01:49 +0100 Subject: core: split struct tee_ta_ctx Moves user ta specific parts into struct user_ta_ctx and static ta specific parts into struct static_ta_ctx. Reviewed-by: Pascal Brand Tested-by: Pascal Brand (STM platform) Reviewed-by: Joakim Bech Tested-by: Jens Wiklander (QEMU) Signed-off-by: Jens Wiklander --- core/tee/tee_obj.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'core/tee/tee_obj.c') diff --git a/core/tee/tee_obj.c b/core/tee/tee_obj.c index b8f70203..b6b160ac 100644 --- a/core/tee/tee_obj.c +++ b/core/tee/tee_obj.c @@ -36,17 +36,17 @@ #include #include -void tee_obj_add(struct tee_ta_ctx *ctx, struct tee_obj *o) +void tee_obj_add(struct user_ta_ctx *utc, struct tee_obj *o) { - TAILQ_INSERT_TAIL(&ctx->objects, o, link); + TAILQ_INSERT_TAIL(&utc->objects, o, link); } -TEE_Result tee_obj_get(struct tee_ta_ctx *ctx, uint32_t obj_id, +TEE_Result tee_obj_get(struct user_ta_ctx *utc, uint32_t obj_id, struct tee_obj **obj) { struct tee_obj *o; - TAILQ_FOREACH(o, &ctx->objects, link) { + TAILQ_FOREACH(o, &utc->objects, link) { if (obj_id == (vaddr_t)o) { *obj = o; return TEE_SUCCESS; @@ -55,9 +55,9 @@ TEE_Result tee_obj_get(struct tee_ta_ctx *ctx, uint32_t obj_id, return TEE_ERROR_BAD_PARAMETERS; } -void tee_obj_close(struct tee_ta_ctx *ctx, struct tee_obj *o) +void tee_obj_close(struct user_ta_ctx *utc, struct tee_obj *o) { - TAILQ_REMOVE(&ctx->objects, o, link); + TAILQ_REMOVE(&utc->objects, o, link); if ((o->info.handleFlags & TEE_HANDLE_FLAG_PERSISTENT) && o->fd >= 0) { tee_file_ops.close(o->fd); @@ -70,12 +70,12 @@ void tee_obj_close(struct tee_ta_ctx *ctx, struct tee_obj *o) free(o); } -void tee_obj_close_all(struct tee_ta_ctx *ctx) +void tee_obj_close_all(struct user_ta_ctx *utc) { - struct tee_obj_head *objects = &ctx->objects; + struct tee_obj_head *objects = &utc->objects; while (!TAILQ_EMPTY(objects)) - tee_obj_close(ctx, TAILQ_FIRST(objects)); + tee_obj_close(utc, TAILQ_FIRST(objects)); } TEE_Result tee_obj_verify(struct tee_ta_session *sess, struct tee_obj *o) @@ -106,7 +106,7 @@ TEE_Result tee_obj_verify(struct tee_ta_session *sess, struct tee_obj *o) if (fd < 0) { if (res == TEE_ERROR_CORRUPT_OBJECT) { EMSG("Object corrupt\n"); - tee_obj_close(sess->ctx, o); + tee_obj_close(to_user_ta_ctx(sess->ctx), o); tee_file_ops.unlink(file); dir = tee_svc_storage_create_dirname(sess); if (dir != NULL) { -- cgit v1.2.3