void tee_mmu_set_ctx(struct tee_ta_ctx *ctx) { if (!ctx || !is_user_ta_ctx(ctx)) { core_mmu_set_user_map(NULL); } else { struct core_mmu_user_map map; struct user_ta_ctx *utc = to_user_ta_ctx(ctx); core_mmu_create_user_map(utc->mmu, utc->context, &map); core_mmu_set_user_map(&map); } }
void tee_mmu_set_ctx(struct tee_ta_ctx *ctx) { if (!ctx || !is_user_ta_ctx(ctx)) { core_mmu_set_user_map(NULL); #ifdef CFG_SMALL_PAGE_USER_TA /* * We're not needing the user page tables for the moment, * release them as some other thread may be waiting for * them. */ pgt_free(&thread_get_tsd()->pgt_cache); #endif } else { struct core_mmu_user_map map; struct user_ta_ctx *utc = to_user_ta_ctx(ctx); core_mmu_create_user_map(utc->mmu, utc->context, &map); core_mmu_set_user_map(&map); } thread_get_tsd()->ctx = ctx; }