about summary refs log tree commit diff
path: root/src/rt
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2011-12-06 21:19:59 -0800
committerBrian Anderson <banderson@mozilla.com>2011-12-06 21:44:19 -0800
commit3d7b89bc4dc63632ee0003869811933ddc1962e9 (patch)
tree114c91fc52128e40d73053b99cb9f800cd32f11e /src/rt
parent00636e3155647f843fb1f8e8c981429feb8dd7f2 (diff)
downloadrust-3d7b89bc4dc63632ee0003869811933ddc1962e9.tar.gz
rust-3d7b89bc4dc63632ee0003869811933ddc1962e9.zip
rt: Reorganize rust_upcall.cpp a bit
Diffstat (limited to 'src/rt')
-rw-r--r--src/rt/rust_upcall.cpp68
1 files changed, 36 insertions, 32 deletions
diff --git a/src/rt/rust_upcall.cpp b/src/rt/rust_upcall.cpp
index 22dc18982d5..e4b646e39ff 100644
--- a/src/rt/rust_upcall.cpp
+++ b/src/rt/rust_upcall.cpp
@@ -288,38 +288,6 @@ upcall_s_dynastack_free(s_dynastack_free_args *args) {
     return rust_scheduler::get_task()->dynastack.free(args->ptr);
 }
 
-struct rust_new_stack2_args {
-    void *new_stack;
-    size_t stk_sz;
-    void *args_addr;
-    size_t args_sz;
-};
-
-// A new stack function suitable for calling through
-// upcall_call_shim_on_c_stack
-extern "C" CDECL void
-upcall_new_stack(struct rust_new_stack2_args *args) {
-    rust_task *task = rust_scheduler::get_task();
-    args->new_stack = task->new_stack(args->stk_sz,
-                                      args->args_addr,
-                                      args->args_sz);
-}
-
-extern "C" CDECL void
-upcall_del_stack() {
-    rust_task *task = rust_scheduler::get_task();
-    task->del_stack();
-}
-
-// Landing pads need to call this to insert the
-// correct limit into TLS.
-// NB: This must be called on the Rust stack
-extern "C" CDECL void
-upcall_reset_stack_limit() {
-    rust_task *task = rust_scheduler::get_task();
-    task->reset_stack_limit();
-}
-
 extern "C" _Unwind_Reason_Code
 __gxx_personality_v0(int version,
                      _Unwind_Action actions,
@@ -506,6 +474,42 @@ upcall_log_type(const type_desc *tydesc, uint8_t *data, uint32_t level) {
     upcall_s_log_type(&args);
 }
 
+struct rust_new_stack2_args {
+    void *new_stack;
+    size_t stk_sz;
+    void *args_addr;
+    size_t args_sz;
+};
+
+// A new stack function suitable for calling through
+// upcall_call_shim_on_c_stack
+// FIXME: Convert this to the same arrangement as
+// the other upcalls, simplify __morestack
+extern "C" CDECL void
+upcall_new_stack(struct rust_new_stack2_args *args) {
+    rust_task *task = rust_scheduler::get_task();
+    args->new_stack = task->new_stack(args->stk_sz,
+                                      args->args_addr,
+                                      args->args_sz);
+}
+
+// FIXME: As above
+extern "C" CDECL void
+upcall_del_stack() {
+    rust_task *task = rust_scheduler::get_task();
+    task->del_stack();
+}
+
+// Landing pads need to call this to insert the
+// correct limit into TLS.
+// NB: This must run on the Rust stack because it
+// needs to acquire the value of the stack pointer
+extern "C" CDECL void
+upcall_reset_stack_limit() {
+    rust_task *task = rust_scheduler::get_task();
+    task->reset_stack_limit();
+}
+
 //
 // Local Variables:
 // mode: C++