-
Notifications
You must be signed in to change notification settings - Fork 81
/
mod.rs
80 lines (66 loc) · 2.65 KB
/
mod.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
// Platform-specific implementations
#[cfg(target_arch = "aarch64")]
pub mod aarch64;
#[cfg(target_arch = "x86_64")]
pub mod x86_64;
// Export our platform-specific modules.
#[cfg(target_arch = "aarch64")]
pub use crate::arch::aarch64::*;
#[cfg(target_arch = "aarch64")]
pub use crate::arch::aarch64::kernel::stubs::{set_oneshot_timer, wakeup_core};
#[cfg(target_arch = "aarch64")]
pub use crate::arch::aarch64::kernel::{
application_processor_init, boot_application_processors, boot_processor_init,
get_processor_count, message_output_init, output_message_buf, output_message_byte,
};
#[cfg(target_arch = "aarch64")]
use crate::arch::aarch64::kernel::percore::core_scheduler;
#[cfg(target_arch = "aarch64")]
pub use crate::arch::aarch64::kernel::percore;
#[cfg(target_arch = "aarch64")]
pub use crate::arch::aarch64::kernel::scheduler;
#[cfg(target_arch = "aarch64")]
pub use crate::arch::aarch64::kernel::processor;
#[cfg(target_arch = "aarch64")]
pub use crate::arch::aarch64::kernel::irq;
#[cfg(target_arch = "aarch64")]
pub use crate::arch::aarch64::kernel::systemtime::get_boot_time;
#[cfg(target_arch = "aarch64")]
pub use crate::arch::aarch64::kernel::switch;
#[cfg(target_arch = "x86_64")]
pub use crate::arch::x86_64::*;
#[cfg(target_arch = "x86_64")]
pub use crate::arch::x86_64::kernel::apic::{set_oneshot_timer, wakeup_core};
#[cfg(all(
target_arch = "x86_64",
any(target_os = "none", target_os = "hermit"),
feature = "smp"
))]
pub use crate::arch::x86_64::kernel::application_processor_init;
#[cfg(target_arch = "x86_64")]
pub use crate::arch::x86_64::kernel::gdt::set_current_kernel_stack;
#[cfg(target_arch = "x86_64")]
pub use crate::arch::x86_64::kernel::irq;
#[cfg(target_arch = "x86_64")]
pub use crate::arch::x86_64::kernel::percore;
#[cfg(target_arch = "x86_64")]
pub use crate::arch::x86_64::kernel::processor;
#[cfg(target_arch = "x86_64")]
pub use crate::arch::x86_64::kernel::scheduler;
#[cfg(target_arch = "x86_64")]
pub use crate::arch::x86_64::kernel::switch;
#[cfg(target_arch = "x86_64")]
pub use crate::arch::x86_64::kernel::systemtime::get_boot_time;
#[cfg(all(target_arch = "x86_64", any(target_os = "none", target_os = "hermit")))]
pub use crate::arch::x86_64::kernel::{boot_application_processors, boot_processor_init};
#[cfg(target_arch = "x86_64")]
pub use crate::arch::x86_64::kernel::{
get_processor_count, message_output_init, output_message_buf, output_message_byte,
};
pub fn init_drivers() {
// Initialize PCI Drivers if on x86_64
#[cfg(all(target_arch = "x86_64", feature = "pci"))]
crate::arch::x86_64::kernel::pci::init_drivers();
#[cfg(all(target_arch = "x86_64", not(feature = "pci")))]
crate::arch::x86_64::kernel::mmio::init_drivers();
}