Skip to content

Commit

Permalink
Auto merge of #1470 - semarie:openbsd-sparc64, r=gnzlbg
Browse files Browse the repository at this point in the history
add support for sparc64 on OpenBSD
  • Loading branch information
bors committed Aug 15, 2019
2 parents 37f8f8d + 1a45839 commit dab1050
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/unix/bsd/netbsdlike/openbsd/aarch64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ cfg_if! {
pub const _ALIGNBYTES: usize = 8 - 1;
}
}

pub const _MAX_PAGE_SHIFT: u32 = 12;
8 changes: 6 additions & 2 deletions src/unix/bsd/netbsdlike/openbsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1297,8 +1297,9 @@ pub const IFF_LINK1: ::c_int = 0x2000; // per link layer defined bit
pub const IFF_LINK2: ::c_int = 0x4000; // per link layer defined bit
pub const IFF_MULTICAST: ::c_int = 0x8000; // supports multicast

pub const PTHREAD_STACK_MIN : ::size_t = 4096;
pub const SIGSTKSZ : ::size_t = 28672;
pub const PTHREAD_STACK_MIN: ::size_t = (1_usize << _MAX_PAGE_SHIFT);
pub const MINSIGSTKSZ: ::size_t = (3_usize << _MAX_PAGE_SHIFT);
pub const SIGSTKSZ: ::size_t = MINSIGSTKSZ + (1_usize << _MAX_PAGE_SHIFT) * 4;

pub const PT_FIRSTMACH: ::c_int = 32;

Expand Down Expand Up @@ -1437,6 +1438,9 @@ cfg_if! {
} else if #[cfg(target_arch = "aarch64")] {
mod aarch64;
pub use self::aarch64::*;
} else if #[cfg(target_arch = "sparc64")] {
mod sparc64;
pub use self::sparc64::*;
} else {
// Unknown target_arch
}
Expand Down
8 changes: 8 additions & 0 deletions src/unix/bsd/netbsdlike/openbsd/sparc64.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 = 0xf;

pub const _MAX_PAGE_SHIFT: u32 = 13;
2 changes: 2 additions & 0 deletions src/unix/bsd/netbsdlike/openbsd/x86.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ cfg_if! {
pub const _ALIGNBYTES: usize = 4 - 1;
}
}

pub const _MAX_PAGE_SHIFT: u32 = 12;
2 changes: 2 additions & 0 deletions src/unix/bsd/netbsdlike/openbsd/x86_64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ cfg_if! {
}
}

pub const _MAX_PAGE_SHIFT: u32 = 12;

pub const PT_STEP: ::c_int = PT_FIRSTMACH + 0;
pub const PT_GETREGS: ::c_int = PT_FIRSTMACH + 1;
pub const PT_SETREGS: ::c_int = PT_FIRSTMACH + 2;
Expand Down

0 comments on commit dab1050

Please sign in to comment.