hermit/arch/
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
//! Architecture-specific architecture abstraction.

cfg_if::cfg_if! {
	if #[cfg(target_arch = "aarch64")] {
		pub(crate) mod aarch64;
		pub(crate) use self::aarch64::*;

		#[cfg(target_os = "none")]
		pub(crate) use self::aarch64::kernel::boot_processor_init;
		pub(crate) use self::aarch64::kernel::core_local;
		pub(crate) use self::aarch64::kernel::interrupts;
		pub(crate) use self::aarch64::kernel::interrupts::wakeup_core;
		#[cfg(feature = "pci")]
		pub(crate) use self::aarch64::kernel::pci;
		pub(crate) use self::aarch64::kernel::processor;
		pub(crate) use self::aarch64::kernel::processor::set_oneshot_timer;
		pub(crate) use self::aarch64::kernel::scheduler;
		pub(crate) use self::aarch64::kernel::switch;
		#[cfg(feature = "smp")]
		pub(crate) use self::aarch64::kernel::application_processor_init;
		pub(crate) use self::aarch64::kernel::{
			get_processor_count,
			message_output_init,
			output_message_buf,
		};
		pub use self::aarch64::mm::paging::{BasePageSize, PageSize};
	} else if #[cfg(target_arch = "x86_64")] {
		pub(crate) mod x86_64;
		pub(crate) use self::x86_64::*;

		pub(crate) use self::x86_64::kernel::apic::{
			set_oneshot_timer,
			wakeup_core,
		};
		#[cfg(all(target_os = "none", feature = "smp"))]
		pub(crate) use self::x86_64::kernel::application_processor_init;
		pub(crate) use self::x86_64::kernel::core_local;
		pub(crate) use self::x86_64::kernel::gdt::set_current_kernel_stack;
		pub(crate) use self::x86_64::kernel::interrupts;
		#[cfg(feature = "pci")]
		pub(crate) use self::x86_64::kernel::pci;
		pub(crate) use self::x86_64::kernel::processor;
		pub(crate) use self::x86_64::kernel::scheduler;
		pub(crate) use self::x86_64::kernel::switch;
		#[cfg(target_os = "none")]
		pub(crate) use self::x86_64::kernel::boot_processor_init;
		pub(crate) use self::x86_64::kernel::{
			get_processor_count,
			message_output_init,
			output_message_buf,
		};
		pub use self::x86_64::mm::paging::{BasePageSize, PageSize};
		#[cfg(feature = "common-os")]
		pub use self::x86_64::mm::create_new_root_page_table;
		#[cfg(feature = "common-os")]
		pub use self::x86_64::kernel::{load_application, jump_to_user_land};
	} else if #[cfg(target_arch = "riscv64")] {
		pub(crate) mod riscv64;
		pub(crate) use self::riscv64::*;

		#[cfg(feature = "smp")]
		pub(crate) use self::riscv64::kernel::application_processor_init;
		#[cfg(feature = "pci")]
		pub(crate) use self::riscv64::kernel::pci;
		pub(crate) use self::riscv64::kernel::processor::{self, set_oneshot_timer, wakeup_core};
		pub(crate) use self::riscv64::kernel::{
			boot_processor_init,
			core_local,
			get_processor_count,
			interrupts,
			message_output_init,
			output_message_buf,
			scheduler,
			switch,
		};
		pub use self::riscv64::mm::paging::{BasePageSize, PageSize};
	}
}