static void main_tee_entry(struct thread_smc_args *args) { /* * This function first catches all ST specific SMC functions * if none matches, the generic tee_entry is called. */ if (args->a0 == TEESMC32_ST_FASTCALL_GET_SHM_CONFIG) { args->a0 = TEESMC_RETURN_OK; args->a1 = default_nsec_shm_paddr; args->a2 = default_nsec_shm_size; /* Should this be TEESMC cache attributes instead? */ args->a3 = core_mmu_is_shm_cached(); return; } if (args->a0 == TEESMC32_ST_FASTCALL_L2CC_MUTEX) { switch (args->a1) { case TEESMC_ST_L2CC_MUTEX_GET_ADDR: case TEESMC_ST_L2CC_MUTEX_SET_ADDR: case TEESMC_ST_L2CC_MUTEX_ENABLE: case TEESMC_ST_L2CC_MUTEX_DISABLE: /* TODO call the appropriate internal functions */ args->a0 = TEESMC_RETURN_UNKNOWN_FUNCTION; return; default: args->a0 = TEESMC_RETURN_EBADCMD; return; } } tee_entry(args); }
static void main_fastcall(struct thread_smc_args *args) { kprintf("%s\n", __func__); tee_entry(args); }