about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2011-12-08 16:47:33 -0800
committerBrian Anderson <banderson@mozilla.com>2011-12-08 16:47:33 -0800
commit9e6ff44d9359ce062fb4f0e29c8f4c33eec7781e (patch)
treef1f2c3a3e45d836b9f2adf0b05c0aa8a88bd2f45 /src
parent0e74121ddb1cf366a474a2d156903edb9e8d9be0 (diff)
downloadrust-9e6ff44d9359ce062fb4f0e29c8f4c33eec7781e.tar.gz
rust-9e6ff44d9359ce062fb4f0e29c8f4c33eec7781e.zip
rt: Make __morestack work on win32
Diffstat (limited to 'src')
-rw-r--r--src/rt/arch/i386/morestack.S8
-rw-r--r--src/rt/arch/i386/record_sp.S10
-rw-r--r--src/rt/rust_scheduler.cpp1
3 files changed, 9 insertions, 10 deletions
diff --git a/src/rt/arch/i386/morestack.S b/src/rt/arch/i386/morestack.S
index 30084ec2de0..e90c521a302 100644
--- a/src/rt/arch/i386/morestack.S
+++ b/src/rt/arch/i386/morestack.S
@@ -21,7 +21,7 @@
 #define UPCALL_DEL_STACK        _upcall_del_stack
 #define RUST_GET_TASK           _rust_get_task
 #define UPCALL_CALL_C           _upcall_call_shim_on_c_stack
-#define MORESTACK               __morestack
+#define MORESTACK               ___morestack
 #endif
 #endif
 
@@ -44,7 +44,6 @@
 	.type MORESTACK,@function
 #endif
 
-#if defined(__linux__) || defined(__APPLE__)
 MORESTACK:
 #ifdef __linux__
 	.cfi_startproc
@@ -144,11 +143,6 @@ MORESTACK:
 	.cfi_endproc
 #endif
 
-#else
-MORESTACK:
-	ret
-#endif
-
 #ifdef __APPLE__
 
 	.section __IMPORT,__pointers,non_lazy_symbol_pointers
diff --git a/src/rt/arch/i386/record_sp.S b/src/rt/arch/i386/record_sp.S
index 3f299de5d15..0c9f0782846 100644
--- a/src/rt/arch/i386/record_sp.S
+++ b/src/rt/arch/i386/record_sp.S
@@ -16,18 +16,22 @@ RECORD_SP:
 	movl 4(%esp), %eax
 	movl %eax, %gs:48
 	ret
-#else
+#endif
+
 #if defined(__APPLE__)
 RECORD_SP:
 	movl $0x48+90*4, %eax
 	movl 4(%esp), %ecx
 	movl %ecx, %gs:(%eax)
 	ret
-#else
+#endif
+
+#if defined(_WIN32)
 RECORD_SP:
+	movl 4(%esp), %eax
+	movl %eax, %fs:0x14
 	ret
 #endif
-#endif
 
 GET_SP:
 	movl %esp, %eax
diff --git a/src/rt/rust_scheduler.cpp b/src/rt/rust_scheduler.cpp
index 601a7c3f0ef..03567bbe19a 100644
--- a/src/rt/rust_scheduler.cpp
+++ b/src/rt/rust_scheduler.cpp
@@ -394,6 +394,7 @@ void
 rust_scheduler::place_task_in_tls(rust_task *task) {
     BOOL result = TlsSetValue(task_key, task);
     assert(result && "Couldn't place the task in TLS!");
+    task->record_stack_limit();
 }
 
 rust_task *