Skip to content

Commit 3c09095

Browse files
biabbastgross35
authored andcommitted
Make vxworks functions public and add Risc-V targets
(backport <rust-lang#3935>) (cherry picked from commit dd20281)
1 parent 9285f0e commit 3c09095

File tree

5 files changed

+20
-2
lines changed

5 files changed

+20
-2
lines changed

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,14 @@ targets = [
8585
"riscv32i-unknown-none-elf",
8686
"riscv32imac-unknown-none-elf",
8787
"riscv32imc-unknown-none-elf",
88+
"riscv32-wrs-vxworks",
8889
"riscv64gc-unknown-freebsd",
8990
"riscv64gc-unknown-hermit",
9091
"riscv64gc-unknown-linux-gnu",
9192
"riscv64gc-unknown-linux-musl",
9293
"riscv64gc-unknown-none-elf",
9394
"riscv64imac-unknown-none-elf",
95+
"riscv64-wrs-vxworks",
9496
"s390x-unknown-linux-gnu",
9597
"s390x-unknown-linux-musl",
9698
"sparc-unknown-linux-gnu",

ci/build.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,11 +252,13 @@ riscv32i-unknown-none-elf \
252252
riscv32imac-unknown-none-elf \
253253
riscv32imc-unknown-none-elf \
254254
riscv32gc-unknown-linux-gnu \
255+
riscv32-wrs-vxworks \
255256
riscv64gc-unknown-freebsd \
256257
riscv64gc-unknown-hermit \
257258
riscv64gc-unknown-linux-musl \
258259
riscv64gc-unknown-none-elf \
259260
riscv64imac-unknown-none-elf \
261+
riscv64-wrs-vxworks \
260262
s390x-unknown-linux-musl \
261263
sparc-unknown-linux-gnu \
262264
sparc64-unknown-netbsd \

src/vxworks/mod.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1878,8 +1878,8 @@ extern "C" {
18781878
pub fn mq_setattr(mqd: ::mqd_t, newattr: *const ::mq_attr, oldattr: *mut ::mq_attr) -> ::c_int;
18791879

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

18851885
//Dummy functions, these don't really exist in VxWorks.
@@ -1980,6 +1980,12 @@ cfg_if! {
19801980
} else if #[cfg(target_arch = "powerpc64")] {
19811981
mod powerpc64;
19821982
pub use self::powerpc64::*;
1983+
} else if #[cfg(target_arch = "riscv32")] {
1984+
mod riscv32;
1985+
pub use self::riscv32::*;
1986+
} else if #[cfg(target_arch = "riscv64")] {
1987+
mod riscv64;
1988+
pub use self::riscv64::*;
19831989
} else {
19841990
// Unknown target_arch
19851991
}

src/vxworks/riscv32.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
pub type c_char = i8;
2+
pub type wchar_t = i32;
3+
pub type c_long = i32;
4+
pub type c_ulong = u32;

src/vxworks/riscv64.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
pub type c_char = i8;
2+
pub type wchar_t = i32;
3+
pub type c_long = i64;
4+
pub type c_ulong = u64;

0 commit comments

Comments
 (0)