Update of /cvsroot/sbcl/sbcl/src/compiler/x86-64
In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv22077/src/compiler/x86-64
Modified Files:
insts.lisp macros.lisp parms.lisp
Log Message:
1.0.3.16: experimental x86-64/darwin suport
* fix sb-posix time structs to match headers on darwin
* comment out mtime sb-posix test as this isn't working ATM
* add UD2A trap stuff to x86-64 and corresponding word-imm support
* remove bogus extern-alien-name in boxed_region fixups
* add compiler parameters for Darwin
* add x86-64 darwin config file
* some type safety fixes (proper types) in darwin-dlshim.c
* use setpgid on Darwin
* add signal context support x86-64/darwin
* report trap instead of si_code for trap_Error/trap_Cerror
* unsigned -> unsigned long in purify.c
* add mach exception handler support for x86-64/darwin
* x86-64 assembly hacks to make darwin's assembler happy
* update x86-64-bsd-os.c to suppot darwin and mach exceptions
* add x86-64-darwin-os.c/h
* update LDSO stubs for x86-64 darwin
Index: insts.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/compiler/x86-64/insts.lisp,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- insts.lisp 18 Sep 2006 20:09:14 -0000 1.24
+++ insts.lisp 3 Mar 2007 00:42:02 -0000 1.25
@@ -1052,6 +1052,14 @@
:default-printer '(:name :tab code))
(op :field (byte 8 0))
(code :field (byte 8 8)))
+
+;;; Two byte instruction with an immediate byte argument.
+;;;
+(sb!disassem:define-instruction-format (word-imm 24
+ :default-printer '(:name :tab code))
+ (op :field (byte 16 0))
+ (code :field (byte 8 16)))
+
;;;; primitive emitters
@@ -2695,7 +2703,8 @@
;; Lisp (with (DESCRIBE 'BYTE-IMM-CODE)) than to definitively deduce
;; from first principles whether it's defined in some way that genesis
;; can't grok.
- (case (byte-imm-code chunk dstate)
+ (case #!-darwin (byte-imm-code chunk dstate)
+ #!+darwin (word-imm-code chunk dstate)
(#.error-trap
(nt "error trap")
(sb!disassem:handle-break-args #'snarf-error-junk stream dstate))
@@ -2717,10 +2726,17 @@
(define-instruction break (segment code)
(:declare (type (unsigned-byte 8) code))
- (:printer byte-imm ((op #b11001100)) '(:name :tab code)
- :control #'break-control)
+ #!-darwin (:printer byte-imm ((op #b11001100)) '(:name :tab code)
+ :control #'break-control)
+ #!+darwin (:printer word-imm ((op #b0000101100001111)) '(:name :tab code)
+ :control #'break-control)
(:emitter
- (emit-byte segment #b11001100)
+ #!-darwin (emit-byte segment #b11001100)
+ ;; On darwin, trap handling via SIGTRAP is unreliable, therefore we
+ ;; throw a sigill with 0x0b0f instead and check for this in the
+ ;; SIGILL handler and pass it on to the sigtrap handler if
+ ;; appropriate
+ #!+darwin (emit-word segment #b0000101100001111)
(emit-byte segment code)))
(define-instruction int (segment number)
Index: macros.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/compiler/x86-64/macros.lisp,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- macros.lisp 2 Mar 2007 04:36:03 -0000 1.18
+++ macros.lisp 3 Mar 2007 00:42:02 -0000 1.19
@@ -175,7 +175,7 @@
#!-sb-thread
(make-ea :qword
:scale 1 :disp
- (make-fixup (extern-alien-name "boxed_region") :foreign)))
+ (make-fixup "boxed_region" :foreign)))
;; thread->alloc_region.end_addr
(end-addr
#!+sb-thread
@@ -185,7 +185,7 @@
#!-sb-thread
(make-ea :qword
:scale 1 :disp
- (make-fixup (extern-alien-name "boxed_region") :foreign 8))))
+ (make-fixup "boxed_region" :foreign 8))))
(cond (in-elsewhere
(allocation-tramp alloc-tn size))
(t
@@ -242,7 +242,16 @@
(eval-when (#-sb-xc :compile-toplevel :load-toplevel :execute)
(defun emit-error-break (vop kind code values)
(let ((vector (gensym)))
- `((inst int 3) ; i386 breakpoint instruction
+ `((progn
+ #!-darwin (inst int 3) ; i386 breakpoint instruction
+ ;; On Darwin, we need to use #x0b0f instead of int3 in order
+ ;; to generate a SIGILL instead of a SIGTRAP as darwin/x86
+ ;; doesn't seem to be reliably firing SIGTRAP
+ ;; handlers. Hopefully this will be fixed by Apple at a
+ ;; later date. Do the same on x86-64 as we do on x86 until this gets
+ ;; sorted out.
+ #!+darwin (inst word #x0b0f))
+
;; The return PC points here; note the location for the debugger.
(let ((vop ,vop))
(when vop
Index: parms.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/compiler/x86-64/parms.lisp,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- parms.lisp 15 Jan 2007 22:15:49 -0000 1.21
+++ parms.lisp 3 Mar 2007 00:42:02 -0000 1.22
@@ -97,19 +97,42 @@
;;; would be possible, but probably not worth the time and code bloat
;;; it would cause. -- JES, 2005-12-11
-(def!constant read-only-space-start #x20000000)
-(def!constant read-only-space-end #x27ff0000)
+#!+linux
+(progn
+ (def!constant read-only-space-start #x20000000)
+ (def!constant read-only-space-end #x27ff0000)
-(def!constant static-space-start #x40000000)
-(def!constant static-space-end #x47fff000)
+ (def!constant static-space-start #x40000000)
+ (def!constant static-space-end #x47fff000)
-(def!constant dynamic-space-start #x1000000000)
-(def!constant dynamic-space-end #x11ffff0000)
+ (def!constant dynamic-space-start #x1000000000)
+ (def!constant dynamic-space-end #x11ffff0000)
+
+ (def!constant linkage-table-space-start #x60000000)
+ (def!constant linkage-table-space-end #x63fff000)
+
+ (def!constant linkage-table-entry-size 16))
+
+#!+darwin
+(progn
+ (def!constant read-only-space-start #x20000000)
+ (def!constant read-only-space-end #x27ff0000)
+
+ (def!constant static-space-start #x40000000)
+ (def!constant static-space-end #x47fff000)
+
+ #+nil (def!constant dynamic-space-start #x1000000000)
+ #+nil (def!constant dynamic-space-end #x11ffff0000)
+
+ (def!constant dynamic-space-start #x50000000)
+ (def!constant dynamic-space-end #x5fff0000)
+
+ (def!constant linkage-table-space-start #x60000000)
+ (def!constant linkage-table-space-end #x63fff000)
+
+ (def!constant linkage-table-entry-size 16))
-(def!constant linkage-table-space-start #x60000000)
-(def!constant linkage-table-space-end #x63fff000)
-(def!constant linkage-table-entry-size 16)
;;;; other miscellaneous constants
|