Skip to content

Commit

Permalink
Merge pull request #3935 from biabbas/riscv_vxworks
Browse files Browse the repository at this point in the history
Add RISC-V vxworks target specific constants
  • Loading branch information
tgross35 authored Oct 14, 2024
2 parents e715762 + dd20281 commit fbec928
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,14 @@ targets = [
"riscv32i-unknown-none-elf",
"riscv32imac-unknown-none-elf",
"riscv32imc-unknown-none-elf",
"riscv32-wrs-vxworks",
"riscv64gc-unknown-freebsd",
"riscv64gc-unknown-hermit",
"riscv64gc-unknown-linux-gnu",
"riscv64gc-unknown-linux-musl",
"riscv64gc-unknown-none-elf",
"riscv64imac-unknown-none-elf",
"riscv64-wrs-vxworks",
"s390x-unknown-linux-gnu",
"s390x-unknown-linux-musl",
"sparc-unknown-linux-gnu",
Expand Down
2 changes: 2 additions & 0 deletions ci/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -249,11 +249,13 @@ riscv32i-unknown-none-elf \
riscv32imac-unknown-none-elf \
riscv32imc-unknown-none-elf \
riscv32gc-unknown-linux-gnu \
riscv32-wrs-vxworks \
riscv64gc-unknown-freebsd \
riscv64gc-unknown-hermit \
riscv64gc-unknown-linux-musl \
riscv64gc-unknown-none-elf \
riscv64imac-unknown-none-elf \
riscv64-wrs-vxworks \
s390x-unknown-linux-musl \
sparc-unknown-linux-gnu \
sparc64-unknown-netbsd \
Expand Down
10 changes: 8 additions & 2 deletions src/vxworks/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1878,8 +1878,8 @@ extern "C" {
pub fn mq_setattr(mqd: ::mqd_t, newattr: *const ::mq_attr, oldattr: *mut ::mq_attr) -> ::c_int;

// vxCpuLib.h
fn vxCpuEnabledGet() -> ::cpuset_t; // Get set of running CPU's in the system
fn vxCpuConfiguredGet() -> ::cpuset_t; // Get set of Configured CPU's in the system
pub fn vxCpuEnabledGet() -> ::cpuset_t; // Get set of running CPU's in the system
pub fn vxCpuConfiguredGet() -> ::cpuset_t; // Get set of Configured CPU's in the system
}

//Dummy functions, these don't really exist in VxWorks.
Expand Down Expand Up @@ -1972,6 +1972,12 @@ cfg_if! {
} else if #[cfg(target_arch = "powerpc64")] {
mod powerpc64;
pub use self::powerpc64::*;
} else if #[cfg(target_arch = "riscv32")] {
mod riscv32;
pub use self::riscv32::*;
} else if #[cfg(target_arch = "riscv64")] {
mod riscv64;
pub use self::riscv64::*;
} else {
// Unknown target_arch
}
Expand Down
4 changes: 4 additions & 0 deletions src/vxworks/riscv32.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
pub type c_char = i8;
pub type wchar_t = i32;
pub type c_long = i32;
pub type c_ulong = u32;
4 changes: 4 additions & 0 deletions src/vxworks/riscv64.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
pub type c_char = i8;
pub type wchar_t = i32;
pub type c_long = i64;
pub type c_ulong = u64;

0 comments on commit fbec928

Please sign in to comment.