Commit 2bafb654 authored by rtoy's avatar rtoy
Browse files

This large checkin brings the amd64 port up-to-date with the current

sources.  No real attempt has been made to make it work, but the
cross-compile does create a kernel.core, and the C code compiles (on
openSuSE 10.3).  The resulting kernel.core does not yet work.

Use cross-x86-amd64.lisp as the cross-compile script.  This is
intended to be cross-compiled using the 20a release for Linux, and
only supports x87.  The sse2 support has not be ported yet.

tools/cross-scripts/cross-x86-amd64.lisp:
o Update cross-compile with some missing constants, and frob new
  symbols.

tools/clean-target.sh:
o Remove amd64f files too.

code/pred.lisp:
o Define predicates for double-doubles for bootstrapping to work
  around recursive known function problems with these predicates.

code/sap.lisp:
o Define int-sap with (unsigned-byte 64) type declaration.  (May not
  be needed?)

code/unix-glibc2.lisp:
o Build fails defining map_failed to (int-sap -1).  Just hard-wire to
  0 for now so we can build.

compiler/float-tran.lisp:
o Add missing conditional for %complex-double-double-float.

compiler/amd64/float.lisp:
o Merge double-double support for amd64.  Not really tested yet.

compiler/amd64/parms.lisp:
o Update to match x86 build.  In particular, get the space address
  correct and update the static symbols.

compiler/amd64/type-vops.lisp:
o DYLAN-FUNCTION-HEADER-TYPE no longer exists.

compiler/amd64/vm.lisp:
o Add double-double storage classes and register definitions.

lisp/Config.amd64:
o Bring in line with Config.x86 and friends.

lisp/Linux-os.c:
o Bring amd64 code up-to-date with x86/linux code.

lisp/Linux-os.h
o Need to include sys/ucontext.h to get ucontext defined.  (Why?)
o Also define __USE_GNU so we get the register offsets in the ucontext
  defined.  (Why?)

lisp/amd64-arch.c:
o Change struct sigcontext to os_context_t.
o Use SC_PC instead of context->sc_pc.
o Merge some changes in from x86 version, like SC_EFLAGS.  May need
  more work.

lisp/amd64-assem.s:
o Use rbx instead of ebx for jmp.

lisp/amd64-lispregs.h:
o Define SC_REG, SC_PC, SC_SP using the new x86 style.

lisp/backtrace.c:
o Remove inline assembly for now until I figure out what the amd64
  version should be.

lisp/gencgc.c:
o Conditionalize out weak hash table support for now.

lisp/gencgc.h:
o Set PAGE_SIZE for amd64.  (Is 4096 right?)

lisp/globals.h:
o Export current_dynamic_space_free_pointer and
  current_auto_gc_trigger like for x86.
