Skip to content

Commit dab1050

Browse files
committed
Auto merge of #1470 - semarie:openbsd-sparc64, r=gnzlbg
add support for sparc64 on OpenBSD
2 parents 37f8f8d + 1a45839 commit dab1050

File tree

5 files changed

+20
-2
lines changed

5 files changed

+20
-2
lines changed

src/unix/bsd/netbsdlike/openbsd/aarch64.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,5 @@ cfg_if! {
1212
pub const _ALIGNBYTES: usize = 8 - 1;
1313
}
1414
}
15+
16+
pub const _MAX_PAGE_SHIFT: u32 = 12;

src/unix/bsd/netbsdlike/openbsd/mod.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1297,8 +1297,9 @@ pub const IFF_LINK1: ::c_int = 0x2000; // per link layer defined bit
12971297
pub const IFF_LINK2: ::c_int = 0x4000; // per link layer defined bit
12981298
pub const IFF_MULTICAST: ::c_int = 0x8000; // supports multicast
12991299

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

13031304
pub const PT_FIRSTMACH: ::c_int = 32;
13041305

@@ -1437,6 +1438,9 @@ cfg_if! {
14371438
} else if #[cfg(target_arch = "aarch64")] {
14381439
mod aarch64;
14391440
pub use self::aarch64::*;
1441+
} else if #[cfg(target_arch = "sparc64")] {
1442+
mod sparc64;
1443+
pub use self::sparc64::*;
14401444
} else {
14411445
// Unknown target_arch
14421446
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
pub type c_long = i64;
2+
pub type c_ulong = u64;
3+
pub type c_char = i8;
4+
5+
#[doc(hidden)]
6+
pub const _ALIGNBYTES: usize = 0xf;
7+
8+
pub const _MAX_PAGE_SHIFT: u32 = 13;

src/unix/bsd/netbsdlike/openbsd/x86.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,5 @@ cfg_if! {
1212
pub const _ALIGNBYTES: usize = 4 - 1;
1313
}
1414
}
15+
16+
pub const _MAX_PAGE_SHIFT: u32 = 12;

src/unix/bsd/netbsdlike/openbsd/x86_64.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ cfg_if! {
1515
}
1616
}
1717

18+
pub const _MAX_PAGE_SHIFT: u32 = 12;
19+
1820
pub const PT_STEP: ::c_int = PT_FIRSTMACH + 0;
1921
pub const PT_GETREGS: ::c_int = PT_FIRSTMACH + 1;
2022
pub const PT_SETREGS: ::c_int = PT_FIRSTMACH + 2;

0 commit comments

Comments
 (0)