user_ta_enter()c
| 2024-11-25
本文字數 122閱讀時長 1 分鐘
  • user_ta_enter()
    • Call thread_enter_user_mode() to switch to U-mode. utc->utcx.entry_func (user TA’s entry function address, filled by ldelf) will be called after switching to U-mode.
      • E.g. For optee_example_hello_world, i.e. 8aaaf200-2450-11e4-abe2-0002a5d5c51b.elf, the entry_func is 0x400405f8 => __ta_entry().
        • __ta_entry() is the first user TA API called from TEE core (defined in ta/user_ta_header.c).
          • It’s assigned in TA’s Makefile:
            • __ta_entry() will call __utee_entry() (defined in lib/libutee/user_ta_entry.c) to invoke the function (e.g. TA_OpenSessionEntryPoint(), TA_InvokeCommandEntryPoint()… etc) defined by user TA based on function ID.
              • User TA is linked with libutee.
            • And the end, __ta_entry() will call __utee_return() (defined in lib/libutee/user_ta_entry.c), to return from user TA.
              • __utee_return() is actually a syscall, syscall ID: TEE_SCN_RETURN. Therefore, tee_ta_session->ts_sess.handle_scall, e.g. scall_handle_user_ta(), will eventually be called.
    Loading...
    目錄