Move CpuSet out of ostd::arch and implement this_cpu

Co-authored-by: Chuandong Li <lichuand@pku.edu.cn>
This commit is contained in:
Zhang Junyang
2024-07-06 04:00:40 +00:00
committed by Tate, Hongliang Tian
parent da9f55b01f
commit 8acfc8eb6a
6 changed files with 152 additions and 91 deletions

View File

@ -57,7 +57,11 @@ pub use self::{cpu::cpu_local::CpuLocal, error::Error, prelude::Result};
/// make inter-initialization-dependencies more clear and reduce usages of
/// boot stage only global variables.
pub fn init() {
arch::before_all_init();
arch::enable_cpu_features();
arch::serial::init();
#[cfg(feature = "intel_tdx")]
arch::check_tdx_init();
// SAFETY: This function is called only once and only on the BSP.
unsafe { cpu::cpu_local::early_init_bsp_local_base() };
@ -77,6 +81,9 @@ pub fn init() {
trap::init();
arch::after_all_init();
cpu::init();
bus::init();
mm::kspace::activate_kernel_page_table();