Skip to content

Commit

Permalink
Add 64-bit RISC-V support
Browse files Browse the repository at this point in the history
Co-authored-by: Martin Kröning <[email protected]>
Signed-off-by: Martin Kröning <[email protected]>
  • Loading branch information
simonschoening and mkroening committed Jul 21, 2023
1 parent fdad7df commit b7d67ab
Show file tree
Hide file tree
Showing 36 changed files with 5,263 additions and 4 deletions.
68 changes: 68 additions & 0 deletions Cargo.lock

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

15 changes: 14 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ ahash = { version = "0.8", default-features = false }
bitflags = "1.3"
crossbeam-utils = { version = "0.8", default-features = false }
hashbrown = { version = "0.13", default-features = false }
hermit-entry = { version = "0.9", features = ["kernel"] }
include-transformed = { version = "0.2", optional = true }
lock_api = "0.4"
log = { version = "0.4", default-features = false }
Expand All @@ -86,6 +85,9 @@ qemu-exit = "3.0"
futures-lite = { version = "1.11", default-features = false, optional = true }
async-task = { version = "4.3", default-features = false, optional = true }

[target.'cfg(not(target_arch = "riscv64"))'.dependencies]
hermit-entry = { version = "0.9", features = ["kernel"] }

[dependencies.smoltcp]
version = "0.8"
optional = true
Expand Down Expand Up @@ -125,3 +127,14 @@ members = [
exclude = [
"hermit-builtins",
]
[target.'cfg(target_arch = "riscv64")'.dependencies.riscv]
version = "0.8.0"

[target.'cfg(target_arch = "riscv64")'.dependencies.trapframe]
version = "0.9.0"

[target.'cfg(target_arch = "riscv64")'.dependencies.fdt]
version = "0.1"

[target.'cfg(target_arch = "riscv64")'.dependencies.tock-registers]
version = "0.7.0"
26 changes: 26 additions & 0 deletions src/arch/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
#[cfg(target_arch = "aarch64")]
pub mod aarch64;

#[cfg(target_arch = "riscv64")]
pub mod riscv;

#[cfg(target_arch = "x86_64")]
pub mod x86_64;

Expand Down Expand Up @@ -29,6 +32,29 @@ pub use crate::arch::aarch64::kernel::{
};
#[cfg(target_arch = "aarch64")]
pub use crate::arch::aarch64::*;
#[cfg(target_arch = "riscv64")]
pub use crate::arch::riscv::kernel::irq;
#[cfg(target_arch = "riscv64")]
pub use crate::arch::riscv::kernel::percore;
#[cfg(target_arch = "riscv64")]
use crate::arch::riscv::kernel::percore::core_scheduler;
#[cfg(target_arch = "riscv64")]
pub use crate::arch::riscv::kernel::processor;
#[cfg(target_arch = "riscv64")]
pub use crate::arch::riscv::kernel::processor::{set_oneshot_timer, wakeup_core};
#[cfg(target_arch = "riscv64")]
pub use crate::arch::riscv::kernel::scheduler;
#[cfg(target_arch = "riscv64")]
pub use crate::arch::riscv::kernel::switch;
#[cfg(target_arch = "riscv64")]
pub use crate::arch::riscv::kernel::systemtime::get_boot_time;
#[cfg(target_arch = "riscv64")]
pub use crate::arch::riscv::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 = "riscv64")]
pub use crate::arch::riscv::*;
#[cfg(target_arch = "x86_64")]
pub use crate::arch::x86_64::kernel::apic::{set_oneshot_timer, wakeup_core};
#[cfg(all(target_arch = "x86_64", target_os = "none", feature = "smp"))]
Expand Down
Loading

0 comments on commit b7d67ab

Please sign in to comment.