File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414
1515use core:: sync:: atomic:: { AtomicUsize , Ordering } ;
1616
17- use axconfig:: TASK_STACK_SIZE ;
17+ use axconfig:: { TASK_STACK_SIZE , plat } ;
1818use axhal:: mem:: { VirtAddr , virt_to_phys} ;
1919
20- use crate :: cpu_count;
21-
2220const 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
2826static ENTERED_CPUS : AtomicUsize = AtomicUsize :: new ( 1 ) ;
2927
28+ #[ cfg( feature = "driver-dyn" ) ]
29+ use crate :: cpu_count;
30+
3031#[ allow( clippy:: absurd_extreme_comparisons) ]
3132pub 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 {
You can’t perform that action at this time.
0 commit comments