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 seL4_WordBits type for arm target #19

Merged
merged 2 commits into from
May 2, 2018
Merged
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
23 changes: 23 additions & 0 deletions libsel4-sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,27 @@ pub unsafe extern "C" fn strcpy(
dest
}

#[cfg(target = "arm-sel4-helios")]
/// Number of bits in a `seL4_Word`.
///
/// # Remarks
///
/// Normally this is defined as the following macro:
/// ```
/// #define seL4_WordBits (sizeof(seL4_Word) * 8)
/// ```
///
/// For our `arm-sel4-helios` target see file:
/// `libsel4/sel4_arch_include/aarch32/sel4/sel4_arch/constants.h`
///
/// However due to bindgen not being able to expand functional
/// macros, the type gets ignored.
///
/// For the time being, we just provide the constant here.
///
/// See following issues for more information:
/// - `rust-bindgen/issues/753`
/// - `feL4-dependencies/issues/18`
pub const seL4_WordBits: u32 = 32;

include!(concat!(env!("OUT_DIR"), "/bindings.rs"));