X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fx86%2Fparms.lisp;h=9e31f18f34dca4b21f6121f5966836c30fc9f831;hb=d40a76606c86722b0aef8179155f9f2840739b72;hp=e342bf8d8d7f596afddc88f913f66e7e3e052a60;hpb=35e306eeebc40ce947247e3df47a63f47d01734d;p=sbcl.git diff --git a/src/compiler/x86/parms.lisp b/src/compiler/x86/parms.lisp index e342bf8..9e31f18 100644 --- a/src/compiler/x86/parms.lisp +++ b/src/compiler/x86/parms.lisp @@ -24,21 +24,18 @@ ;;;; machine architecture parameters -(defconstant word-bits 32 - #!+sb-doc - "Number of bits per word where a word holds one lisp descriptor.") +;;; the number of bits per word, where a word holds one lisp descriptor +(defconstant n-word-bits 32) -(defconstant byte-bits 8 - #!+sb-doc - "Number of bits per byte where a byte is the smallest addressable object.") +;;; the number of bits per byte, where a byte is the smallest +;;; addressable object +(defconstant n-byte-bits 8) -(defconstant word-shift (1- (integer-length (/ word-bits byte-bits))) - #!+sb-doc - "Number of bits to shift between word addresses and byte addresses.") +;;; the number of bits to shift between word addresses and byte addresses +(defconstant word-shift (1- (integer-length (/ n-word-bits n-byte-bits)))) -(defconstant word-bytes (/ word-bits byte-bits) - #!+sb-doc - "Number of bytes in a word.") +;;; the number of bytes in a word +(defconstant n-word-bytes (/ n-word-bits n-byte-bits)) (defconstant float-sign-shift 31) @@ -77,10 +74,10 @@ (+ (byte-size single-float-significand-byte) 1)) (defconstant double-float-digits - (+ (byte-size double-float-significand-byte) word-bits 1)) + (+ (byte-size double-float-significand-byte) n-word-bits 1)) (defconstant long-float-digits - (+ (byte-size long-float-significand-byte) word-bits 1)) + (+ (byte-size long-float-significand-byte) n-word-bits 1)) ;;; pfw -- from i486 microprocessor programmer's reference manual (defconstant float-invalid-trap-bit (ash 1 0)) @@ -116,13 +113,25 @@ ;;; * On FreeBSD, ;;; ** The space 0x0E000000-0x10000000 is "Foreign segment". ;;; ** The space 0x20000000-0x30000000 is reserved for shared libs. -;;; And there have been a few changes since the fork: +;;; And there have been some changes since the fork from CMU CL: +;;; * The OpenBSD port is new since the fork. We started with +;;; the FreeBSD address map, which actually worked until the +;;; Alpha port patches, for reasons which in retrospect are rather +;;; mysterious. After the Alpha port patches were added, the +;;; OpenBSD port suffered memory corruption problems. While +;;; debugging those, it was discovered that src/runtime/trymap +;;; failed for the control stack region #x40000000-#x47fff000. +;;; After the control stack was moved upward out of this region +;;; (stealing some bytes from dynamic space) the problems went +;;; away. ;;; * The FreeBSD STATIC-SPACE-START value was bumped up from ;;; #x28000000 to #x30000000 when FreeBSD ld.so dynamic linking ;;; support was added for FreeBSD ca. 20000910. This was to keep from -;;; stomping on an address range that the dynamic libraries want to use. -;;; (They want to use this address range even if we try to reserve it -;;; with a call to validate() as the first operation in main().) +;;; stomping on an address range that the dynamic libraries want to +;;; use. (They want to use this address range even if we try to +;;; reserve it with a call to validate() as the first operation in +;;; main().) + #!+linux (progn @@ -155,10 +164,15 @@ (defconstant binding-stack-start #x38000000) (defconstant binding-stack-end #x3ffff000) - (defconstant control-stack-start #x40000000) - (defconstant control-stack-end #x47fff000) - - (defconstant dynamic-space-start #x48000000) + (defconstant control-stack-start + #+freebsd #x40000000 + #+openbsd #x48000000) + (defconstant control-stack-end + #+freebsd #x47fff000 + #+openbsd #x4ffff000) + (defconstant dynamic-space-start + #+freebsd #x48000000 + #+openbsd #x50000000) (defconstant dynamic-space-end #x88000000)) ;;; Given that NIL is the first thing allocated in static space, we @@ -173,7 +187,7 @@ error cerror breakpoint - function-end-breakpoint + fun-end-breakpoint single-step-breakpoint) ;;; FIXME: It'd be nice to replace all the DEFENUMs with something like ;;; (WITH-DEF-ENUM (:START 8) @@ -207,8 +221,6 @@ ;;; Note these spaces grow from low to high addresses. (defvar *allocation-pointer*) (defvar *binding-stack-pointer*) -(defvar *x86-cgc-active-p*) ; FIXME: Document this. -(defvar *static-blue-bag* nil) ;;; FIXME: *!INITIAL-FDEFN-OBJECTS* and !COLD-INIT probably don't need ;;; to be in the static symbols table any more. Also, if @@ -221,11 +233,10 @@ sb!impl::*!initial-fdefn-objects* ;; functions that the C code needs to call - sb!impl::!cold-init - sb!impl::maybe-gc + maybe-gc sb!kernel::internal-error sb!di::handle-breakpoint - sb!impl::fdefinition-object + fdefinition-object ;; free pointers ;; @@ -238,61 +249,45 @@ *initial-dynamic-space-free-pointer* ;; things needed for non-local exit - sb!impl::*current-catch-block* - sb!impl::*current-unwind-protect-block* - sb!c::*eval-stack-top* - sb!vm::*alien-stack* + *current-catch-block* + *current-unwind-protect-block* + *eval-stack-top* + *alien-stack* ;; interrupt handling - sb!impl::*pseudo-atomic-atomic* - sb!impl::*pseudo-atomic-interrupted* + *pseudo-atomic-atomic* + *pseudo-atomic-interrupted* sb!unix::*interrupts-enabled* sb!unix::*interrupt-pending* - sb!impl::*free-interrupt-context-index* + *free-interrupt-context-index* - sb!vm::*allocation-pointer* - sb!vm::*binding-stack-pointer* - sb!vm::*internal-gc-trigger* ; Not used. + *allocation-pointer* + *binding-stack-pointer* + *internal-gc-trigger* ; Not used. ;; the floating point constants - sb!vm::*fp-constant-0d0* - sb!vm::*fp-constant-1d0* - sb!vm::*fp-constant-0s0* - sb!vm::*fp-constant-1s0* + *fp-constant-0d0* + *fp-constant-1d0* + *fp-constant-0s0* + *fp-constant-1s0* ;; The following are all long-floats. - sb!vm::*fp-constant-0l0* - sb!vm::*fp-constant-1l0* - sb!vm::*fp-constant-pi* - sb!vm::*fp-constant-l2t* - sb!vm::*fp-constant-l2e* - sb!vm::*fp-constant-lg2* - sb!vm::*fp-constant-ln2* - - ;; used by gencgc - sb!vm::*scavenge-read-only-space* + *fp-constant-0l0* + *fp-constant-1l0* + *fp-constant-pi* + *fp-constant-l2t* + *fp-constant-l2e* + *fp-constant-lg2* + *fp-constant-ln2* ;; The ..SLOT-UNBOUND.. symbol is static in order to optimise the ;; common slot unbound check. - sb!pcl::..slot-unbound.. - - ;; spare symbols - sb!vm::spare-10 - sb!vm::spare-9 - sb!vm::spare-8 - sb!vm::spare-7 - sb!vm::spare-6 - sb!vm::spare-5 - sb!vm::spare-4 - sb!vm::spare-3 - sb!vm::spare-2 - sb!vm::spare-1 - - ;; used by cgc - sb!vm::*x86-cgc-active-p* - sb!vm::*static-blue-bag* ; must be last or change C code - )) - -(defparameter *static-functions* + ;; + ;; FIXME: In SBCL, the CLOS code has become sufficiently tightly + ;; integrated into the system that it'd probably make sense to use + ;; the ordinary unbound marker for this. + sb!pcl::..slot-unbound..)) + +(defparameter *static-funs* '(length sb!kernel:two-arg-+ sb!kernel:two-arg--