pub fn init_next_processor_variables(core_id: usize) {
	// Allocate stack and PerCoreVariables structure for the CPU and pass the addresses.
	// Keep the stack executable to possibly support dynamically generated code on the stack (see https://security.stackexchange.com/a/47825).
	let stack = mm::allocate(KERNEL_STACK_SIZE, false);
	let mut boxed_percore = PerCoreVariables::new(core_id);
	let percore_ptr = &mut boxed_percore as *mut _;
	let alloc_percore = mm::allocate(mem::size_of::<PerCoreVariables>(), true) as *mut PerCoreVariables;
	list_add(alloc_percore as usize);
	list_add(percore_ptr as usize);
	copy_from_safe(percore_ptr, 1);
	copy_to_safe(alloc_percore, 1);
	clear_unsafe_storage();

	let unsafe_storage = get_unsafe_storage();
	unsafe {
		copy_from_safe(BOOT_INFO, 1);
		isolation_start!();
		intrinsics::volatile_store(&mut (*(unsafe_storage as *mut BootInfo)).current_stack_address, stack as u64);
		intrinsics::volatile_store(&mut (*(unsafe_storage as *mut BootInfo)).current_percore_address, alloc_percore as u64,);
		isolation_end!();
		copy_to_safe(BOOT_INFO, 1);
		clear_unsafe_storage();
	}
}
/// Initialize the required entry.asm variables for the next CPU to be booted.
Initialize the required entry.asm variables for the next CPU to be booted.
Initialize the required entry . asm variables for the next CPU to be booted .
pub fn init_next_processor_variables(core_id: usize) {
	// Allocate stack and PerCoreVariables structure for the CPU and pass the addresses.
	// Keep the stack executable to possibly support dynamically generated code on the stack (see https://security.stackexchange.com/a/47825).
	let stack = mm::allocate(KERNEL_STACK_SIZE, false);
	let mut boxed_percore = PerCoreVariables::new(core_id);
	let percore_ptr = &mut boxed_percore as *mut _;
	let alloc_percore = mm::allocate(mem::size_of::<PerCoreVariables>(), true) as *mut PerCoreVariables;
	list_add(alloc_percore as usize);
	list_add(percore_ptr as usize);
	copy_from_safe(percore_ptr, 1);
	copy_to_safe(alloc_percore, 1);
	clear_unsafe_storage();
	let unsafe_storage = get_unsafe_storage();
	unsafe {
		copy_from_safe(BOOT_INFO, 1);
		isolation_start!();
		intrinsics::volatile_store(&mut (*(unsafe_storage as *mut BootInfo)).current_stack_address, stack as u64);
		intrinsics::volatile_store(&mut (*(unsafe_storage as *mut BootInfo)).current_percore_address, alloc_percore as u64,);
		isolation_end!();
		copy_to_safe(BOOT_INFO, 1);
		clear_unsafe_storage();
	}
}
pub fn init_next_processor_variables ( core_id : usize ) { // Allocate stack and PerCoreVariables structure for the CPU and pass the addresses. // Keep the stack executable to possibly support dynamically generated code on the stack (see https://security.stackexchange.com/a/47825). let stack = mm :: allocate ( KERNEL_STACK_SIZE , false ) ; let mut boxed_percore = PerCoreVariables :: new ( core_id ) ; let percore_ptr = & mut boxed_percore as * mut _ ; let alloc_percore = mm :: allocate ( mem :: size_of :: < PerCoreVariables > ( ) , true ) as * mut PerCoreVariables ; list_add ( alloc_percore as usize ) ; list_add ( percore_ptr as usize ) ; copy_from_safe ( percore_ptr , 1 ) ; copy_to_safe ( alloc_percore , 1 ) ; clear_unsafe_storage ( ) ; let unsafe_storage = get_unsafe_storage ( ) ; unsafe { copy_from_safe ( BOOT_INFO , 1 ) ; isolation_start ! ( ) ; intrinsics :: volatile_store ( & mut ( * ( unsafe_storage as * mut BootInfo ) ) . current_stack_address , stack as u64 ) ; intrinsics :: volatile_store ( & mut ( * ( unsafe_storage as * mut BootInfo ) ) . current_percore_address , alloc_percore as u64 , ) ; isolation_end ! ( ) ; copy_to_safe ( BOOT_INFO , 1 ) ; clear_unsafe_storage ( ) ; } }
Initialize the required entry.asm variables for the next CPU to be booted.
Initialize the required entry . asm variables for the next CPU to be booted .
core_id
usize
core_id
usize