int thread_state_suspend(uint32_t flags, uint32_t cpsr, uint32_t pc) { struct thread_core_local *l = get_core_local(); int ct = l->curr_thread; assert(ct != -1); check_canaries(); lock_global(); assert(threads[ct].state == THREAD_STATE_ACTIVE); threads[ct].flags |= flags; threads[ct].regs.cpsr = cpsr; threads[ct].regs.pc = pc; threads[ct].state = THREAD_STATE_SUSPENDED; threads[ct].have_user_map = !tee_mmu_is_kernel_mapping(); if (threads[ct].have_user_map) { tee_mmu_get_map(&threads[ct].user_map); tee_mmu_set_map(NULL); } l->curr_thread = -1; unlock_global(); return ct; }
void thread_handle_std_smc(struct thread_smc_args *args) { check_canaries(); if (args->a0 == TEESMC32_CALL_RETURN_FROM_RPC) thread_resume_from_rpc(args); else thread_alloc_and_run(args); }
void thread_handle_smc_call(struct thread_smc_args *args) { check_canaries(); if (TEESMC_IS_FAST_CALL(args->a0)) { thread_fastcall_handler_ptr(args); } else { if (args->a0 == TEESMC32_CALL_RETURN_FROM_RPC) thread_resume_from_rpc(args); else thread_alloc_and_run(args); } }
void thread_handle_fast_smc(struct thread_smc_args *args) { check_canaries(); thread_fast_smc_handler_ptr(args); }