From 1cb35c9b2653d437e1981f4162a436e5e2766074 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Wed, 21 Mar 2012 14:12:12 -0700 Subject: [PATCH] rt: Rename record_sp to record_sp_limit --- src/rt/arch/i386/record_sp.S | 12 ++++++------ src/rt/arch/x86_64/record_sp.S | 14 +++++++------- src/rt/rust_task.h | 4 ++-- src/rt/rust_upcall.cpp | 6 +++--- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/rt/arch/i386/record_sp.S b/src/rt/arch/i386/record_sp.S index 1b698ed74bf5..b9a08d9f9f30 100644 --- a/src/rt/arch/i386/record_sp.S +++ b/src/rt/arch/i386/record_sp.S @@ -1,28 +1,28 @@ .text #if defined(__APPLE__) || defined(_WIN32) -#define RECORD_SP _record_sp +#define RECORD_SP_LIMIT _record_sp_limit #define GET_SP _get_sp #define CHECK_STACK _check_stack_alignment #else -#define RECORD_SP record_sp +#define RECORD_SP_LIMIT record_sp_limit #define GET_SP get_sp #define CHECK_STACK check_stack_alignment #endif -.globl RECORD_SP +.globl RECORD_SP_LIMIT .globl GET_SP .globl CHECK_STACK #if defined(__linux__) || defined(__FreeBSD__) -RECORD_SP: +RECORD_SP_LIMIT: movl 4(%esp), %eax movl %eax, %gs:48 ret #endif #if defined(__APPLE__) -RECORD_SP: +RECORD_SP_LIMIT: movl $0x48+90*4, %eax movl 4(%esp), %ecx movl %ecx, %gs:(%eax) @@ -30,7 +30,7 @@ RECORD_SP: #endif #if defined(_WIN32) -RECORD_SP: +RECORD_SP_LIMIT: movl 4(%esp), %eax movl %eax, %fs:0x14 ret diff --git a/src/rt/arch/x86_64/record_sp.S b/src/rt/arch/x86_64/record_sp.S index 3b238d33c778..87b6633d9f2c 100644 --- a/src/rt/arch/x86_64/record_sp.S +++ b/src/rt/arch/x86_64/record_sp.S @@ -1,34 +1,34 @@ .text #if defined(__APPLE__) || defined(_WIN32) -#define RECORD_SP _record_sp +#define RECORD_SP_LIMIT _record_sp_limit #define GET_SP _get_sp #define CHECK_STACK _check_stack_alignment #else -#define RECORD_SP record_sp +#define RECORD_SP_LIMIT record_sp_limit #define GET_SP get_sp #define CHECK_STACK check_stack_alignment #endif -.globl RECORD_SP +.globl RECORD_SP_LIMIT .globl GET_SP .globl CHECK_STACK #if defined(__linux__) -RECORD_SP: +RECORD_SP_LIMIT: movq %rdi, %fs:112 ret #elif defined(__APPLE__) -RECORD_SP: +RECORD_SP_LIMIT: movq $0x60+90*8, %rsi movq %rdi, %gs:(%rsi) ret #elif defined(__FreeBSD__) -RECORD_SP: +RECORD_SP_LIMIT: movq %rdi, %fs:24 ret #else -RECORD_SP: +RECORD_SP_LIMIT: ret #endif diff --git a/src/rt/rust_task.h b/src/rt/rust_task.h index 0d5a1987b747..8ffc9c8c1dbd 100644 --- a/src/rt/rust_task.h +++ b/src/rt/rust_task.h @@ -427,7 +427,7 @@ rust_task::prev_stack() { } extern "C" CDECL void -record_sp(void *limit); +record_sp_limit(void *limit); inline void rust_task::record_stack_limit() { @@ -442,7 +442,7 @@ rust_task::record_stack_limit() { (uintptr_t)stk->end - RED_ZONE_SIZE - (uintptr_t)stk->data >= LIMIT_OFFSET, "Stack size must be greater than LIMIT_OFFSET"); - record_sp(stk->data + LIMIT_OFFSET + RED_ZONE_SIZE); + record_sp_limit(stk->data + LIMIT_OFFSET + RED_ZONE_SIZE); } diff --git a/src/rt/rust_upcall.cpp b/src/rt/rust_upcall.cpp index cd8b4993cbeb..58798147e9b1 100644 --- a/src/rt/rust_upcall.cpp +++ b/src/rt/rust_upcall.cpp @@ -50,7 +50,7 @@ call_upcall_on_c_stack(void *args, void *fn_ptr) { task->call_on_c_stack(args, fn_ptr); } -extern "C" void record_sp(void *limit); +extern "C" void record_sp_limit(void *limit); /********************************************************************** * Switches to the C-stack and invokes |fn_ptr|, passing |args| as argument. @@ -66,7 +66,7 @@ upcall_call_shim_on_c_stack(void *args, void *fn_ptr) { // FIXME (1226) - The shim functions generated by rustc contain the // morestack prologue, so we need to let them know they have enough // stack. - record_sp(0); + record_sp_limit(0); try { task->call_on_c_stack(args, fn_ptr); @@ -102,7 +102,7 @@ upcall_call_shim_on_rust_stack(void *args, void *fn_ptr) { } // FIXME: As above - record_sp(0); + record_sp_limit(0); } /**********************************************************************/