summaryrefslogtreecommitdiff
path: root/crates/kernel/src/arch/riscv64/mod.rs
diff options
context:
space:
mode:
authorNathan Ringo <nathan@remexre.com>2024-09-01 19:59:44 -0500
committerNathan Ringo <nathan@remexre.com>2024-09-01 19:59:44 -0500
commit386df39c9866a4d945de46ef0dcab2363c674e0e (patch)
treec0572ce6a2c81c93546210f599dff553783c5760 /crates/kernel/src/arch/riscv64/mod.rs
parent6b98b6afea6e790abe738a67aa28bab54c91afe0 (diff)
Move almost all the kernel into crates/.
Diffstat (limited to 'crates/kernel/src/arch/riscv64/mod.rs')
-rw-r--r--crates/kernel/src/arch/riscv64/mod.rs14
1 files changed, 14 insertions, 0 deletions
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") }
+ }
+}