parent f6bd3019
......@@ -5,7 +5,7 @@
;;; Carnegie Mellon University, and has been placed in the public domain.
;;;
(ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/pred.lisp,v 1.60 2006/06/30 18:41:22 rtoy Rel $")
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/pred.lisp,v 1.61 2009/11/02 02:51:57 rtoy Exp $")
;;;
;;; **********************************************************************
;;;
......@@ -127,6 +127,39 @@
primitive-predicates))))
(frob))
;;; FIXME: The next four functions are for bootstrapping double-double
;;; for AMD64. This works around the recursive known function problem
;;; when compiling the predicate functions for double-double. This
;;; should be eventually removed when double-double float support for
;;; the compiler is working.
(defun double-double-float-p (x)
(let* ((addr (kernel:get-lisp-obj-address x))
(ptr (logandc2 addr #x7)))
(when (= 1 (logand addr 1))
(= 26 (ldb (byte 8 0)
(sys:sap-ref-32 (sys:int-sap ptr) 0))))))
(defun complex-double-double-float-p (x)
(let* ((addr (kernel:get-lisp-obj-address x))
(ptr (logandc2 addr #x7)))
(when (= 1 (logand addr 1))
(= 42 (ldb (byte 8 0)
(sys:sap-ref-32 (sys:int-sap ptr) 0))))))
(defun simple-array-double-double-float-p (x)
(let* ((addr (kernel:get-lisp-obj-address x))
(ptr (logandc2 addr #x7)))
(when (= 1 (logand addr 1))
(= 106 (ldb (byte 8 0)
(sys:sap-ref-32 (sys:int-sap ptr) 0))))))
(defun simple-array-complex-double-double-float-p (x)
(let* ((addr (kernel:get-lisp-obj-address x))
(ptr (logandc2 addr #x7)))
(when (= 1 (logand addr 1))
(= 118 (ldb (byte 8 0)
(sys:sap-ref-32 (sys:int-sap ptr) 0))))))
;;;; TYPE-OF -- public.
;;;
......
......@@ -5,7 +5,7 @@
;;; Carnegie Mellon University, and has been placed in the public domain.
;;;
(ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/sap.lisp,v 1.19 2008/01/03 11:41:52 cshapiro Rel $")
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/sap.lisp,v 1.20 2009/11/02 02:51:58 rtoy Exp $")
;;;
;;; **********************************************************************
;;;
......@@ -77,10 +77,16 @@
(declare (type system-area-pointer sap))
(sap-int sap))
#-amd64
(defun int-sap (int)
"Converts an integer into a System Area Pointer."
(declare (type (unsigned-byte #-alpha #.vm:word-bits #+alpha 64) int))
(int-sap int))
#+amd64
(defun int-sap (int)
"Converts an integer into a System Area Pointer."
(declare (type (unsigned-byte 64) int))
(int-sap int))
(defun sap-ref-8 (sap offset)
"Returns the 8-bit byte at OFFSET bytes from SAP."
......
......@@ -5,7 +5,7 @@
;;; Carnegie Mellon University, and has been placed in the public domain.
;;;
(ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/unix-glibc2.lisp,v 1.49 2009/10/15 14:07:35 rtoy Exp $")
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/unix-glibc2.lisp,v 1.50 2009/11/02 02:51:58 rtoy Exp $")
;;;
;;; **********************************************************************
;;;
......@@ -265,7 +265,7 @@
(defconstant ms_invalidate 2)
;; The return value from mmap that means mmap failed.
(defconstant map_failed (int-sap (1- (ash 1 vm:word-bits))))
(defconstant map_failed (int-sap #+amd64 0 #-amd64 (1- (ash 1 vm:word-bits))))
(defun unix-mmap (addr length prot flags fd offset)
(declare (type (or null system-area-pointer) addr)
......
This diff is collapsed.
......@@ -7,7 +7,7 @@
;;; Scott Fahlman or slisp-group@cs.cmu.edu.
;;;
(ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/amd64/parms.lisp,v 1.3 2004/06/18 23:44:42 cwang Rel $")
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/amd64/parms.lisp,v 1.4 2009/11/02 02:51:58 rtoy Exp $")
;;;
;;; **********************************************************************
;;;
......@@ -55,7 +55,8 @@
;;;; Machine Architecture parameters:
(export '(word-bits byte-bits word-shift word-bytes float-sign-shift
(export '(word-bits byte-bits char-bits word-shift word-bytes char-bytes
float-sign-shift
single-float-bias single-float-exponent-byte
single-float-significand-byte single-float-normal-exponent-min
......@@ -76,6 +77,8 @@
float-imprecise-trap-bit float-invalid-trap-bit
float-divide-by-zero-trap-bit))
#+double-double
(export '(double-double-float-digits))
(eval-when (compile load eval)
......@@ -86,6 +89,12 @@
(defconstant byte-bits 8
"Number of bits per byte where a byte is the smallest addressable object.")
(defconstant char-bits #-unicode 8 #+unicode 16
"Number of bits needed to represent a character")
(defconstant char-bytes (truncate char-bits byte-bits)
"Number of bytes needed to represent a character")
(defconstant word-shift (1- (integer-length (/ word-bits byte-bits)))
"Number of bits to shift between word addresses and byte addresses.")
......@@ -134,6 +143,10 @@
(defconstant long-float-digits
(+ (byte-size long-float-significand-byte) 32 1))
#+double-double
(defconstant double-double-float-digits
(* 2 double-float-digits))
;;; pfw -- from i486 microprocessor programmers reference manual
(defconstant float-invalid-trap-bit (ash 1 0))
(defconstant float-denormal-trap-bit (ash 1 1))
......@@ -147,16 +160,26 @@
(defconstant float-round-to-positive 2)
(defconstant float-round-to-zero 3)
(defconstant float-precision-24-bit 0)
(defconstant float-precision-53-bit 2)
(defconstant float-precision-64-bit 3)
;; NOTE: These actually match the SSE2 MXCSR register definitions. We
;; need to do it this way because the interface assumes the modes are
;; in the same order as the MXCSR register.
(defconstant float-rounding-mode (byte 2 13))
(defconstant float-sticky-bits (byte 6 0))
(defconstant float-traps-byte (byte 6 7))
(defconstant float-exceptions-byte (byte 6 0))
(defconstant float-rounding-mode (byte 2 10))
(defconstant float-sticky-bits (byte 6 16))
(defconstant float-traps-byte (byte 6 0))
(defconstant float-exceptions-byte (byte 6 16))
(defconstant float-precision-control (byte 2 8))
#-sse2
(progn
(defconstant float-fast-bit 0) ; No fast mode on x86
)
#+sse2
(progn
;; SSE2 has a flush-to-zero flag, which we use as the fast bit. Some
;; versions of sse2 also have a denormals-are-zeros flag. We don't
;; currently use denormals-are-zeroes for anything.
(defconstant float-fast-bit (ash 1 15))
)
); eval-when
......@@ -171,9 +194,15 @@
;;; Where to put the different spaces.
;;;
(defconstant target-read-only-space-start #x10000000)
(defconstant target-static-space-start #x28000000)
(defconstant target-dynamic-space-start #x48000000)
(defconstant target-foreign-linkage-space-start #xB0000000)
(defconstant target-static-space-start
#+FreeBSD #x28F00000
#-FreeBSD #x28000000)
(defconstant target-dynamic-space-start
#+linux #x58100000
#-linux #x48000000)
(defconstant target-foreign-linkage-space-start
#+linux #x58000000
#-linux #xB0000000)
(defconstant target-foreign-linkage-entry-size 16) ;In bytes. Duh.
;;; Given that NIL is the first thing allocated in static space, we
......@@ -305,6 +334,20 @@
lisp::*cmucl-lib*
lisp::*cmucl-core-path*
;; Weak hash table support
:key
:value
:key-and-value
:key-or-value
;; Used by CGC.
*x86-cgc-active-p*
;; Foreign linkage stuff
lisp::*linkage-table-data*
system::*global-table*
*current-region-free-pointer*
*current-region-end-addr*
;; Spare symbols. Rename these when you need to add some static
;; symbols and don't want to do a cross-compile.
spare-8
......@@ -316,13 +359,6 @@
spare-2
spare-1
;; Used by CGC.
*x86-cgc-active-p*
;; Foreign linkage stuff
lisp::*linkage-table-data*
system::*global-table*
*current-region-free-pointer*
*current-region-end-addr*
*static-blue-bag* ; Must be last or change C code
......
......@@ -7,7 +7,7 @@
;;; Scott Fahlman or slisp-group@cs.cmu.edu.
;;;
(ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/amd64/type-vops.lisp,v 1.1 2004/05/24 22:35:00 cwang Rel $")
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/amd64/type-vops.lisp,v 1.2 2009/11/02 02:51:58 rtoy Exp $")
;;;
;;; **********************************************************************
;;;
......@@ -32,7 +32,7 @@
(defparameter function-header-types
(list funcallable-instance-header-type dylan-function-header-type
(list funcallable-instance-header-type
byte-code-function-type byte-code-closure-type
function-header-type closure-function-header-type
closure-header-type))
......
......@@ -7,7 +7,7 @@
;;; Scott Fahlman or slisp-group@cs.cmu.edu.
;;;
(ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/amd64/vm.lisp,v 1.2 2004/07/06 20:23:30 cwang Rel $")
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/amd64/vm.lisp,v 1.3 2009/11/02 02:51:58 rtoy Exp $")
;;;
;;; **********************************************************************
;;;
......@@ -215,13 +215,17 @@
(sap-stack stack) ; System area pointers.
(single-stack stack) ; single-floats
(double-stack stack :element-size 2) ; double-floats.
#+double-double
(double-double-stack stack :element-size 4) ; double-double-float
#+long-float
(long-stack stack :element-size 3) ; long-floats.
(complex-single-stack stack :element-size 2) ; complex-single-floats
(complex-double-stack stack :element-size 4) ; complex-double-floats
#+long-float
(complex-long-stack stack :element-size 6) ; complex-long-floats
#+double-double
(complex-double-double-stack stack :element-size 8) ; complex-double-double-floats
;; **** Magic SCs.
(ignore-me noise)
......@@ -318,6 +322,14 @@
:save-p t
:alternate-scs (long-stack))
#+double-double
(double-double-reg float-registers
:locations (0 2 4 6)
:element-size 2
:constant-scs ()
:save-p t
:alternate-scs (double-double-stack))
(complex-single-reg float-registers
:locations (0 2 4 6)
:element-size 2
......@@ -339,6 +351,13 @@
:constant-scs ()
:save-p t
:alternate-scs (complex-long-stack))
#+double-double
(complex-double-double-reg float-registers
:locations (0 4)
:element-size 4
:constant-scs ()
:save-p t
:alternate-scs (complex-double-double-stack))
;; A catch or unwind block.
(catch-block stack :element-size vm:catch-block-size)
......
......@@ -5,7 +5,7 @@
;;; Carnegie Mellon University, and has been placed in the public domain.
;;;
(ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/float-tran.lisp,v 1.133 2009/08/11 18:32:55 rtoy Rel $")
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/float-tran.lisp,v 1.134 2009/11/02 02:51:58 rtoy Exp $")
;;;
;;; **********************************************************************
;;;
......@@ -82,6 +82,8 @@
(movable foldable flushable))
(defknown %complex-double-float (number) (complex double-float)
(movable foldable flushable))
#+double-double
(defknown %complex-double-double-float (number) (complex double-double-float)
(movable foldable flushable))
......
......@@ -2,17 +2,52 @@ PATH1 = ../../src/lisp
vpath %.h $(PATH1)
vpath %.c $(PATH1)
vpath %.S $(PATH1)
CPPFLAGS = -I. -I$(PATH1) -I-
# Enable support for :linkage-table feature.
ifdef FEATURE_LINKAGE_TABLE
CPP_DEFINE_OPTIONS += -DLINKAGE_TABLE
endif
# Enable support for generational GC
ifdef FEATURE_GENCGC
CPP_DEFINE_OPTIONS += -DGENCGC
GC_SRC := gencgc.c
else
GC_SRC := cgc.c
CPP_DEFINE_OPTIONS += -DWANT_CGC
endif
ifeq ($(filter 2% 3%, $(shell $(CC) -dumpversion)),)
CPP_INCLUDE_OPTIONS := -iquote . -iquote $(PATH1)
else
CPP_INCLUDE_OPTIONS := -I. -I$(PATH1) -I-
endif
CPPFLAGS := $(CPP_DEFINE_OPTIONS) $(CPP_INCLUDE_OPTIONS)
CFLAGS += -Wstrict-prototypes -Wall -g
ASFLAGS = -g
CC = gcc
LD = ld
CPP = cpp
CFLAGS = -m64 -rdynamic -Wstrict-prototypes -Wall -g -DGENCGC -DLINKAGE_TABLE
ASFLAGS = -g -DGENCGC -DLINKAGE_TABLE
CFLAGS += -m64 -Wstrict-prototypes -Wall -g
ASFLAGS = -g
NM = $(PATH1)/linux-nm
UNDEFSYMPATTERN = -Xlinker -u -Xlinker &
ASSEM_SRC = amd64-assem.S linux-stubs.S
ARCH_SRC = amd64-arch.c
OS_SRC = Linux-os.c os-common.c elf.c
OS_SRC = Linux-os.c os-common.c elf.c e_rem_pio2.c k_rem_pio2.c
OS_LINK_FLAGS = -rdynamic -Xlinker --export-dynamic -Xlinker -Map -Xlinker foo
OS_LIBS = -ldl
GC_SRC = gencgc.c
DEPEND = $(CC) -MM -E
DEPEND_FLAGS =
# This no longer has aliasing problems, so no need to use
# -ffloat-store and -fno-strict-aliasing anymore.
e_rem_pio2.o : e_rem_pio2.c
$(CC) -c $(CFLAGS) $(CPPFLAGS) $<
......@@ -15,7 +15,7 @@
* GENCGC support by Douglas Crosher, 1996, 1997.
* Alpha support by Julian Dolby, 1999.
*
* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/Linux-os.c,v 1.44 2009/10/15 15:05:51 rtoy Exp $
* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/Linux-os.c,v 1.45 2009/11/02 02:51:58 rtoy Exp $
*
*/
......@@ -153,45 +153,52 @@ os_sigcontext_fpu_modes(ucontext_t *scp)
#endif
#ifdef __x86_64
int *
sc_reg(ucontext_t *c, int offset)
unsigned long *
os_sigcontext_reg(ucontext_t *c, int offset)
{
switch (offset) {
case 0:
return &c->uc_mcontext.gregs[REG_RAX];
return (unsigned long *)&c->uc_mcontext.gregs[REG_RAX];
case 2:
return &c->uc_mcontext.gregs[REG_RCX];
return (unsigned long *)&c->uc_mcontext.gregs[REG_RCX];
case 4:
return &c->uc_mcontext.gregs[REG_RDX];
return (unsigned long *)&c->uc_mcontext.gregs[REG_RDX];
case 6:
return &c->uc_mcontext.gregs[REG_RBX];
return (unsigned long *)&c->uc_mcontext.gregs[REG_RBX];
case 8:
return &c->uc_mcontext.gregs[REG_RSP];
return (unsigned long *)&c->uc_mcontext.gregs[REG_RSP];
case 10:
return &c->uc_mcontext.gregs[REG_RBP];
return (unsigned long *)&c->uc_mcontext.gregs[REG_RBP];
case 12:
return &c->uc_mcontext.gregs[REG_RSI];
return (unsigned long *)&c->uc_mcontext.gregs[REG_RSI];
case 14:
return &c->uc_mcontext.gregs[REG_RDI];
return (unsigned long *)&c->uc_mcontext.gregs[REG_RDI];
case 16:
return &c->uc_mcontext.gregs[REG_R8];
return (unsigned long *)&c->uc_mcontext.gregs[REG_R8];
case 18:
return &c->uc_mcontext.gregs[REG_R9];
return (unsigned long *)&c->uc_mcontext.gregs[REG_R9];
case 20:
return &c->uc_mcontext.gregs[REG_R10];
return (unsigned long *)&c->uc_mcontext.gregs[REG_R10];
case 22:
return &c->uc_mcontext.gregs[REG_R11];
return (unsigned long *)&c->uc_mcontext.gregs[REG_R11];
case 24:
return &c->uc_mcontext.gregs[REG_R12];
return (unsigned long *)&c->uc_mcontext.gregs[REG_R12];
case 26:
return &c->uc_mcontext.gregs[REG_R13];
return (unsigned long *)&c->uc_mcontext.gregs[REG_R13];
case 28:
return &c->uc_mcontext.gregs[REG_R14];
return (unsigned long *)&c->uc_mcontext.gregs[REG_R14];
case 30:
return &c->uc_mcontext.gregs[REG_R15];
return (unsigned long *)&c->uc_mcontext.gregs[REG_R15];
}
return (int *) 0;
return (unsigned long *) 0;
}
unsigned long *
os_sigcontext_pc(ucontext_t *scp)
{
return (unsigned long *) &scp->uc_mcontext.gregs[REG_RIP];
}
#endif
os_vm_address_t
......@@ -298,7 +305,12 @@ sigsegv_handler_tramp(void)
void
sigsegv_handler(HANDLER_ARGS)
{
int fault_addr = context->uc_mcontext.cr2;
long fault_addr =
#ifdef i386
context->uc_mcontext.cr2;
#else
context->uc_mcontext.gregs[REG_CR2];
#endif
#ifdef RED_ZONE_HIT
if (os_control_stack_overflow((void *) fault_addr, context))
......@@ -422,6 +434,7 @@ os_dlsym(const char *sym_name, lispobj lib_list)
}
}
#ifdef i386
void
restore_fpu(ucontext_t *context)
{
......@@ -444,3 +457,27 @@ restore_fpu(ucontext_t *context)
#endif
}
}
#else
void
restore_fpu(ucontext_t *context)
{
if (context->uc_mcontext.fpregs) {
short cw = context->uc_mcontext.fpregs->cwd;
DPRINTF(0, (stderr, "restore_fpu: cw = %08x\n", cw));
__asm__ __volatile__ ("fldcw %0" : : "m" (*&cw));
#ifdef FEATURE_SSE2
if (fpu_mode == SSE2) {
struct _fpstate *fpstate;
unsigned int mxcsr;
fpstate = (struct _fpstate*) context->uc_mcontext.fpregs;
if (fpstate->magic != 0xffff) {
mxcsr = fpstate->mxcsr;
DPRINTF(0, (stderr, "restore_fpu: mxcsr (raw) = %04x\n", mxcsr));
__asm__ __volatile__ ("ldmxcsr %0" :: "m" (*&mxcsr));
}
}
#endif
}
}
#endif
/* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/Linux-os.h,v 1.28 2008/01/03 11:41:54 cshapiro Rel $
/* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/Linux-os.h,v 1.29 2009/11/02 02:51:58 rtoy Exp $
This code was written as part of the CMU Common Lisp project at
Carnegie Mellon University, and has been placed in the public domain.
......@@ -26,6 +26,9 @@
#include <asm/unistd.h>
#include <errno.h>
#define __USE_GNU
#include <sys/ucontext.h>
typedef caddr_t os_vm_address_t; /* like hpux */
typedef size_t os_vm_size_t; /* like hpux */
typedef off_t os_vm_offset_t; /* like hpux */
......
/* x86-arch.c -*- Mode: C; comment-column: 40 -*-
*
* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/amd64-arch.c,v 1.9 2008/12/07 02:33:55 agoncharov Rel $
* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/amd64-arch.c,v 1.10 2009/11/02 02:51:58 rtoy Exp $
*
*/
......@@ -12,6 +12,7 @@
#include "os.h"
#include "internals.h"
#include "arch.h"
#define __USE_GNU
#include "lispregs.h"
#include "signal.h"
#include "alloc.h"
......@@ -39,22 +40,22 @@ arch_init(fpu_mode_t mode)
*/
void
arch_skip_instruction(struct sigcontext *context)
arch_skip_instruction(os_context_t *context)
{
int vlen, code;
DPRINTF(0, (stderr, "[arch_skip_inst at %x>]\n", context->sc_pc));
DPRINTF(0, (stderr, "[arch_skip_inst at %x>]\n", SC_PC(context)));
/* Get and skip the lisp error code. */
code = *(char *) context->sc_pc++;
code = *(char *) SC_PC(context)++;
switch (code) {
case trap_Error:
case trap_Cerror:
/* Lisp error arg vector length */
vlen = *(char *) context->sc_pc++;
vlen = *(char *) SC_PC(context)++;
/* Skip lisp error arg data bytes */
while (vlen-- > 0)
((char *) context->sc_pc)++;
SC_PC(context)++;
break;
case trap_Breakpoint:
......@@ -71,23 +72,23 @@ arch_skip_instruction(struct sigcontext *context)
break;
}
DPRINTF(0, (stderr, "[arch_skip_inst resuming at %x>]\n", context->sc_pc));
DPRINTF(0, (stderr, "[arch_skip_inst resuming at %x>]\n", SC_PC(context)));
}
unsigned char *
arch_internal_error_arguments(struct sigcontext *context)
arch_internal_error_arguments(os_context_t *context)
{
return (unsigned char *) (context->sc_pc + 1);
return (unsigned char *) (SC_PC(context) + 1);
}
boolean
arch_pseudo_atomic_atomic(struct sigcontext *context)
arch_pseudo_atomic_atomic(os_context_t *context)
{
return SymbolValue(PSEUDO_ATOMIC_ATOMIC);
}
void
arch_set_pseudo_atomic_interrupted(struct sigcontext *context)
arch_set_pseudo_atomic_interrupted(os_context_t *context)
{
SetSymbolValue(PSEUDO_ATOMIC_INTERRUPTED, make_fixnum(1));
}
......@@ -128,9 +129,9 @@ unsigned int single_step_save3;
#endif
void
arch_do_displaced_inst(struct sigcontext *context, unsigned long orig_inst)
arch_do_displaced_inst(os_context_t *context, unsigned long orig_inst)
{
unsigned int *pc = (unsigned int *) context->sc_pc;
unsigned int *pc = (unsigned int *) SC_PC(context);
/*
* Put the original instruction back.
......@@ -139,8 +140,8 @@ arch_do_displaced_inst(struct sigcontext *context, unsigned long orig_inst)
*((char *) pc) = orig_inst & 0xff;
*((char *) pc + 1) = (orig_inst & 0xff00) >> 8;
#ifdef __linux__
context->eflags |= 0x100;
#ifdef SC_EFLAGS
SC_EFLAGS(context) |= 0x100;
#else
/*
......@@ -159,7 +160,7 @@ arch_do_displaced_inst(struct sigcontext *context, unsigned long orig_inst)
single_stepping = (unsigned int *) pc;