Lines Matching defs:ctx
94 struct trusty_cpu_ctx *ctx = get_trusty_ctx();
97 assert(ctx->saved_security_state != security_state);
125 ctx->saved_security_state = security_state;
126 ret_args = trusty_context_switch_helper(&ctx->saved_sp, &args);
128 assert(ctx->saved_security_state == ((security_state == 0U) ? 1U : 0U));
145 struct trusty_cpu_ctx *ctx = get_trusty_ctx();
154 if (ctx->fiq_handler_active != 0) {
159 ctx->fiq_handler_active = 1;
160 (void)memcpy(&ctx->fiq_gpregs, get_gpregs_ctx(handle), sizeof(ctx->fiq_gpregs));
161 ctx->fiq_pc = SMC_GET_EL3(handle, CTX_ELR_EL3);
162 ctx->fiq_cpsr = SMC_GET_EL3(handle, CTX_SPSR_EL3);
163 ctx->fiq_sp_el1 = read_ctx_reg(get_el1_sysregs_ctx(handle), CTX_SP_EL1);
165 write_ctx_reg(get_el1_sysregs_ctx(handle), CTX_SP_EL1, ctx->fiq_handler_sp);
166 cm_set_elr_spsr_el3(NON_SECURE, ctx->fiq_handler_pc, (uint32_t)ctx->fiq_handler_cpsr);
174 struct trusty_cpu_ctx *ctx;
181 ctx = &trusty_cpu_ctx[cpu];
182 ctx->fiq_handler_pc = handler;
183 ctx->fiq_handler_cpsr = SMC_GET_EL3(handle, CTX_SPSR_EL3);
184 ctx->fiq_handler_sp = stack;
191 struct trusty_cpu_ctx *ctx = get_trusty_ctx();
192 uint64_t sp_el0 = read_ctx_reg(&ctx->fiq_gpregs, CTX_GPREG_SP_EL0);
194 SMC_RET4(handle, ctx->fiq_pc, ctx->fiq_cpsr, sp_el0, ctx->fiq_sp_el1);
200 struct trusty_cpu_ctx *ctx = get_trusty_ctx();
202 if (ctx->fiq_handler_active == 0) {
222 (void)memcpy(get_gpregs_ctx(handle), &ctx->fiq_gpregs, sizeof(ctx->fiq_gpregs));
223 ctx->fiq_handler_active = 0;
224 write_ctx_reg(get_el1_sysregs_ctx(handle), CTX_SP_EL1, ctx->fiq_sp_el1);
225 cm_set_elr_spsr_el3(NON_SECURE, ctx->fiq_pc, (uint32_t)ctx->fiq_cpsr);
311 struct trusty_cpu_ctx *ctx = get_trusty_ctx();
313 uint64_t reg_width = GET_RW(read_ctx_reg(get_el3state_ctx(&ctx->cpu_ctx),
326 cm_set_context(&ctx->cpu_ctx, SECURE);
343 ctx->saved_security_state = ~0U; /* initial saved state is invalid */
344 (void)trusty_init_context_stack(&ctx->saved_sp, &ctx->secure_stack.end);
346 (void)trusty_context_switch_helper(&ctx->saved_sp, &zero_args);
386 struct trusty_cpu_ctx *ctx = get_trusty_ctx();
388 if (ctx->saved_sp == NULL) {