Define the C interface to vxWorks for x86, x86_64, ARM, ARM 64-bit, PowerPC, PowerPC SPE and PowerPC 64-bit.
This commit is contained in:
parent
636d86a951
commit
d18003a277
|
@ -224,6 +224,13 @@ x86_64-unknown-haiku \
|
|||
x86_64-unknown-hermit \
|
||||
x86_64-unknown-l4re-uclibc \
|
||||
x86_64-unknown-openbsd \
|
||||
armv7-wrs-vxworks \
|
||||
aarch64-wrs-vxworks \
|
||||
i686-wrs-vxworks \
|
||||
x86_64-wrs-vxworks \
|
||||
powerpc-wrs-vxworks \
|
||||
powerpc-wrs-vxworks-spe \
|
||||
powerpc64-wrs-vxworks \
|
||||
"
|
||||
|
||||
if [ "${RUST}" = "nightly" ] && [ "${OS}" = "linux" ]; then
|
||||
|
|
|
@ -115,8 +115,11 @@ cfg_if! {
|
|||
mod switch;
|
||||
pub use switch::*;
|
||||
} else if #[cfg(target_os = "vxworks")] {
|
||||
mod vxworks;
|
||||
pub use vxworks::*;
|
||||
mod fixed_width_ints;
|
||||
pub use fixed_width_ints::*;
|
||||
|
||||
mod vxworks;
|
||||
pub use vxworks::*;
|
||||
} else if #[cfg(unix)] {
|
||||
mod fixed_width_ints;
|
||||
pub use fixed_width_ints::*;
|
||||
|
|
|
@ -1,38 +1,3 @@
|
|||
pub type c_char = u8;
|
||||
pub type c_long = i64;
|
||||
pub type c_ulong = u64;
|
||||
|
||||
#[cfg(feature = "_WRS_KERNEL")]
|
||||
pub type _Vx_TASK_ID = *mut ::windTcb;
|
||||
|
||||
#[cfg(feature = "_WRS_KERNEL")]
|
||||
s! {
|
||||
pub struct OBJ_CORE {
|
||||
pub handle : ::HANDLE,
|
||||
pub ownerList : ::DL_LIST,
|
||||
pub ownerNode : ::DL_NODE,
|
||||
pub classNode : ::DL_NODE,
|
||||
pub ownerId : *mut ::OBJ_CORE,
|
||||
pub ownerRtpId : ::RTP_ID,
|
||||
pub name : *mut ::c_char,
|
||||
pub pObjClass : *mut ::wind_class,
|
||||
pub objHandleList : ::DL_LIST,
|
||||
pub refCnt : u16,
|
||||
pub accessCnt : u16,
|
||||
pub padding : u32, // There is a chance that Rust automatically pads, but
|
||||
// no point in risking it
|
||||
}
|
||||
|
||||
// semLibP.h
|
||||
pub struct semaphore {
|
||||
#[repr(align(16))]
|
||||
pub magic : ::OBJ_CORE,
|
||||
pub semType : u8,
|
||||
pub options : u8,
|
||||
pub recurse : u16,
|
||||
pub priInheritFlag : ::BOOL,
|
||||
pub qHead : ::Q_HEAD,
|
||||
pub state : ::size_t, //state is union of UINT and struct pointer
|
||||
pub events : ::EVENTS_RSRC,
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
pub type c_char = u8;
|
||||
pub type c_long = i32;
|
||||
pub type c_ulong = u32;
|
|
@ -1,35 +1,2 @@
|
|||
pub type c_long = i32;
|
||||
pub type c_ulong = u32;
|
||||
|
||||
#[cfg(feature = "_WRS_KERNEL")]
|
||||
pub type _Vx_TASK_ID = ::c_int;
|
||||
|
||||
#[cfg(feature = "_WRS_KERNEL")]
|
||||
s! {
|
||||
pub struct OBJ_CORE {
|
||||
pub handle : ::HANDLE,
|
||||
pub ownerList : ::DL_LIST,
|
||||
pub ownerNode : ::DL_NODE,
|
||||
pub classNode : ::DL_NODE,
|
||||
pub ownerId : *mut ::OBJ_CORE,
|
||||
pub ownerRtpId : ::RTP_ID,
|
||||
pub name : *mut ::c_char,
|
||||
pub pObjClass : *mut ::wind_class,
|
||||
pub objHandleList : ::DL_LIST,
|
||||
pub refCnt : u16,
|
||||
pub accessCnt : u16,
|
||||
}
|
||||
|
||||
// semLibP.h
|
||||
pub struct semaphore {
|
||||
#[repr(align(8))]
|
||||
pub magic : ::OBJ_CORE,
|
||||
pub semType : u8,
|
||||
pub options : u8,
|
||||
pub recurse : u16,
|
||||
pub priInheritFlag : ::BOOL,
|
||||
pub qHead : ::Q_HEAD,
|
||||
pub state : ::size_t, //state is union of UINT and struct pointer
|
||||
pub events : ::EVENTS_RSRC,
|
||||
}
|
||||
}
|
||||
|
|
2829
src/vxworks/mod.rs
2829
src/vxworks/mod.rs
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,3 @@
|
|||
pub type c_char = u8;
|
||||
pub type c_long = i32;
|
||||
pub type c_ulong = u32;
|
|
@ -0,0 +1,3 @@
|
|||
pub type c_char = u8;
|
||||
pub type c_long = i64;
|
||||
pub type c_ulong = u64;
|
|
@ -1,35 +1,3 @@
|
|||
pub type c_char = i8;
|
||||
pub type c_long = i32;
|
||||
pub type c_ulong = u32;
|
||||
|
||||
#[cfg(feature = "_WRS_KERNEL")]
|
||||
pub type _Vx_TASK_ID = ::c_int;
|
||||
|
||||
#[cfg(feature = "_WRS_KERNEL")]
|
||||
s! {
|
||||
pub struct OBJ_CORE {
|
||||
pub handle : ::HANDLE,
|
||||
pub ownerList : ::DL_LIST,
|
||||
pub ownerNode : ::DL_NODE,
|
||||
pub classNode : ::DL_NODE,
|
||||
pub ownerId : *mut ::OBJ_CORE,
|
||||
pub ownerRtpId : ::RTP_ID,
|
||||
pub name : *mut ::c_char,
|
||||
pub pObjClass : *mut ::wind_class,
|
||||
pub objHandleList : ::DL_LIST,
|
||||
pub refCnt : u16,
|
||||
pub accessCnt : u16,
|
||||
}
|
||||
|
||||
// semLibP.h
|
||||
pub struct semaphore {
|
||||
#[repr(align(8))]
|
||||
pub magic : ::OBJ_CORE,
|
||||
pub semType : u8,
|
||||
pub options : u8,
|
||||
pub recurse : u16,
|
||||
pub priInheritFlag : ::BOOL,
|
||||
pub qHead : ::Q_HEAD,
|
||||
pub state : ::size_t, //state is union of UINT and struct pointer
|
||||
pub events : ::EVENTS_RSRC,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,38 +1,3 @@
|
|||
pub type c_long = i64;
|
||||
pub type c_ulong = u64;
|
||||
|
||||
#[cfg(feature = "_WRS_KERNEL")]
|
||||
pub type _Vx_TASK_ID = *mut ::windTcb;
|
||||
|
||||
#[cfg(feature = "_WRS_KERNEL")]
|
||||
s! {
|
||||
pub struct OBJ_CORE {
|
||||
pub handle : ::HANDLE,
|
||||
pub ownerList : ::DL_LIST,
|
||||
pub ownerNode : ::DL_NODE,
|
||||
pub classNode : ::DL_NODE,
|
||||
pub ownerId : *mut ::OBJ_CORE,
|
||||
pub ownerRtpId : ::RTP_ID,
|
||||
pub name : *mut ::c_char,
|
||||
pub pObjClass : *mut ::wind_class,
|
||||
pub objHandleList : ::DL_LIST,
|
||||
pub refCnt : u16,
|
||||
pub accessCnt : u16,
|
||||
pub padding : u32, // There is a chance that Rust automatically pads, but
|
||||
// no point in risking it
|
||||
}
|
||||
|
||||
// semLibP.h
|
||||
pub struct semaphore {
|
||||
#[repr(align(16))]
|
||||
pub magic : ::OBJ_CORE,
|
||||
pub semType : u8,
|
||||
pub options : u8,
|
||||
pub recurse : u16,
|
||||
pub priInheritFlag : ::BOOL,
|
||||
pub qHead : ::Q_HEAD,
|
||||
pub state : ::size_t, //state is union of UINT and struct pointer
|
||||
pub events : ::EVENTS_RSRC,
|
||||
}
|
||||
|
||||
}
|
||||
pub type c_char = i8;
|
||||
|
|
Loading…
Reference in New Issue