#![no_std]
#![feature(asm, core_slice_ext)]
#![allow(bad_style, unused_parens, unused_assignments)]
#![doc(html_root_url = "https://doc.robigalia.org/")]
#[cfg(not(any(
all(target_arch = "arm", target_pointer_width = "32"),
all(target_arch = "x86", target_pointer_width = "32")
)))]
use architecture_not_supported_sorry;
extern crate rlibc;
#[macro_use] extern crate bitflags;
pub use seL4_Error::*;
pub use seL4_FaultType::*;
pub use seL4_LookupFailureType::*;
pub use seL4_ObjectType::*;
macro_rules! error_types {
($int_width:ident) => {
bitflags! {
pub flags seL4_CapRights: $int_width {
const seL4_CanWrite = 0x1,
const seL4_CanRead = 0x2,
const seL4_CanGrant = 0x4
}
}
#[repr($int_width)]
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub enum seL4_Error {
seL4_NoError = 0,
seL4_InvalidArgument,
seL4_InvalidCapability,
seL4_IllegalOperation,
seL4_RangeError,
seL4_AlignmentError,
seL4_FailedLookup,
seL4_TruncatedMessage,
seL4_DeleteFirst,
seL4_RevokeFirst,
seL4_NotEnoughMemory,
}
#[repr($int_width)]
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub enum seL4_FaultType {
seL4_NoFault = 0,
seL4_CapFault,
seL4_VMFault,
seL4_UnknownSyscall,
seL4_UserException,
}
#[repr($int_width)]
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub enum seL4_LookupFailureType {
seL4_NoFailure = 0,
seL4_InvalidRoot,
seL4_MissingCapability,
seL4_DepthMismatch,
seL4_GuardMismatch,
}
}
}
#[cfg(all(target_arch = "x86", target_pointer_width = "32"))]
include!("arch/x86.rs");
#[cfg(all(target_arch = "arm", target_pointer_width = "32"))]
include!("arch/arm.rs");
#[cfg(all(target_arch = "x86", target_pointer_width = "32"))]
include!(concat!(env!("OUT_DIR"), "/ia32_invocation.rs"));
#[cfg(all(target_arch = "arm", target_pointer_width = "32"))]
include!(concat!(env!("OUT_DIR"), "/aarch32_invocation.rs"));
#[cfg(all(target_arch = "x86", target_pointer_width = "32"))]
include!(concat!(env!("OUT_DIR"), "/ia32_syscall_stub.rs"));
#[cfg(all(target_arch = "arm", target_pointer_width = "32"))]
include!(concat!(env!("OUT_DIR"), "/aarch32_syscall_stub.rs"));
include!(concat!(env!("OUT_DIR"), "/types.rs"));
include!(concat!(env!("OUT_DIR"), "/syscalls.rs"));
pub type seL4_CNode = seL4_CPtr;
pub type seL4_IRQHandler = seL4_CPtr;
pub type seL4_IRQControl = seL4_CPtr;
pub type seL4_TCB = seL4_CPtr;
pub type seL4_Untyped = seL4_CPtr;
pub type seL4_DomainSet = seL4_CPtr;
pub const seL4_MsgLengthBits: usize = 7;
pub const seL4_MsgMaxLength: usize = 120;
pub const seL4_MsgExtraCapBits: usize = 2;
pub const seL4_MsgMaxExtraCaps: usize = (1usize << seL4_MsgExtraCapBits) - 1;
#[repr(C)]
#[derive(Copy)]
pub struct seL4_IPCBuffer {
pub tag: seL4_MessageInfo,
pub msg: [seL4_Word; seL4_MsgMaxLength],
pub userData: seL4_Word,
pub caps_or_badges: [seL4_Word; seL4_MsgMaxExtraCaps],
pub receiveCNode: seL4_CPtr,
pub receiveIndex: seL4_CPtr,
pub receiveDepth: seL4_CPtr,
}
impl ::core::clone::Clone for seL4_IPCBuffer {
fn clone(&self) -> Self {
*self
}
}
pub static seL4_CapNull: seL4_Word = 0;
pub static seL4_CapInitThreadTCB: seL4_Word = 1;
pub static seL4_CapInitThreadCNode: seL4_Word = 2;
pub static seL4_CapInitThreadVSpace: seL4_Word = 3;
pub static seL4_CapIRQControl: seL4_Word = 4;
pub static seL4_CapASIDControl: seL4_Word = 5;
pub static seL4_CapInitThreadASIDPool: seL4_Word = 6;
pub static seL4_CapIOPort: seL4_Word = 7;
pub static seL4_CapIOSpace: seL4_Word = 8;
pub static seL4_CapBootInfoFrame: seL4_Word = 9;
pub static seL4_CapInitThreadIPCBuffer: seL4_Word = 10;
pub static seL4_CapDomain: seL4_Word = 11;
#[repr(C)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct seL4_SlotRegion {
pub start: seL4_Word,
pub end: seL4_Word,
}
#[repr(C)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct seL4_DeviceRegion {
pub basePaddr: seL4_Word,
pub frameSizeBits: seL4_Word,
pub frames: seL4_SlotRegion,
}
pub const CONFIG_MAX_NUM_BOOTINFO_UNTYPED_CAPS: usize = 166;
pub const CONFIG_MAX_NUM_BOOTINFO_DEVICE_REGIONS: usize = 199;
#[repr(C)]
#[derive(Copy)]
pub struct seL4_BootInfo {
pub nodeID: seL4_Word,
pub numNodes: seL4_Word,
pub numIOPTLevels: seL4_Word,
pub ipcBuffer: *mut seL4_IPCBuffer,
pub empty: seL4_SlotRegion,
pub sharedFrames: seL4_SlotRegion,
pub userImageFrames: seL4_SlotRegion,
pub userImagePaging: seL4_SlotRegion,
pub untyped: seL4_SlotRegion,
pub ioSpaceCaps: seL4_SlotRegion,
pub untypedPaddrList: [seL4_Word; CONFIG_MAX_NUM_BOOTINFO_UNTYPED_CAPS],
pub untypedSizeBitsList: [u8; CONFIG_MAX_NUM_BOOTINFO_UNTYPED_CAPS],
pub initThreadCNodeSizeBits: u8,
pub numDeviceRegions: seL4_Word,
pub deviceRegions: [seL4_DeviceRegion; CONFIG_MAX_NUM_BOOTINFO_DEVICE_REGIONS],
pub initThreadDomain: u32,
}
impl ::core::clone::Clone for seL4_BootInfo {
fn clone(&self) -> Self {
*self
}
}