diff options
author | Jerome Forissier <jerome.forissier@linaro.org> | 2016-04-18 09:35:34 +0200 |
---|---|---|
committer | Jerome Forissier <jerome.forissier@linaro.org> | 2016-05-09 11:44:19 +0200 |
commit | b44708c1c842a9e1ebb63c7f6b43774795669c7a (patch) | |
tree | 7880a6e24702f542d74b55a216ede81a131fcb58 /core/tee/tee_pobj.c | |
parent | ca3a35827698ad5d715c5bacb6d59f035bf9d042 (diff) |
core: secure storage: dual filesystems support
Adds support for multiple filesystems by keeping a pointer to
tee_file_operations in the tee_pobj and tee_storage_enum structures.
Two identifiers are added to the API to be used as the storage_id
parameter, so that TAs may dynamically choose the filesystem:
- TEE_STORAGE_PRIVATE_REE (requires CFG_REE_FS=y)
- TEE_STORAGE_PRIVATE_RPMB (requires CFG_RPMB_FS=y)
The value TEE_STORAGE_PRIVATE will select the REE FS if available,
otherwise RPMB. At least one FS has to be enabled at build time. Only
the REE filesystem is enabled by default.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Pascal Brand <pascal.brand@linaro.org>
Diffstat (limited to 'core/tee/tee_pobj.c')
-rw-r--r-- | core/tee/tee_pobj.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/core/tee/tee_pobj.c b/core/tee/tee_pobj.c index 574b66b3..e25ce1eb 100644 --- a/core/tee/tee_pobj.c +++ b/core/tee/tee_pobj.c @@ -79,7 +79,8 @@ static TEE_Result tee_pobj_check_access(uint32_t oflags, uint32_t nflags) } TEE_Result tee_pobj_get(TEE_UUID *uuid, void *obj_id, uint32_t obj_id_len, - uint32_t flags, struct tee_pobj **obj) + uint32_t flags, const struct tee_file_operations *fops, + struct tee_pobj **obj) { struct tee_pobj *o; TEE_Result res; @@ -90,7 +91,8 @@ TEE_Result tee_pobj_get(TEE_UUID *uuid, void *obj_id, uint32_t obj_id_len, TAILQ_FOREACH(o, &tee_pobjs, link) { if ((obj_id_len == o->obj_id_len) && (memcmp(obj_id, o->obj_id, obj_id_len) == 0) && - (memcmp(uuid, &o->uuid, sizeof(TEE_UUID)) == 0)) { + (memcmp(uuid, &o->uuid, sizeof(TEE_UUID)) == 0) && + (fops == o->fops)) { *obj = o; } } @@ -115,6 +117,7 @@ TEE_Result tee_pobj_get(TEE_UUID *uuid, void *obj_id, uint32_t obj_id_len, o->refcnt = 1; memcpy(&o->uuid, uuid, sizeof(TEE_UUID)); o->flags = flags; + o->fops = fops; o->obj_id = malloc(obj_id_len); if (o->obj_id == NULL) { |