boot_init_primary_early()c
| 2025-1-4
本文字數 135閱讀時長 1 分鐘
  • boot_init_primary_early()
    • init_primary()
      • thread_init_core_local_stacks()
        • Set thread_core_local.tmp_stack_va_end to the per-core stack_tmp for all cores (CFG_TEE_CORE_NB_CORE).
          • Temporary stack (stack_tmp) is used in the non-thread context, e.g.
            • interrupt_from_kernel()
            • interrupt_from_user()
            • thread_std_abi_entry()
            • thread_rpc_xstatus()
        • Set thread_core_local.abt_stack_va_end to the per-core stack_abt for all cores (CFG_TEE_CORE_NB_CORE).
          • Abort stack (stack_abt) is used in the non-thread context for exception (except for ecall), e.g.
            • exception_from_kernel()
            • exception_from_user()
      • Call thread_set_exceptions() with THREAD_EXCP_ALL to mask both native and foreign interrupts.
      • init_runtime()
        • Add heap section to the malloc pool.
      • thread_init_boot_thread()
      • thread_init_primary()
        • thread_init_canaries()
        • init_user_kcode()
          • Do nothing in RISC-V.
        • thread_init_per_cpu()
          • Set mtvec/stvec to thread_trap_vect().
          • Set mscratch/sscratch to 0 to indicate that the following traps are from kernel.
        • init_sec_mon()
          • Do nothing as RISC-V doesn't have a secure monitor.
            • Secure monitor is OpenSBI.
Loading...
目錄