From cd8f31759fd04b9ce9c903fa00cae81dc5bba546 Mon Sep 17 00:00:00 2001 From: Dave Huseby Date: Fri, 16 Jan 2015 23:51:04 -0800 Subject: bitrig integration --- src/libstd/sys/common/stack.rs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'src/libstd/sys/common/stack.rs') diff --git a/src/libstd/sys/common/stack.rs b/src/libstd/sys/common/stack.rs index 8dd2f154fa8..bc4ea662318 100644 --- a/src/libstd/sys/common/stack.rs +++ b/src/libstd/sys/common/stack.rs @@ -189,11 +189,18 @@ pub unsafe fn record_sp_limit(limit: uint) { unsafe fn target_record_sp_limit(limit: uint) { asm!("movq $0, %fs:24" :: "r"(limit) :: "volatile") } - #[cfg(all(target_arch = "x86_64", target_os = "dragonfly"))] #[inline(always)] + #[cfg(all(target_arch = "x86_64", target_os = "dragonfly"))] + #[inline(always)] unsafe fn target_record_sp_limit(limit: uint) { asm!("movq $0, %fs:32" :: "r"(limit) :: "volatile") } + #[cfg(target_os = "bitrig")] + #[inline(always)] + unsafe fn target_record_sp_limit(_: uint) { + // segmented stacks are disabled + } + // x86 #[cfg(all(target_arch = "x86", any(target_os = "macos", target_os = "ios")))] @@ -276,12 +283,18 @@ pub unsafe fn get_sp_limit() -> uint { asm!("movq %fs:24, $0" : "=r"(limit) ::: "volatile"); return limit; } - #[cfg(all(target_arch = "x86_64", target_os = "dragonfly"))] #[inline(always)] + #[cfg(all(target_arch = "x86_64", target_os = "dragonfly"))] + #[inline(always)] unsafe fn target_get_sp_limit() -> uint { let limit; asm!("movq %fs:32, $0" : "=r"(limit) ::: "volatile"); return limit; } + #[cfg(target_os = "bitrig")] + #[inline(always)] + unsafe fn target_get_sp_limit() -> uint { + return 2048; + } // x86 -- cgit 1.4.1-3-g733a5