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 c8d6708 commit 226a603
Show file tree
Hide file tree
Showing 36 changed files with 5,272 additions and 8 deletions.
81 changes: 77 additions & 4 deletions Cargo.lock

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

13 changes: 12 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"] }
hermit-sync = "0.1.0"
include-transformed = { version = "0.2", optional = true }
log = { version = "0.4", default-features = false }
Expand All @@ -85,6 +84,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 @@ -117,10 +119,19 @@ x86 = { version = "0.52", default-features = false }
version = "0.0.7"
default-features = false

[target.'cfg(target_arch = "riscv64")'.dependencies]
riscv = "0.10"
trapframe = "0.9"
fdt = "0.1"
tock-registers = "0.8"

[workspace]
members = [
"xtask",
]
exclude = [
"hermit-builtins",
]

[patch.crates-io]
hermit-sync = { path = "../../hermit-sync" }
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 226a603

Please sign in to comment.