/DragonOS/kernel/src/libs/ |
H A D | cpumask.rs | 5 use crate::{mm::percpu::PerCpu, smp::cpu::ProcessorId}; 28 pub fn from_cpu(cpu: ProcessorId) -> Self { in from_cpu() 30 mask.set(cpu, true); in from_cpu() 56 pub fn next_index(&self, cpu: ProcessorId) -> Option<ProcessorId> { in next_index() 58 .next_index(cpu.data() as usize) in next_index() 63 pub fn next_zero_index(&self, cpu: ProcessorId) -> Option<ProcessorId> { in next_zero_index() 65 .next_false_index(cpu.data() as usize) in next_zero_index() 69 pub fn set(&mut self, cpu: ProcessorId, value: bool) -> Option<bool> { in set() 70 self.bmp.set(cpu.data() as usize, value) in set() 73 pub fn get(&self, cpu: ProcessorId) -> Option<bool> { in get() [all …]
|
/DragonOS/kernel/src/sched/ |
H A D | cputime.rs | 11 pub fn irq_time_read(cpu: usize) -> u64 { in irq_time_read() 13 let irqtime = cpu_irq_time(cpu); in irq_time_read() 52 let cpu = smp_get_processor_id().data() as usize; in irqtime_start() localVariable 53 let irq_time = cpu_irq_time(cpu); in irqtime_start() 55 irq_time.irq_start_time = SchedClock::sched_clock_cpu(cpu) as u64; in irqtime_start() 61 let cpu = smp_get_processor_id().data() as usize; in irqtime_account_irq() localVariable 62 let irq_time = cpu_irq_time(cpu); in irqtime_account_irq() 64 let delta = SchedClock::sched_clock_cpu(cpu) as u64 - irq_time.irq_start_time; in irqtime_account_irq()
|
H A D | mod.rs | 36 smp::{core::smp_get_processor_id, cpu::ProcessorId}, 66 pub fn cpu_irq_time(cpu: usize) -> &'static mut IrqTime { in cpu_irq_time() 67 unsafe { CPU_IRQ_TIME.as_mut().unwrap()[cpu] } in cpu_irq_time() 71 pub fn cpu_rq(cpu: usize) -> Arc<CpuRunQueue> { in cpu_rq() 76 .force_get(ProcessorId::new(cpu as u32)) in cpu_rq() 292 cpu: usize, field 332 pub fn new(cpu: usize) -> Self { in new() 336 cpu, in new() 516 let clock = SchedClock::sched_clock_cpu(self.cpu); in update_rq_clock() 529 let mut irq_delta = irq_time_read(self.cpu) - self.prev_irq_time; in update_rq_clock_task() [all …]
|
H A D | syscall.rs | 3 use crate::arch::cpu::current_cpu_id;
|
/DragonOS/kernel/src/smp/ |
H A D | core.rs | 1 use super::cpu::ProcessorId; 6 return crate::arch::cpu::current_cpu_id(); in smp_get_processor_id()
|
H A D | mod.rs | 10 cpu::{smp_cpu_manager, smp_cpu_manager_init, CpuHpCpuState, ProcessorId}, 14 pub mod cpu; module
|
H A D | syscall.rs | 6 use super::cpu::smp_cpu_manager;
|
H A D | init.rs | 8 smp::{core::smp_get_processor_id, cpu::smp_cpu_manager},
|
/DragonOS/kernel/src/arch/riscv64/ |
H A D | cpu.rs | 7 smp::cpu::{ProcessorId, SmpCpuManager}, 67 pub fn new(cpu: ProcessorId) -> Self { in new() 69 current_cpu: cpu, in new() 78 pub fn set_current_cpu(&mut self, cpu: ProcessorId) { in set_current_cpu() 79 self.current_cpu = cpu; in set_current_cpu()
|
H A D | mod.rs | 2 pub mod cpu; module
|
/DragonOS/docs/kernel/debug/ |
H A D | profiling-kernel-with-dadk.md | 65 dadk profile sample --format flamegraph --output flame.svg --interval 200ms --duration 20s --cpu-… 76 - `--cpu-mask 0x1`:指定采样的CPU为0号CPU。(这是个按位掩码,也就是说,如果要采样0和1号CPU,那么cpu-mask为0x3)
|
/DragonOS/docs/kernel/core_api/ |
H A D | softirq.md | 7   每个cpu都有自己的pending,软中断是“哪个cpu发起,就哪个cpu执行”,每个cpu的pending不共享。同一个软中断向量可以在多核上同时运行。
|
/DragonOS/kernel/src/arch/x86_64/smp/ |
H A D | mod.rs | 18 cpu::{smp_cpu_manager, CpuHpCpuState, ProcessorId, SmpCpuManager}, 169 for cpu in 1..SMP_BOOT_DATA.cpu_count() { in build_cpu_map() 171 smp_cpu_manager().set_possible_cpu(ProcessorId::new(cpu as u32), true); in build_cpu_map() 172 smp_cpu_manager().set_present_cpu(ProcessorId::new(cpu as u32), true); in build_cpu_map() 184 for cpu in mask.iter_cpu() { in print_cpus() 185 v.push(cpu.data()); in print_cpus()
|
/DragonOS/kernel/src/perf/ |
H A D | util.rs | 42 pub cpu: i32, field 52 cpu: i32, in try_from() 73 cpu, in try_from()
|
/DragonOS/kernel/src/arch/x86_64/driver/apic/ |
H A D | lapic_vector.rs | 30 smp::{core::smp_get_processor_id, cpu::ProcessorId}, 108 IpiTarget::Specified(inner.cpu), in retrigger() 135 cpu: ProcessorId, in new() 143 cpu, in new() 162 cpu: ProcessorId, field
|
/DragonOS/kernel/src/driver/base/ |
H A D | mod.rs | 4 pub mod cpu; module
|
H A D | init.rs | 6 cpu::CpuDeviceManager,
|
/DragonOS/kernel/src/driver/irqchip/ |
H A D | riscv_sifive_plic.rs | 53 smp::cpu::{smp_cpu_manager, ProcessorId}, 190 cpumask.iter_cpu().for_each(|cpu| { in plic_irq_toggle() 192 let handler = unsafe { plic_handlers().force_get(cpu) }; in plic_irq_toggle() 366 let cpu = if force { in irq_set_affinity() localVariable 375 if cpu.data() > smp_cpu_manager().present_cpus_count() { in irq_set_affinity() 382 .set_effective_affinity(CpuMask::from_cpu(cpu)); in irq_set_affinity() 507 let cpu = ProcessorId::new(i as u32); in do_riscv_sifive_plic_init() localVariable 508 let handler = unsafe { plic_handlers().force_get(cpu) }; in do_riscv_sifive_plic_init() 517 priv_data.lmask().set(cpu, true); in do_riscv_sifive_plic_init() 527 .force_get_mut(cpu) in do_riscv_sifive_plic_init()
|
/DragonOS/kernel/src/arch/x86_64/kvm/vmx/ |
H A D | ept.rs | 7 use crate::smp::cpu::AtomicProcessorId; 8 use crate::smp::cpu::ProcessorId;
|
/DragonOS/kernel/src/arch/x86_64/ |
H A D | cpu.rs | 5 use crate::smp::cpu::ProcessorId;
|
/DragonOS/kernel/src/arch/riscv64/smp/ |
H A D | mod.rs | 5 cpu::{CpuHpCpuState, ProcessorId},
|
/DragonOS/kernel/src/time/ |
H A D | tick_common.rs | 4 smp::{core::smp_get_processor_id, cpu::ProcessorId},
|
/DragonOS/kernel/src/bpf/map/ |
H A D | lru.rs | 4 use crate::smp::cpu::ProcessorId; 141 fn lookup_percpu_elem(&mut self, key: &[u8], cpu: u32) -> Result<Option<&[u8]>> { in lookup_percpu_elem() 144 .force_get_mut(ProcessorId::new(cpu)) in lookup_percpu_elem()
|
H A D | hash_map.rs | 5 use crate::smp::cpu::ProcessorId; 143 fn lookup_percpu_elem(&mut self, key: &[u8], cpu: u32) -> Result<Option<&[u8]>> { in lookup_percpu_elem() 146 .force_get_mut(ProcessorId::new(cpu)) in lookup_percpu_elem()
|
/DragonOS/kernel/src/smp/cpu/ |
H A D | mod.rs | 115 pub unsafe fn set_possible_cpu(&self, cpu: ProcessorId, value: bool) { in set_possible_cpu() 119 if let Some(prev) = p.possible_cpus.set(cpu, value) { in set_possible_cpu() 145 pub unsafe fn set_present_cpu(&self, cpu: ProcessorId, value: bool) { in set_present_cpu() 149 if let Some(prev) = p.present_cpus.set(cpu, value) { in set_present_cpu()
|