Update of /cvsroot/sbcl/sbcl/src/runtime
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28100/src/runtime
Modified Files:
breakpoint.c x86-64-arch.c x86-64-assem.S
Log Message:
0.8.21.29:
TRACE :ENCAPSULATE NIL was broken by a recent function signature
change in the debugger internals. Fix this, and add support for
:ENCAPSULATE NIL on x86-64.
* Pass stream to PRINT-FRAME-CALL from ntrace.lisp.
* Port over some of Daniel Barlow's fixes to x86-64-assem.S from
amd64-pthreads-branch, fix fun_end_breakpoint_guts.
* Fixed some magic constants in the x86-64 runtime
* Various 64-bit cleanups, #ifdef cleanups in the runtime
Index: breakpoint.c
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/runtime/breakpoint.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- breakpoint.c 20 Feb 2004 18:15:20 -0000 1.15
+++ breakpoint.c 9 Apr 2005 21:28:40 -0000 1.16
@@ -26,7 +26,7 @@
#include "genesis/fdefn.h"
#define REAL_LRA_SLOT 0
-#ifndef LISP_FEATURE_X86
+#if !(defined(LISP_FEATURE_X86) || defined(LISP_FEATURE_X86_64))
#define KNOWN_RETURN_P_SLOT 1
#define BOGUS_LRA_CONSTANTS 2
#else
@@ -71,7 +71,7 @@
arch_do_displaced_inst(context, orig_inst);
}
-#ifndef LISP_FEATURE_X86
+#if !(defined(LISP_FEATURE_X86) || defined(LISP_FEATURE_X86_64))
static lispobj find_code(os_context_t *context)
{
#ifdef reg_CODE
@@ -91,9 +91,7 @@
return NIL;
#endif
}
-#endif
-
-#ifdef LISP_FEATURE_X86
+#else
static lispobj find_code(os_context_t *context)
{
lispobj codeptr =
@@ -107,7 +105,7 @@
}
#endif
-static int compute_offset(os_context_t *context, lispobj code)
+static long compute_offset(os_context_t *context, lispobj code)
{
if (code == NIL)
return 0;
@@ -125,7 +123,7 @@
if (pc < code_start)
return 0;
else {
- int offset = pc - code_start;
+ long offset = pc - code_start;
if (offset >= codeptr->code_size)
return 0;
else
@@ -137,7 +135,7 @@
* tried. The sigprocmask() call would work just as well on alpha as it
* presumably does on x86 -dan 2001.08.10
*/
-#ifndef LISP_FEATURE_X86
+#if !(defined(LISP_FEATURE_X86) || defined(LISP_FEATURE_X86_64))
void handle_breakpoint(int signal, siginfo_t *info, os_context_t *context)
{
lispobj code;
@@ -176,7 +174,7 @@
}
#endif
-#ifndef LISP_FEATURE_X86
+#if !(defined(LISP_FEATURE_X86) || defined(LISP_FEATURE_X86_64))
void *handle_fun_end_breakpoint(int signal, siginfo_t *info,
os_context_t *context)
{
Index: x86-64-arch.c
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/runtime/x86-64-arch.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- x86-64-arch.c 6 Jan 2005 12:48:04 -0000 1.2
+++ x86-64-arch.c 9 Apr 2005 21:28:41 -0000 1.3
@@ -53,7 +53,7 @@
* gregs[], but it's conditional on __USE_GNU and not defined, so
* we need to do this nasty absolute index magic number thing
* instead. */
- return &context->uc_mcontext.gregs[16];
+ return &context->uc_mcontext.gregs[17];
#elif defined __FreeBSD__
return &context->uc_mcontext.mc_eflags;
#elif defined __OpenBSD__
@@ -271,7 +271,7 @@
case trap_FunEndBreakpoint:
(char*)(*os_context_pc_addr(context)) -= 1;
*os_context_pc_addr(context) =
- (int)handle_fun_end_breakpoint(signal, info, context);
+ (unsigned long)handle_fun_end_breakpoint(signal, info, context);
break;
default:
Index: x86-64-assem.S
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/runtime/x86-64-assem.S,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- x86-64-assem.S 19 Jan 2005 21:11:15 -0000 1.3
+++ x86-64-assem.S 9 Apr 2005 21:28:41 -0000 1.4
@@ -203,7 +203,7 @@
* the undefined-function trampoline
*/
.text
- .align align_4byte,0x90
+ .align align_8byte,0x90
.global GNAME(undefined_tramp)
.type GNAME(undefined_tramp),@function
GNAME(undefined_tramp):
@@ -217,9 +217,9 @@
.text
- .align align_4byte,0x90
+ .align align_8byte,0x90
.global GNAME(alloc_tramp)
- .type GNAME(alooc_tramp),@function
+ .type GNAME(alloc_tramp),@function
GNAME(alloc_tramp):
push %rbp # Save old frame pointer.
mov %rsp,%rbp # Establish new frame.
@@ -253,7 +253,7 @@
* the closure trampoline
*/
.text
- .align align_4byte,0x90
+ .align align_8byte,0x90
.global GNAME(closure_tramp)
.type GNAME(closure_tramp),@function
GNAME(closure_tramp):
@@ -272,16 +272,20 @@
*/
.text
.global GNAME(fun_end_breakpoint_guts)
- .align align_4byte
+ .align align_8byte
GNAME(fun_end_breakpoint_guts):
/* Multiple Value return */
jmp multiple_value_return
+ /* the above jmp is only 2 bytes long, we need to add a nop for
+ * padding since the single value return convention jumps to original
+ * return address + 3 bytes */
+ nop
/* Single value return: The eventual return will now use the
multiple values return convention but with a return values
count of one. */
mov %rsp,%rbx # Setup ebx - the ofp.
- sub $4,%rsp # Allocate one stack slot for the return value
- mov $4,%rcx # Setup ecx for one return value.
+ sub $8,%rsp # Allocate one stack slot for the return value
+ mov $8,%rcx # Setup ecx for one return value.
mov $NIL,%rdi # default second value
mov $NIL,%rsi # default third value
@@ -299,7 +303,7 @@
.global GNAME(do_pending_interrupt)
.type GNAME(do_pending_interrupt),@function
- .align align_4byte,0x90
+ .align align_8byte,0x90
GNAME(do_pending_interrupt):
int3
.byte trap_PendingInterrupt
@@ -308,12 +312,11 @@
.globl GNAME(post_signal_tramp)
.type GNAME(post_signal_tramp),@function
- .align align_4byte,0x90
+ .align align_8byte,0x90
GNAME(post_signal_tramp):
/* this is notionally the second half of a function whose first half
* doesn't exist. This is where call_into_lisp returns when called
* using return_to_lisp_function */
- addq $24,%rsp /* clear call_into_lisp args from stack */
popq %r15
popq %r14
popq %r13
@@ -324,7 +327,7 @@
popq %r8
popq %rdi
popq %rsi
- popq %rbp
+ addq $8, %rsp
popq %rsp
popq %rdx
popq %rbx
|