/DragonOS/kernel/src/smp/cpu/ |
H A D | mod.rs | 163 pub fn cpuhp_state(&self, cpu_id: ProcessorId) -> &CpuHpCpuState { in cpuhp_state() 164 unsafe { self.cpuhp_state.force_get(cpu_id) } in cpuhp_state() 168 fn cpuhp_state_mut(&self, cpu_id: ProcessorId) -> &mut CpuHpCpuState { in cpuhp_state_mut() 169 unsafe { self.cpuhp_state.force_get_mut(cpu_id) } in cpuhp_state_mut() 175 cpu_id: ProcessorId, in set_cpuhp_state() 178 let p = self.cpuhp_state.force_get_mut(cpu_id); in set_cpuhp_state() 188 pub fn set_online_cpu(&self, cpu_id: ProcessorId) { in set_online_cpu() 189 unsafe { self.set_cpuhp_state(cpu_id, CpuHpState::Online) }; in set_online_cpu() 200 for cpu_id in self.present_cpus().iter_cpu() { in bringup_nonboot_cpus() 201 if cpu_id == smp_get_processor_id() { in bringup_nonboot_cpus() [all …]
|
/DragonOS/kernel/src/mm/ |
H A D | percpu.rs | 87 let cpu_id = smp_get_processor_id(); in get() localVariable 88 &self.inner[cpu_id.data() as usize] in get() 93 let cpu_id = smp_get_processor_id(); in get_mut() localVariable 95 &mut (self as *const Self as *mut Self).as_mut().unwrap().inner[cpu_id.data() as usize] in get_mut() 99 pub unsafe fn force_get(&self, cpu_id: ProcessorId) -> &T { in force_get() 100 &self.inner[cpu_id.data() as usize] in force_get() 104 pub unsafe fn force_get_mut(&self, cpu_id: ProcessorId) -> &mut T { in force_get_mut() 105 &mut (self as *const Self as *mut Self).as_mut().unwrap().inner[cpu_id.data() as usize] in force_get_mut()
|
/DragonOS/kernel/src/time/ |
H A D | tick_common.rs | 13 let cpu_id = smp_get_processor_id(); in tick_handle_periodic() localVariable 15 tick_periodic(cpu_id, trap_frame); in tick_handle_periodic() 18 fn tick_periodic(cpu_id: ProcessorId, trap_frame: &TrapFrame) { in tick_periodic() 19 if cpu_id.data() == 0 { in tick_periodic()
|
/DragonOS/kernel/src/arch/x86_64/driver/apic/ |
H A D | apic_timer.rs | 39 cpu_id: ProcessorId, in local_apic_timer_instance() 41 unsafe { LOCAL_APIC_TIMERS[cpu_id.data() as usize].borrow() } in local_apic_timer_instance() 46 cpu_id: ProcessorId, in local_apic_timer_instance_mut() 48 unsafe { LOCAL_APIC_TIMERS[cpu_id.data() as usize].borrow_mut() } in local_apic_timer_instance_mut() 121 let cpu_id = smp_get_processor_id(); in init_ap_apic_timer() localVariable 122 assert!(cpu_id.data() != 0); in init_ap_apic_timer() 124 let mut local_apic_timer = local_apic_timer_instance_mut(cpu_id); in init_ap_apic_timer() 147 let cpu_id = smp_get_processor_id(); in uninstall() localVariable 148 let local_apic_timer = local_apic_timer_instance(cpu_id); in uninstall() 154 let cpu_id = smp_get_processor_id(); in enable() localVariable [all …]
|
H A D | mod.rs | 485 let cpu_id = smp_get_processor_id(); in init_current_cpu() localVariable 486 if cpu_id.data() == 0 { in init_current_cpu() 491 info!("Initializing apic for cpu {:?}", cpu_id); in init_current_cpu() 493 if cpu_id.data() == 0 { in init_current_cpu() 496 info!("x2APIC initialized for cpu {:?}", cpu_id); in init_current_cpu() 499 if cpu_id.data() == 0 { in init_current_cpu() 517 info!("xAPIC initialized for cpu {:?}", cpu_id); in init_current_cpu()
|
/DragonOS/kernel/src/smp/ |
H A D | mod.rs | 18 pub fn kick_cpu(cpu_id: ProcessorId) -> Result<(), SystemError> { in kick_cpu() 21 send_ipi(IpiKind::KickCpu, IpiTarget::Specified(cpu_id)); in kick_cpu() 41 fn start_cpu(cpu_id: ProcessorId, hp_state: &CpuHpCpuState) -> Result<(), SystemError>; in start_cpu()
|
/DragonOS/kernel/src/arch/x86_64/ |
H A D | cpu.rs | 11 let cpu_id = (cpuid_res.ebx >> 24) & 0xff; in current_cpu_id() localVariable 12 return ProcessorId::new(cpu_id); in current_cpu_id()
|
H A D | sched.rs | 26 let cpu_id = smp_get_processor_id(); in initial_setup_sched_local() localVariable 28 if cpu_id.data() != 0 { in initial_setup_sched_local()
|
/DragonOS/kernel/src/arch/x86_64/smp/ |
H A D | mod.rs | 114 pub fn phys_id(&self, cpu_id: usize) -> usize { in phys_id() 115 self.phys_id[cpu_id] in phys_id() 130 pub unsafe fn set_phys_id(&self, cpu_id: ProcessorId, phys_id: usize) { in set_phys_id() 133 (*p).phys_id[cpu_id.data() as usize] = phys_id; in set_phys_id() 217 fn start_cpu(cpu_id: ProcessorId, _cpu_hpstate: &CpuHpCpuState) -> Result<(), SystemError> { in start_cpu() 223 ipi_send_smp_startup(cpu_id)?; in start_cpu() 226 ipi_send_smp_startup(cpu_id)?; in start_cpu()
|
/DragonOS/kernel/src/arch/riscv64/interrupt/ |
H A D | ipi.rs | 28 IpiTarget::Specified(cpu_id) => { in into() 29 let mask = Into::into(cpu_id); in into()
|
/DragonOS/kernel/src/process/ |
H A D | c_adapter.rs | 12 unsafe extern "C" fn rs_get_idle_stack_top(cpu_id: u32) -> usize { in rs_get_idle_stack_top() 13 return ProcessManager::idle_pcb()[cpu_id as usize] in rs_get_idle_stack_top()
|
H A D | mod.rs | 500 let cpu_id = pcb.sched_info().on_cpu(); in kick() localVariable 502 if let Some(cpu_id) = cpu_id { in kick() 503 if pcb.pid() == cpu_rq(cpu_id.data() as usize).current().pid() { in kick() 504 kick_cpu(cpu_id).expect("ProcessManager::kick(): Failed to kick cpu"); in kick() 690 pub fn new_idle(cpu_id: u32, kstack: KernelStack) -> Arc<Self> { in new_idle() 691 let name = format!("idle-{}", cpu_id); in new_idle() 1274 let cpu_id = on_cpu.unwrap_or(ProcessorId::INVALID); in new() localVariable 1276 on_cpu: AtomicProcessorId::new(cpu_id), in new() 1307 if let Some(cpu_id) = on_cpu { in set_on_cpu() 1308 self.on_cpu.store(cpu_id, Ordering::SeqCst); in set_on_cpu()
|
/DragonOS/kernel/src/exception/ |
H A D | softirq.rs | 61 fn cpu_pending(cpu_id: ProcessorId) -> &'static mut VecStatus { in cpu_pending() 63 return &mut __CPU_PENDING.as_mut().unwrap()[cpu_id.data() as usize]; in cpu_pending() 196 let cpu_id = smp_get_processor_id(); in do_softirq() localVariable 200 let pending = cpu_pending(cpu_id).bits; in do_softirq() 201 cpu_pending(cpu_id).bits = 0; in do_softirq() 235 if cpu_pending(cpu_id).is_empty() { in do_softirq()
|
/DragonOS/kernel/src/bpf/map/ |
H A D | array_map.rs | 247 let cpu_id = u32::from_ne_bytes(key.try_into().map_err(|_| SystemError::EINVAL)?); in lookup_elem() localVariable 248 let value = self.fds.index(cpu_id); in lookup_elem() 253 let cpu_id = u32::from_ne_bytes(key.try_into().map_err(|_| SystemError::EINVAL)?); in update_elem() localVariable 254 let old_value = self.fds.index_mut(cpu_id); in update_elem() 259 let cpu_id = u32::from_ne_bytes(key.try_into().map_err(|_| SystemError::EINVAL)?); in delete_elem() localVariable 260 self.fds.index_mut(cpu_id).copy_from_slice(&[0; 4]); in delete_elem()
|
/DragonOS/kernel/src/arch/x86_64/interrupt/ |
H A D | ipi.rs | 72 IpiTarget::Specified(cpu_id) => { in from() 73 ArchIpiTarget::Specified(Self::cpu_id_to_apic_id(cpu_id)) in from() 103 fn cpu_id_to_apic_id(cpu_id: ProcessorId) -> x86::apic::ApicId { in cpu_id_to_apic_id() 105 x86::apic::ApicId::X2Apic(cpu_id.data()) in cpu_id_to_apic_id() 107 x86::apic::ApicId::XApic(cpu_id.data() as u8) in cpu_id_to_apic_id()
|
/DragonOS/kernel/src/filesystem/procfs/ |
H A D | mod.rs | 169 let cpu_id = sched_info_guard in open_status() localVariable 203 pdata.append(&mut format!("\ncpu_id:\t{}", cpu_id).as_bytes().to_owned()); in open_status()
|