Skip to content

Commit b233dad

Browse files
committed
fix: resolve ci error caused by driver-dyn
1 parent 0b82ec9 commit b233dad

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

  • modules/axruntime/src

modules/axruntime/src/mp.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,9 @@
1414

1515
use core::sync::atomic::{AtomicUsize, Ordering};
1616

17-
use axconfig::TASK_STACK_SIZE;
17+
use axconfig::{TASK_STACK_SIZE, plat};
1818
use axhal::mem::{VirtAddr, virt_to_phys};
1919

20-
use crate::cpu_count;
21-
2220
const MAX_CPU_NUM: usize = 8;
2321

2422
#[unsafe(link_section = ".bss.stack")]
@@ -27,9 +25,15 @@ static mut SECONDARY_BOOT_STACK: [[u8; TASK_STACK_SIZE]; MAX_CPU_NUM - 1] =
2725

2826
static ENTERED_CPUS: AtomicUsize = AtomicUsize::new(1);
2927

28+
#[cfg(feature = "driver-dyn")]
29+
use crate::cpu_count;
30+
3031
#[allow(clippy::absurd_extreme_comparisons)]
3132
pub fn start_secondary_cpus(primary_cpu_id: usize) {
33+
#[cfg(feature = "driver-dyn")]
3234
let cpu_count = cpu_count();
35+
#[cfg(not(feature = "driver-dyn"))]
36+
let cpu_count = plat::CPU_NUM;
3337
let mut logic_cpu_id = 0;
3438
for i in 0..cpu_count {
3539
if i != primary_cpu_id && logic_cpu_id < cpu_count - 1 {

0 commit comments

Comments
 (0)