fix bugs about cpu num config (x86-64)

TODO:
Unfixed bugs: rcore can not identify the hyperthread-mode cpus(i9-9900k) and dead.
master
chyyuu 6 years ago
parent f2467dad6a
commit 594cc3e16f

@ -18,6 +18,21 @@ pub fn init() {
static mut CPUS: [Option<Cpu>; MAX_CPU_NUM] = [ static mut CPUS: [Option<Cpu>; MAX_CPU_NUM] = [
// TODO: More elegant ? // TODO: More elegant ?
None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None,
// None, None, None, None, None, None, None, None,
// None, None, None, None, None, None, None, None,
// None, None, None, None, None, None, None, None,
// None, None, None, None, None, None, None, None,
// None, None, None, None, None, None, None, None,
// None, None, None, None, None, None, None, None,
// None, None, None, None, None, None, None, None,
// None, None, None, None, None, None, None, None,
]; ];
pub struct Cpu { pub struct Cpu {

@ -2,7 +2,7 @@
pub use crate::arch::consts::*; pub use crate::arch::consts::*;
pub const MAX_CPU_NUM: usize = 8; pub const MAX_CPU_NUM: usize = 64;
pub const MAX_PROCESS_NUM: usize = 128; pub const MAX_PROCESS_NUM: usize = 128;
pub const USEC_PER_TICK: usize = 10000; pub const USEC_PER_TICK: usize = 10000;

@ -26,14 +26,39 @@ pub fn init() {
} }
static PROCESSORS: [Processor; MAX_CPU_NUM] = [ static PROCESSORS: [Processor; MAX_CPU_NUM] = [
Processor::new(), // TODO: More elegant ?
Processor::new(), Processor::new(), Processor::new(), Processor::new(), Processor::new(),
Processor::new(), Processor::new(), Processor::new(), Processor::new(), Processor::new(),
Processor::new(), Processor::new(), Processor::new(), Processor::new(), Processor::new(),
Processor::new(), Processor::new(), Processor::new(), Processor::new(), Processor::new(),
Processor::new(), Processor::new(), Processor::new(), Processor::new(), Processor::new(),
Processor::new(), Processor::new(), Processor::new(), Processor::new(), Processor::new(),
Processor::new(), Processor::new(), Processor::new(), Processor::new(), Processor::new(),
Processor::new(), Processor::new(), Processor::new(), Processor::new(),
Processor::new(), Processor::new(), Processor::new(), Processor::new(),
Processor::new(), Processor::new(), Processor::new(), Processor::new(),
Processor::new(), Processor::new(), Processor::new(), Processor::new(),
Processor::new(), Processor::new(), Processor::new(), Processor::new(),
Processor::new(), Processor::new(), Processor::new(), Processor::new(),
Processor::new(), Processor::new(), Processor::new(), Processor::new(),
Processor::new(), Processor::new(), Processor::new(), Processor::new(),
Processor::new(), Processor::new(), Processor::new(), Processor::new(),
// Processor::new(), Processor::new(), Processor::new(), Processor::new(),
// Processor::new(), Processor::new(), Processor::new(), Processor::new(),
// Processor::new(), Processor::new(), Processor::new(), Processor::new(),
// Processor::new(), Processor::new(), Processor::new(), Processor::new(),
// Processor::new(), Processor::new(), Processor::new(), Processor::new(),
// Processor::new(), Processor::new(), Processor::new(), Processor::new(),
// Processor::new(), Processor::new(), Processor::new(), Processor::new(),
// Processor::new(), Processor::new(), Processor::new(), Processor::new(),
// Processor::new(), Processor::new(), Processor::new(), Processor::new(),
// Processor::new(), Processor::new(), Processor::new(), Processor::new(),
// Processor::new(), Processor::new(), Processor::new(), Processor::new(),
// Processor::new(), Processor::new(), Processor::new(), Processor::new(),
// Processor::new(), Processor::new(), Processor::new(), Processor::new(),
// Processor::new(), Processor::new(), Processor::new(), Processor::new(),
// Processor::new(), Processor::new(), Processor::new(), Processor::new(),
// Processor::new(), Processor::new(), Processor::new(), Processor::new(),
]; ];
/// Get current process /// Get current process

Loading…
Cancel
Save