Refactor code related to CPU local memory

Co-authored-by: Chuandong Li <lichuand@pku.edu.cn>
This commit is contained in:
Zhang Junyang
2024-06-28 15:47:01 +00:00
committed by Tate, Hongliang Tian
parent 98619f3482
commit 0f8d8da372
11 changed files with 339 additions and 185 deletions

View File

@ -47,7 +47,7 @@ pub use ostd_macros::main;
#[cfg(feature = "intel_tdx")]
use tdx_guest::init_tdx;
pub use self::{cpu::CpuLocal, error::Error, prelude::Result};
pub use self::{cpu::cpu_local::CpuLocal, error::Error, prelude::Result};
/// Initializes OSTD.
///
@ -77,6 +77,9 @@ pub fn init() {
mm::page::allocator::init();
mm::kspace::init_boot_page_table();
mm::kspace::init_kernel_page_table(mm::init_page_meta());
// SAFETY: no CPU local objects have been accessed by this far. And
// we are on the BSP.
unsafe { cpu::cpu_local::init_on_bsp() };
mm::misc_init();
trap::init();