1*aa0367d6SLoGin use crate::{ 2*aa0367d6SLoGin arch::interrupt::ipi::send_ipi, 3*aa0367d6SLoGin exception::ipi::{IpiKind, IpiTarget}, 4*aa0367d6SLoGin syscall::SystemError, 5*aa0367d6SLoGin }; 6*aa0367d6SLoGin 766f67c6aSlogin pub mod core; 8*aa0367d6SLoGin 9*aa0367d6SLoGin pub fn kick_cpu(cpu_id: usize) -> Result<(), SystemError> { 10*aa0367d6SLoGin // todo: 增加对cpu_id的有效性检查 11*aa0367d6SLoGin 12*aa0367d6SLoGin send_ipi(IpiKind::KickCpu, IpiTarget::Specified(cpu_id)); 13*aa0367d6SLoGin return Ok(()); 14*aa0367d6SLoGin } 15*aa0367d6SLoGin 16*aa0367d6SLoGin #[no_mangle] 17*aa0367d6SLoGin pub extern "C" fn rs_kick_cpu(cpu_id: usize) -> usize { 18*aa0367d6SLoGin return kick_cpu(cpu_id) 19*aa0367d6SLoGin .map(|_| 0usize) 20*aa0367d6SLoGin .unwrap_or_else(|e| e.to_posix_errno() as usize); 21*aa0367d6SLoGin } 22