1 ;;;; This file contains some parameterizations of various VM
2 ;;;; attributes for the PPC. This file is separate from other stuff so
3 ;;;; that it can be compiled and loaded earlier.
5 ;;;; This software is part of the SBCL system. See the README file for
8 ;;;; This software is derived from the CMU CL system, which was
9 ;;;; written at Carnegie Mellon University and released into the
10 ;;;; public domain. The software is in the public domain and is
11 ;;;; provided with absolutely no warranty. See the COPYING and CREDITS
12 ;;;; files for more information.
16 ;;; number of bits per word where a word holds one lisp descriptor
17 (defconstant n-word-bits
32)
19 ;;; the natural width of a machine word (as seen in e.g. register width,
21 (defconstant n-machine-word-bits
32)
23 ;;; flags for the generational garbage collector
24 (defconstant pseudo-atomic-interrupted-flag
1)
25 (defconstant pseudo-atomic-flag
4)
27 (defconstant float-sign-shift
31)
29 (defconstant single-float-bias
126)
30 (defconstant-eqx single-float-exponent-byte
(byte 8 23) #'equalp
)
31 (defconstant-eqx single-float-significand-byte
(byte 23 0) #'equalp
)
32 (defconstant single-float-normal-exponent-min
1)
33 (defconstant single-float-normal-exponent-max
254)
34 (defconstant single-float-hidden-bit
(ash 1 23))
35 (defconstant single-float-trapping-nan-bit
(ash 1 22))
37 (defconstant double-float-bias
1022)
38 (defconstant-eqx double-float-exponent-byte
(byte 11 20) #'equalp
)
39 (defconstant-eqx double-float-significand-byte
(byte 20 0) #'equalp
)
40 (defconstant double-float-normal-exponent-min
1)
41 (defconstant double-float-normal-exponent-max
#x7FE
)
42 (defconstant double-float-hidden-bit
(ash 1 20))
43 (defconstant double-float-trapping-nan-bit
(ash 1 19))
45 (defconstant single-float-digits
46 (+ (byte-size single-float-significand-byte
) 1))
48 (defconstant double-float-digits
49 (+ (byte-size double-float-significand-byte
) n-word-bits
1))
52 (defconstant float-inexact-trap-bit
(ash 1 0))
53 (defconstant float-divide-by-zero-trap-bit
(ash 1 1))
54 (defconstant float-underflow-trap-bit
(ash 1 2))
55 (defconstant float-overflow-trap-bit
(ash 1 3))
56 (defconstant float-invalid-trap-bit
(ash 1 4))
58 (defconstant float-round-to-nearest
0)
59 (defconstant float-round-to-zero
1)
60 (defconstant float-round-to-positive
2)
61 (defconstant float-round-to-negative
3)
63 (defconstant-eqx float-rounding-mode
(byte 2 0) #'equalp
) ; RD
64 ;;; FIXME I: Beware, all ye who trespass here. Despite its name,
65 ;;; FLOAT-STICKY-BITS is not the byte specifier for sticky bits in the
66 ;;; floating point control word. It is more like "accrued exceptions"
67 ;;; where FLOAT-EXCEPTIONS-BYTE is "current exceptions". Consequently,
68 ;;; on architectures where there is no "current exceptions"
69 ;;; FLOAT-EXCEPTIONS-BYTE and FLOAT-STICKY-BITS had better be the
72 ;;; FIXME II: So, I've now documented this in comments in the PowerPC
73 ;;; tree. This may not make it easy to find for when new architectures
74 ;;; get backends written...
77 (defconstant-eqx float-sticky-bits
(byte 5 25) #'equalp
)
78 (defconstant-eqx float-traps-byte
(byte 5 3) #'equalp
)
79 (defconstant-eqx float-exceptions-byte
(byte 5 25) #'equalp
) ; cexc
81 (defconstant float-fast-bit
2) ; Non-IEEE mode
84 ;;;; Where to put the different spaces.
86 ;;; On non-gencgc we need large dynamic and static spaces for PURIFY
89 (defconstant read-only-space-start
#x04000000
)
90 (defconstant read-only-space-end
#x07ff8000
)
91 (defconstant static-space-start
#x08000000
)
92 (defconstant static-space-end
#x097fff00
)
94 (defconstant linkage-table-space-start
#x0a000000
)
95 (defconstant linkage-table-space-end
#x0b000000
))
97 ;;; While on gencgc we don't.
99 (!gencgc-space-setup
#x04000000
103 #!+openbsd
#x4f000000
104 #!+darwin
#x10000000
)
106 (defconstant linkage-table-entry-size
16)
112 (defconstant dynamic-0-space-start
#x4f000000
)
113 (defconstant dynamic-0-space-end
#x66fff000
)
114 (defconstant dynamic-1-space-start
#x67000000
)
115 (defconstant dynamic-1-space-end
#x7efff000
)))
121 (defconstant dynamic-0-space-start
#x4f000000
)
122 (defconstant dynamic-0-space-end
#x66fff000
)
123 (defconstant dynamic-1-space-start
#x67000000
)
124 (defconstant dynamic-1-space-end
#x7efff000
)))
126 ;;; Text and data segments start at #x01800000. Range for randomized
127 ;;; malloc() starts #x20000000 (MAXDSIZ) after end of data seg and
128 ;;; extends 256 MB. Use 512 - 64 MB for dynamic space so we can run
129 ;;; under default resource limits.
130 ;;; FIXME: MAXDSIZ is a kernel parameter, and can vary as high as 1GB.
131 ;;; These parameters should probably be tested under such a configuration,
132 ;;; as rare as it might or might not be.
137 (defconstant dynamic-0-space-start
#x4f000000
)
138 (defconstant dynamic-0-space-end
#x5cfff000
)
139 (defconstant dynamic-1-space-start
#x5f000000
)
140 (defconstant dynamic-1-space-end
#x6cfff000
)))
146 (defconstant dynamic-0-space-start
#x10000000
)
147 (defconstant dynamic-0-space-end
#x3ffff000
)
149 (defconstant dynamic-1-space-start
#x40000000
)
150 (defconstant dynamic-1-space-end
#x6ffff000
)))
152 ;;;; Other miscellaneous constants.
156 pending-interrupt-trap
160 fun-end-breakpoint-trap
161 after-breakpoint-trap
162 single-step-around-trap
163 single-step-before-trap
)
168 ;;; These symbols are loaded into static space directly after NIL so
169 ;;; that the system can compute their address by adding a constant
172 ;;; The fdefn objects for the static functions are loaded into static
173 ;;; space directly after the static symbols. That way, the raw-addr
174 ;;; can be loaded directly out of them by indirecting relative to NIL.
176 (defparameter *static-symbols
*
178 *common-static-symbols
*
179 *c-callable-static-symbols
*
181 #!+gencgc
*restart-lisp-function
*
183 ;; CLH: 20060210 Taken from x86-64/parms.lisp per JES' suggestion
184 ;; Needed for callbacks to work across saving cores. see
185 ;; ALIEN-CALLBACK-ASSEMBLER-WRAPPER in c-call.lisp for gory
187 sb
!alien
::*enter-alien-callback
*)))
189 (defparameter *static-funs
*