Skip to content

Commit

Permalink
refactor: move none and uefi modules into os module
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Kröning <[email protected]>
  • Loading branch information
mkroening committed Apr 9, 2024
1 parent 32e5356 commit 95224fb
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 5 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ edition = "2021"

[dependencies]
align-address = "0.1"
cfg-if = "1"
hermit-entry = { version = "0.9", features = ["loader"] }
log = "0.4"
one-shot-mutex = "0.1"
Expand Down
2 changes: 1 addition & 1 deletion src/arch/riscv64/start.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ extern "C" fn start(hart_id: usize, fdt: *const u8) -> ! {
HART_ID.store(hart_id, Ordering::Relaxed);
FDT.store(fdt.cast_mut(), Ordering::Relaxed);

unsafe { crate::none::loader_main() }
unsafe { crate::os::loader_main() }
}

// Align to page size
Expand Down
5 changes: 1 addition & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ mod arch;
mod console;
#[cfg(target_os = "none")]
mod log;
#[cfg(target_os = "none")]
mod none;
#[cfg(target_os = "uefi")]
mod uefi;
mod os;

#[cfg(any(
target_os = "uefi",
Expand Down
11 changes: 11 additions & 0 deletions src/os/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#![allow(unused_imports)]

cfg_if::cfg_if! {
if #[cfg(target_os = "none")] {
mod none;
pub use self::none::*;
} else if #[cfg(target_os = "uefi")] {
mod uefi;
pub use self::uefi::*;
}
}
File renamed without changes.
File renamed without changes.

0 comments on commit 95224fb

Please sign in to comment.