Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add RISC-V vxworks target specific constants #3935

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
12 changes: 9 additions & 3 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,7 +1972,13 @@ 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
panic!("Unknown Vxworks target architecture");
}
}
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;