Skip to content

Commit d18003a

Browse files
committed
Define the C interface to vxWorks for x86, x86_64, ARM, ARM 64-bit, PowerPC, PowerPC SPE and PowerPC 64-bit.
1 parent 636d86a commit d18003a

File tree

11 files changed

+1561
-1424
lines changed

11 files changed

+1561
-1424
lines changed

ci/build.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,13 @@ x86_64-unknown-haiku \
224224
x86_64-unknown-hermit \
225225
x86_64-unknown-l4re-uclibc \
226226
x86_64-unknown-openbsd \
227+
armv7-wrs-vxworks \
228+
aarch64-wrs-vxworks \
229+
i686-wrs-vxworks \
230+
x86_64-wrs-vxworks \
231+
powerpc-wrs-vxworks \
232+
powerpc-wrs-vxworks-spe \
233+
powerpc64-wrs-vxworks \
227234
"
228235

229236
if [ "${RUST}" = "nightly" ] && [ "${OS}" = "linux" ]; then

src/lib.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,11 @@ cfg_if! {
115115
mod switch;
116116
pub use switch::*;
117117
} else if #[cfg(target_os = "vxworks")] {
118-
mod vxworks;
119-
pub use vxworks::*;
118+
mod fixed_width_ints;
119+
pub use fixed_width_ints::*;
120+
121+
mod vxworks;
122+
pub use vxworks::*;
120123
} else if #[cfg(unix)] {
121124
mod fixed_width_ints;
122125
pub use fixed_width_ints::*;

src/vxworks/aarch64.rs

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,3 @@
1+
pub type c_char = u8;
12
pub type c_long = i64;
23
pub type c_ulong = u64;
3-
4-
#[cfg(feature = "_WRS_KERNEL")]
5-
pub type _Vx_TASK_ID = *mut ::windTcb;
6-
7-
#[cfg(feature = "_WRS_KERNEL")]
8-
s! {
9-
pub struct OBJ_CORE {
10-
pub handle : ::HANDLE,
11-
pub ownerList : ::DL_LIST,
12-
pub ownerNode : ::DL_NODE,
13-
pub classNode : ::DL_NODE,
14-
pub ownerId : *mut ::OBJ_CORE,
15-
pub ownerRtpId : ::RTP_ID,
16-
pub name : *mut ::c_char,
17-
pub pObjClass : *mut ::wind_class,
18-
pub objHandleList : ::DL_LIST,
19-
pub refCnt : u16,
20-
pub accessCnt : u16,
21-
pub padding : u32, // There is a chance that Rust automatically pads, but
22-
// no point in risking it
23-
}
24-
25-
// semLibP.h
26-
pub struct semaphore {
27-
#[repr(align(16))]
28-
pub magic : ::OBJ_CORE,
29-
pub semType : u8,
30-
pub options : u8,
31-
pub recurse : u16,
32-
pub priInheritFlag : ::BOOL,
33-
pub qHead : ::Q_HEAD,
34-
pub state : ::size_t, //state is union of UINT and struct pointer
35-
pub events : ::EVENTS_RSRC,
36-
}
37-
38-
}

src/vxworks/arm.rs

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

src/vxworks/armv7.rs

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,2 @@
11
pub type c_long = i32;
22
pub type c_ulong = u32;
3-
4-
#[cfg(feature = "_WRS_KERNEL")]
5-
pub type _Vx_TASK_ID = ::c_int;
6-
7-
#[cfg(feature = "_WRS_KERNEL")]
8-
s! {
9-
pub struct OBJ_CORE {
10-
pub handle : ::HANDLE,
11-
pub ownerList : ::DL_LIST,
12-
pub ownerNode : ::DL_NODE,
13-
pub classNode : ::DL_NODE,
14-
pub ownerId : *mut ::OBJ_CORE,
15-
pub ownerRtpId : ::RTP_ID,
16-
pub name : *mut ::c_char,
17-
pub pObjClass : *mut ::wind_class,
18-
pub objHandleList : ::DL_LIST,
19-
pub refCnt : u16,
20-
pub accessCnt : u16,
21-
}
22-
23-
// semLibP.h
24-
pub struct semaphore {
25-
#[repr(align(8))]
26-
pub magic : ::OBJ_CORE,
27-
pub semType : u8,
28-
pub options : u8,
29-
pub recurse : u16,
30-
pub priInheritFlag : ::BOOL,
31-
pub qHead : ::Q_HEAD,
32-
pub state : ::size_t, //state is union of UINT and struct pointer
33-
pub events : ::EVENTS_RSRC,
34-
}
35-
}

src/vxworks/armv7le.rs

Whitespace-only changes.

0 commit comments

Comments
 (0)