bbd4eaea5ddc10d85aca886af7b810e21344f2e9
[sbcl.git] / src / compiler / generic / parms.lisp
1 ;;;; This file contains some parameterizations of various VM
2 ;;;; attributes common to all architectures.
3
4 ;;;; This software is part of the SBCL system. See the README file for
5 ;;;; more information.
6 ;;;;
7 ;;;; This software is derived from the CMU CL system, which was
8 ;;;; written at Carnegie Mellon University and released into the
9 ;;;; public domain. The software is in the public domain and is
10 ;;;; provided with absolutely no warranty. See the COPYING and CREDITS
11 ;;;; files for more information.
12
13 (in-package "SB!VM")
14
15 (def!macro !configure-dynamic-space-end (default)
16   (with-open-file (f "output/dynamic-space-size.txt")
17     (let ((line (read-line f)))
18       (multiple-value-bind (number end)
19           (parse-integer line :junk-allowed t)
20         (if number
21             (let* ((ext (subseq line end))
22                    (mult (cond ((or (zerop (length ext))
23                                     (member ext '("MB MIB") :test #'equalp))
24                                 (expt 2 20))
25                                ((member ext '("GB" "GIB") :test #'equalp)
26                                 (expt 2 30))
27                                (t
28                                 (error "Invalid --dynamic-space-size=~A" line)))))
29               `(+ dynamic-space-start ,(* number mult)))
30             default)))))
31
32 (defparameter *c-callable-static-symbols*
33   '(sub-gc
34     sb!kernel::post-gc
35     sb!kernel::internal-error
36     sb!kernel::control-stack-exhausted-error
37     sb!kernel::binding-stack-exhausted-error
38     sb!kernel::alien-stack-exhausted-error
39     sb!kernel::heap-exhausted-error
40     sb!kernel::undefined-alien-variable-error
41     sb!kernel::undefined-alien-function-error
42     sb!kernel::memory-fault-error
43     sb!kernel::unhandled-trap-error
44     sb!di::handle-breakpoint
45     sb!di::handle-single-step-trap
46     fdefinition-object
47     #!+win32 sb!kernel::handle-win32-exception))
48
49 (defparameter *common-static-symbols*
50   '(t
51
52     ;; filled in by the C code to propagate to Lisp
53     *posix-argv* *core-string*
54
55     ;; free pointers.  Note that these are FIXNUM word counts, not (as
56     ;; one might expect) byte counts or SAPs. The reason seems to be
57     ;; that by representing them this way, we can avoid consing
58     ;; bignums.  -- WHN 2000-10-02
59     *read-only-space-free-pointer*
60     *static-space-free-pointer*
61
62     ;; things needed for non-local-exit
63     *current-catch-block*
64     *current-unwind-protect-block*
65
66     #!+hpux *c-lra*
67
68     ;; stack pointers
69     *binding-stack-start*
70     *control-stack-start*
71     *control-stack-end*
72
73     ;; interrupt handling
74     *alloc-signal*
75     *free-interrupt-context-index*
76     sb!unix::*allow-with-interrupts*
77     sb!unix::*interrupts-enabled*
78     sb!unix::*interrupt-pending*
79     *in-without-gcing*
80     *gc-inhibit*
81     *gc-pending*
82     #!-sb-thread
83     *stepping*
84
85     ;; threading support
86     #!+sb-thread *stop-for-gc-pending*
87     #!+sb-thread *free-tls-index*
88     #!+sb-thread *tls-index-lock*
89
90     ;; Dispatch tables for generic array access
91     sb!impl::%%data-vector-reffers%%
92     sb!impl::%%data-vector-reffers/check-bounds%%
93     sb!impl::%%data-vector-setters%%
94     sb!impl::%%data-vector-setters/check-bounds%%
95
96     ;; non-x86oid gencgc object pinning
97     #!+(and gencgc (not (or x86 x86-64)))
98     *pinned-objects*
99
100     ;; hash table weaknesses
101     :key
102     :value
103     :key-and-value
104     :key-or-value))
105
106 ;;; Number of entries in the thread local storage. Limits the number
107 ;;; of symbols with thread local bindings.
108 (def!constant tls-size 4096)
109
110 #!+gencgc
111 (progn
112   (def!constant +highest-normal-generation+ 5)
113   (def!constant +pseudo-static-generation+ 6))
114
115 (defenum ()
116   trace-table-normal
117   trace-table-call-site
118   trace-table-fun-prologue
119   trace-table-fun-epilogue)