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 more archs definition for openbsd #2591

Merged
merged 2 commits into from
Dec 13, 2021
Merged
Show file tree
Hide file tree
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
16 changes: 16 additions & 0 deletions src/unix/bsd/netbsdlike/openbsd/arm.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
pub type c_long = i32;
pub type c_ulong = u32;
pub type c_char = u8;

// should be pub(crate), but that requires Rust 1.18.0
cfg_if! {
if #[cfg(libc_const_size_of)] {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_double>() - 1;
} else {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = 8 - 1;
}
}

pub const _MAX_PAGE_SHIFT: u32 = 12;
8 changes: 8 additions & 0 deletions src/unix/bsd/netbsdlike/openbsd/mips64.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
pub type c_long = i64;
pub type c_ulong = u64;
pub type c_char = i8;

#[doc(hidden)]
pub const _ALIGNBYTES: usize = 7;

pub const _MAX_PAGE_SHIFT: u32 = 14;
29 changes: 22 additions & 7 deletions src/unix/bsd/netbsdlike/openbsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1648,18 +1648,33 @@ cfg_if! {
}

cfg_if! {
if #[cfg(target_arch = "x86")] {
mod x86;
pub use self::x86::*;
} else if #[cfg(target_arch = "x86_64")] {
mod x86_64;
pub use self::x86_64::*;
} else if #[cfg(target_arch = "aarch64")] {
if #[cfg(target_arch = "aarch64")] {
mod aarch64;
pub use self::aarch64::*;
} else if #[cfg(target_arch = "arm")] {
mod arm;
pub use self::arm::*;
} else if #[cfg(target_arch = "mips64")] {
mod mips64;
pub use self::mips64::*;
} else if #[cfg(target_arch = "powerpc")] {
mod powerpc;
pub use self::powerpc::*;
} else if #[cfg(target_arch = "powerpc64")] {
mod powerpc64;
pub use self::powerpc64::*;
} else if #[cfg(target_arch = "riscv64")] {
mod riscv64;
pub use self::riscv64::*;
} else if #[cfg(target_arch = "sparc64")] {
mod sparc64;
pub use self::sparc64::*;
} else if #[cfg(target_arch = "x86")] {
mod x86;
pub use self::x86::*;
} else if #[cfg(target_arch = "x86_64")] {
mod x86_64;
pub use self::x86_64::*;
} else {
// Unknown target_arch
}
Expand Down
16 changes: 16 additions & 0 deletions src/unix/bsd/netbsdlike/openbsd/powerpc.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
pub type c_long = i32;
pub type c_ulong = u32;
pub type c_char = u8;

// should be pub(crate), but that requires Rust 1.18.0
cfg_if! {
if #[cfg(libc_const_size_of)] {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_double>() - 1;
} else {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = 8 - 1;
}
}

pub const _MAX_PAGE_SHIFT: u32 = 12;
16 changes: 16 additions & 0 deletions src/unix/bsd/netbsdlike/openbsd/powerpc64.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
pub type c_long = i64;
pub type c_ulong = u64;
pub type c_char = u8;

// should be pub(crate), but that requires Rust 1.18.0
cfg_if! {
if #[cfg(libc_const_size_of)] {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1;
} else {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = 8 - 1;
}
}

pub const _MAX_PAGE_SHIFT: u32 = 12;
16 changes: 16 additions & 0 deletions src/unix/bsd/netbsdlike/openbsd/riscv64.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
pub type c_long = i64;
pub type c_ulong = u64;
pub type c_char = u8;

// should be pub(crate), but that requires Rust 1.18.0
cfg_if! {
if #[cfg(libc_const_size_of)] {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1;
} else {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = 8 - 1;
}
}

pub const _MAX_PAGE_SHIFT: u32 = 12;