reset_primary()c
| 2025-1-4
本文字數 558閱讀時長 2 分鐘
  • reset_primary()
    • Zero .bss section.
      • set_tp()
        • Set $tp to thread_core_local[hartid].
        • Save current hart ID to thread_core_local[hartid].hart_id.
    • thread_init_thread_core_local()
      • Set thread_core_local.curr_thread to THREAD_ID_INVALID for all cores (CFG_TEE_CORE_NB_CORE).
      • Set thread_core_local.flag to THREAD_CLF_TMP to indicate that it’s using the temporary stack for all cores (CFG_TEE_CORE_NB_CORE).
      • Set first core’s thread_core_local[0].tmp_stack_va_end to stack_tmp[0].
    • plat_primary_init_early()
      • Do nothing right now.
    • console_init()
      • In Andes’ demo, semihosting is used to print out the console.
    • core_init_mmu_map()
      • set_satp()
        • Set $satp to core_mmu_config.satp[hartid].
    • boot_init_primary_early()
    • boot_init_primary_late()
    • Sync boot core and secondary cores.
    • thread_clr_boot_thread()
      • Set current thread (l->curr_thread)’s state to THREAD_STATE_FREE.
      • Set l->curr_thread to THREAD_ID_INVALID.
    • thread_return_to_udomain()
      • Before calling:
        • $a0 is set to TEEABI_OPTEED_RETURN_ENTRY_DONE.
        • $a1 is set to thread_vector_table.
        • $a3 ~ $a5 are set to 0.
      • This will eventually set entry_vector_table in OpenSBI.
Loading...
目錄