about summary refs log tree commit diff
path: root/src/rt
diff options
context:
space:
mode:
authorklutzy <klutzytheklutzy@gmail.com>2013-08-11 17:56:37 +0900
committerklutzy <klutzytheklutzy@gmail.com>2013-08-26 22:14:31 +0900
commita35bfa2e9bc73cbdd420588dd098f91cd7afa172 (patch)
tree8013a231ecabd628418b65978bfd6ddafdb9bb8b /src/rt
parent5118ef6ff02c650e54fc89318e7183e4e1cd3fa3 (diff)
downloadrust-a35bfa2e9bc73cbdd420588dd098f91cd7afa172.tar.gz
rust-a35bfa2e9bc73cbdd420588dd098f91cd7afa172.zip
rt: Add {get,record}_sp_limit on Win64
Uses ArbitraryUserPointer area at gs:0x28.
Diffstat (limited to 'src/rt')
-rw-r--r--src/rt/arch/x86_64/sp.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/rt/arch/x86_64/sp.h b/src/rt/arch/x86_64/sp.h
index bf011f4d019..764927759fe 100644
--- a/src/rt/arch/x86_64/sp.h
+++ b/src/rt/arch/x86_64/sp.h
@@ -43,6 +43,10 @@ extern "C" CDECL ALWAYS_INLINE uintptr_t get_sp_limit() {
     asm volatile (
         "movq %%fs:24, %0"
         : "=r"(limit));
+#elif defined(_WIN64)
+    asm volatile (
+        "movq %%gs:0x28, %0"
+        : "=r"(limit));
 #endif
 
     return limit;
@@ -65,6 +69,10 @@ extern "C" CDECL ALWAYS_INLINE void record_sp_limit(void *limit) {
     asm volatile (
         "movq %0, %%fs:24"
         :: "r"(limit));
+#elif defined(_WIN64)
+    asm volatile (
+        "movq %0, %%gs:0x28"
+        :: "r"(limit));
 #endif
 }