Lines Matching refs:arg

352 static void entry_open_session(struct optee_msg_arg *arg, uint32_t num_params)  in entry_open_session()  argument
363 res = get_open_session_meta(num_params, arg->params, &num_meta, &uuid, in entry_open_session()
368 res = copy_in_params(arg->params + num_meta, num_params - num_meta, in entry_open_session()
377 copy_out_param(&param, num_params - num_meta, arg->params + num_meta, in entry_open_session()
393 arg->session = s->id; in entry_open_session()
395 arg->session = 0; in entry_open_session()
396 arg->ret = res; in entry_open_session()
397 arg->ret_origin = err_orig; in entry_open_session()
400 static void entry_close_session(struct optee_msg_arg *arg, uint32_t num_params) in entry_close_session() argument
413 s = tee_ta_find_session(arg->session, &tee_open_sessions); in entry_close_session()
416 arg->ret = res; in entry_close_session()
417 arg->ret_origin = TEE_ORIGIN_TEE; in entry_close_session()
420 static void entry_invoke_command(struct optee_msg_arg *arg, uint32_t num_params) in entry_invoke_command() argument
430 res = copy_in_params(arg->params, num_params, &param, saved_attr); in entry_invoke_command()
434 s = tee_ta_get_session(arg->session, true, &tee_open_sessions); in entry_invoke_command()
441 TEE_TIMEOUT_INFINITE, arg->func, &param); in entry_invoke_command()
447 copy_out_param(&param, num_params, arg->params, saved_attr); in entry_invoke_command()
452 arg->ret = res; in entry_invoke_command()
453 arg->ret_origin = err_orig; in entry_invoke_command()
456 static void entry_cancel(struct optee_msg_arg *arg, uint32_t num_params) in entry_cancel() argument
467 s = tee_ta_get_session(arg->session, false, &tee_open_sessions); in entry_cancel()
477 arg->ret = res; in entry_cancel()
478 arg->ret_origin = err_orig; in entry_cancel()
483 static void register_shm(struct optee_msg_arg *arg, uint32_t num_params) in register_shm() argument
488 arg->ret = TEE_ERROR_BAD_PARAMETERS; in register_shm()
491 (arg->params[0].attr != in register_shm()
495 tmem = &arg->params[0].u.tmem; in register_shm()
503 arg->ret = TEE_SUCCESS; in register_shm()
506 static void unregister_shm(struct optee_msg_arg *arg, uint32_t num_params) in unregister_shm() argument
509 uint64_t cookie = arg->params[0].u.rmem.shm_ref; in unregister_shm()
514 arg->ret = res; in unregister_shm()
516 arg->ret = TEE_ERROR_BAD_PARAMETERS; in unregister_shm()
517 arg->ret_origin = TEE_ORIGIN_TEE; in unregister_shm()
529 uint32_t __weak tee_entry_std(struct optee_msg_arg *arg, uint32_t num_params) in tee_entry_std() argument
531 return __tee_entry_std(arg, num_params); in tee_entry_std()
538 uint32_t __tee_entry_std(struct optee_msg_arg *arg, uint32_t num_params) in __tee_entry_std() argument
544 switch (arg->cmd) { in __tee_entry_std()
546 entry_open_session(arg, num_params); in __tee_entry_std()
549 entry_close_session(arg, num_params); in __tee_entry_std()
552 entry_invoke_command(arg, num_params); in __tee_entry_std()
555 entry_cancel(arg, num_params); in __tee_entry_std()
560 register_shm(arg, num_params); in __tee_entry_std()
563 unregister_shm(arg, num_params); in __tee_entry_std()
583 EMSG("Unknown cmd 0x%x", arg->cmd); in __tee_entry_std()