From 386df39c9866a4d945de46ef0dcab2363c674e0e Mon Sep 17 00:00:00 2001 From: Nathan Ringo Date: Sun, 1 Sep 2024 19:59:44 -0500 Subject: Move almost all the kernel into crates/. --- crates/kernel/src/arch/riscv64/mod.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 crates/kernel/src/arch/riscv64/mod.rs (limited to 'crates/kernel/src/arch/riscv64/mod.rs') diff --git a/crates/kernel/src/arch/riscv64/mod.rs b/crates/kernel/src/arch/riscv64/mod.rs new file mode 100644 index 0000000..216a90c --- /dev/null +++ b/crates/kernel/src/arch/riscv64/mod.rs @@ -0,0 +1,14 @@ +pub mod interrupts; + +/// The size of a page of memory. +pub const PAGE_SIZE: usize = 4096; + +/// The number of bits in the size of a page of memory. +pub const PAGE_SIZE_BITS: usize = 12; + +/// Halts the hart. +pub fn sleep_forever() -> ! { + loop { + unsafe { core::arch::asm!("wfi") } + } +} -- cgit v1.2.3