From dd202816ec4ddc6cdf2ff9f2710768d7cdbf8309 Mon Sep 17 00:00:00 2001 From: B I Mohammed Abbas Date: Thu, 10 Oct 2024 13:10:33 +0530 Subject: [PATCH] Make vxworks functions public and add Risc-V targets --- Cargo.toml | 2 ++ ci/build.sh | 2 ++ src/vxworks/mod.rs | 10 ++++++++-- src/vxworks/riscv32.rs | 4 ++++ src/vxworks/riscv64.rs | 4 ++++ 5 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 src/vxworks/riscv32.rs create mode 100644 src/vxworks/riscv64.rs diff --git a/Cargo.toml b/Cargo.toml index ffce4f3241bda..40e8391110c13 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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", diff --git a/ci/build.sh b/ci/build.sh index 722626b43d686..d7d7b9f1bb7d3 100644 --- a/ci/build.sh +++ b/ci/build.sh @@ -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 \ diff --git a/src/vxworks/mod.rs b/src/vxworks/mod.rs index fc2aa5e51ae4c..efec114d052f4 100644 --- a/src/vxworks/mod.rs +++ b/src/vxworks/mod.rs @@ -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. @@ -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 } diff --git a/src/vxworks/riscv32.rs b/src/vxworks/riscv32.rs new file mode 100644 index 0000000000000..e617bb83c6ce3 --- /dev/null +++ b/src/vxworks/riscv32.rs @@ -0,0 +1,4 @@ +pub type c_char = i8; +pub type wchar_t = i32; +pub type c_long = i32; +pub type c_ulong = u32; diff --git a/src/vxworks/riscv64.rs b/src/vxworks/riscv64.rs new file mode 100644 index 0000000000000..5e95ea2567ddf --- /dev/null +++ b/src/vxworks/riscv64.rs @@ -0,0 +1,4 @@ +pub type c_char = i8; +pub type wchar_t = i32; +pub type c_long = i64; +pub type c_ulong = u64;