1 | /* |
---|
2 | Copyright (C) 1994-2001 Digitool, Inc |
---|
3 | This file is part of OpenMCL. |
---|
4 | |
---|
5 | OpenMCL is licensed under the terms of the Lisp Lesser GNU Public |
---|
6 | License , known as the LLGPL and distributed with OpenMCL as the |
---|
7 | file "LICENSE". The LLGPL consists of a preamble and the LGPL, |
---|
8 | which is distributed with OpenMCL as the file "LGPL". Where these |
---|
9 | conflict, the preamble takes precedence. |
---|
10 | |
---|
11 | OpenMCL is referenced in the preamble as the "LIBRARY." |
---|
12 | |
---|
13 | The LLGPL is also available online at |
---|
14 | http://opensource.franz.com/preamble.html |
---|
15 | */ |
---|
16 | |
---|
17 | #ifndef __lisp_globals__ |
---|
18 | #define __lisp_globals__ |
---|
19 | |
---|
20 | |
---|
21 | extern LispObj lisp_nil; |
---|
22 | |
---|
23 | #define GET_TCR (-1) /* address of get_tcr() for callbacks */ |
---|
24 | #define TCR_COUNT (-2) /* next tcr's tcr_id */ |
---|
25 | #define INTERRUPT_SIGNAL (-3) /* signal to use for PROCESS-INTERRUPT */ |
---|
26 | #define KERNEL_IMPORTS (-4) /* some things we need to have imported for us. */ |
---|
27 | #define OBJC_2_PERSONALITY (-5) /* A good listener. Doesn't say much */ |
---|
28 | #define SAVETOC (-6) /* Saved TOC register, for some platforms */ |
---|
29 | #define SAVER13 (-7) /* Saved (global) r13, on some platforms */ |
---|
30 | #define SUBPRIMS_BASE (-8) /* where the dynamic subprims wound up */ |
---|
31 | #define RET1VALN (-9) /* magic multiple-values return address */ |
---|
32 | #define TCR_KEY (-10) /* tsd key for per-thread tcr */ |
---|
33 | #define TCR_AREA_LOCK (-11) /* all_areas/tcr queue lock */ |
---|
34 | #define EXCEPTION_LOCK (-12) /* serialize exception handling */ |
---|
35 | #define STATIC_CONSES (-13) |
---|
36 | #define DEFAULT_ALLOCATION_QUANTUM (-14) |
---|
37 | #define INTFLAG (-15) |
---|
38 | #define GC_INHIBIT_COUNT (-16) |
---|
39 | #define REFBITS (-17) |
---|
40 | #define OLDSPACE_DNODE_COUNT (-18) /* count of dynamic dnodes older than generation 0 */ |
---|
41 | #define ALTIVEC_PRESENT (-19) /* non-zero if AltiVec present. */ |
---|
42 | #define FWDNUM (-20) /* fixnum: GC "forwarder" call count. */ |
---|
43 | #define GC_NUM (-21) /* fixnum: GC call count. */ |
---|
44 | #define GCABLE_POINTERS (-22) /* linked-list of weak macptrs. */ |
---|
45 | #define HEAP_START (-23) /* start of lisp heap */ |
---|
46 | #define HEAP_END (-24) /* end of lisp heap */ |
---|
47 | #define STATICALLY_LINKED (-25) /* non-zero if -static */ |
---|
48 | #define STACK_SIZE (-26) /* from the command line */ |
---|
49 | #define OBJC_2_BEGIN_CATCH (-27) /* address of ObjC 2.0 objc_begin_catch() */ |
---|
50 | #define BAD_FUNCALL (-28) /* funcall pseudo-target on x86 */ |
---|
51 | #define ALL_AREAS (-29) /* doubly-linked list of stack & heap areas */ |
---|
52 | #define LEXPR_RETURN (-30) /* magic &lexpr cleanup code */ |
---|
53 | #define LEXPR_RETURN1V (-31) /* single-value &lexpr cleanup code */ |
---|
54 | #define IN_GC (-32) /* non-zero when lisp addresses may be invalid */ |
---|
55 | #define METERING_INFO (-33) /* address of lisp_metering global */ |
---|
56 | #define OBJC_2_END_CACTCH (-34) /* address of ObjC 2.0 objc_end_catch() */ |
---|
57 | #define SHORT_FLOAT_ZERO (-35) /* low half of 1.0d0 */ |
---|
58 | #define DOUBLE_FLOAT_ONE (-36) /* high half of 1.0d0 */ |
---|
59 | #define LISP_RETURN_HOOK (-37) /* install lisp exception handling */ |
---|
60 | #define LISP_EXIT_HOOK (-38) /* install foreign exception handling */ |
---|
61 | #define OLDEST_EPHEMERAL (-39) /* doubleword address of oldest ephemeral object or 0 */ |
---|
62 | #define TENURED_AREA (-40) /* the tenured area */ |
---|
63 | #define ERRNO (-41) /* address of errno */ |
---|
64 | #define ARGV (-42) /* pointer to &argv[0] */ |
---|
65 | #define HOST_PLATFORM (-43) /* for platform-specific initialization */ |
---|
66 | #define BATCH_FLAG (-44) /* -b arg */ |
---|
67 | #define UNWIND_RESUME (-45) /* address of _Unwind_Resume from libobjc */ |
---|
68 | #define WEAK_GC_METHOD (-46) /* weak GC algorithm */ |
---|
69 | #define IMAGE_NAME (-47) /* --image-name arg */ |
---|
70 | #define INITIAL_TCR (-48) /* initial thread tcr */ |
---|
71 | |
---|
72 | #define MIN_KERNEL_GLOBAL INITIAL_TCR |
---|
73 | |
---|
74 | /* These are only non-zero when an image is being saved or loaded */ |
---|
75 | |
---|
76 | #if (WOED_SIZE==64) |
---|
77 | #define LISP_HEAP_THRESHOLD (-511) |
---|
78 | #define EGC_ENABLED (-510) |
---|
79 | #define G0_THRESHOLD (-509) |
---|
80 | #define G1_THRESHOLD (-508) |
---|
81 | #define G2_THRESHOLD (-507) |
---|
82 | #else |
---|
83 | #define LISP_HEAP_THRESHOLD (-1023) |
---|
84 | #define EGC_ENABLED (-1022) |
---|
85 | #define G0_THRESHOLD (-1021) |
---|
86 | #define G1_THRESHOLD (-1020) |
---|
87 | #define G2_THRESHOLD (-1019) |
---|
88 | #endif |
---|
89 | |
---|
90 | #ifdef PPC |
---|
91 | #ifdef PPC64 |
---|
92 | #define lisp_global(g) (((LispObj *) (0x3000+(LOWMEM_BIAS)))[(g)]) |
---|
93 | #define nrs_symbol(s) (((lispsymbol *) (0x3000+(LOWMEM_BIAS)))[(s)]) |
---|
94 | #else |
---|
95 | #define lisp_global(g) (((LispObj *) (nil_value-fulltag_nil))[(g)]) |
---|
96 | #define nrs_symbol(s) (((lispsymbol *) (nil_value+(8-fulltag_nil)+8))[(s)]) |
---|
97 | #endif |
---|
98 | #endif |
---|
99 | |
---|
100 | #ifdef X8664 |
---|
101 | #define lisp_global(g) (((LispObj *) (0x13000+(LOWMEM_BIAS)))[(g)]) |
---|
102 | #define nrs_symbol(s) (((lispsymbol *) (0x13020+(LOWMEM_BIAS)))[(s)]) |
---|
103 | #endif |
---|
104 | |
---|
105 | #ifdef X8632 |
---|
106 | #define lisp_global(g) (((LispObj *) (0x13000+(LOWMEM_BIAS)))[(g)]) |
---|
107 | #define nrs_symbol(s) (((lispsymbol *) (0x13008+(LOWMEM_BIAS)))[(s)]) |
---|
108 | #endif |
---|
109 | |
---|
110 | #define nrs_T (nrs_symbol(0)) /* t */ |
---|
111 | #define nrs_NILSYM (nrs_symbol(1)) /* nil */ |
---|
112 | #define nrs_ERRDISP (nrs_symbol(2)) /* %err-disp */ |
---|
113 | #define nrs_CMAIN (nrs_symbol(3)) /* cmain */ |
---|
114 | #define nrs_EVAL (nrs_symbol(4)) /* eval */ |
---|
115 | #define nrs_APPEVALFN (nrs_symbol(5)) /* apply-evaluated-function */ |
---|
116 | #define nrs_ERROR (nrs_symbol(6)) /* error */ |
---|
117 | #define nrs_DEFUN (nrs_symbol(7)) /* %defun */ |
---|
118 | #define nrs_DEFVAR (nrs_symbol(8)) /* %defvar */ |
---|
119 | #define nrs_DEFCONSTANT (nrs_symbol(9)) /* %defconstant */ |
---|
120 | #define nrs_MACRO (nrs_symbol(10)) /* %macro */ |
---|
121 | #define nrs_KERNELRESTART (nrs_symbol(11)) /* %kernel-restart */ |
---|
122 | #define nrs_PACKAGE (nrs_symbol(12)) /* *package* */ |
---|
123 | #define nrs_TOTAL_BYTES_FREED (nrs_symbol(13)) /* *total-bytes-freed* */ |
---|
124 | #define nrs_KALLOWOTHERKEYS (nrs_symbol(14)) /* :allow-other-keys */ |
---|
125 | #define nrs_TOPLCATCH (nrs_symbol(15)) /* %toplevel-catch% */ |
---|
126 | #define nrs_TOPLFUNC (nrs_symbol(16)) /* %toplevel-function% */ |
---|
127 | #define nrs_CALLBACKS (nrs_symbol(17)) /* %pascal-functions% */ |
---|
128 | #define nrs_ALLMETEREDFUNS (nrs_symbol(18)) /* *all-metered-functions* */ |
---|
129 | #define nrs_TOTAL_GC_MICROSECONDS (nrs_symbol(19)) /* *total-gc-microseconds* */ |
---|
130 | #define nrs_BUILTIN_FUNCTIONS (nrs_symbol(20)) /* %builtin-functions% */ |
---|
131 | #define nrs_UDF (nrs_symbol(21)) /* %unbound-function% */ |
---|
132 | #define nrs_INIT_MISC (nrs_symbol(22)) /* %init-misc% */ |
---|
133 | #define nrs_MACRO_CODE (nrs_symbol(23)) /* %macro-code% */ |
---|
134 | #define nrs_CLOSURE_CODE (nrs_symbol(24)) /* %closure-code% */ |
---|
135 | #define nrs_NEW_GCABLE_PTR (nrs_symbol(25)) /* %new-gcable-ptr */ |
---|
136 | #define nrs_GC_EVENT_STATUS_BITS (nrs_symbol(26)) /* *gc-event-status-bits* */ |
---|
137 | #define nrs_POST_GC_HOOK (nrs_symbol(27)) /* *post-gc-hook* */ |
---|
138 | #define nrs_HANDLERS (nrs_symbol(28)) /* %handlers% */ |
---|
139 | #define nrs_ALL_PACKAGES (nrs_symbol(29)) /* %all-packages% */ |
---|
140 | #define nrs_KEYWORD_PACKAGE (nrs_symbol(30)) /* *keyword-package* */ |
---|
141 | #define nrs_FINALIZATION_ALIST (nrs_symbol(31)) /* %finalization-alist% */ |
---|
142 | #define nrs_FOREIGN_THREAD_CONTROL (nrs_symbol(32)) /* %foreign-thread-control */ |
---|
143 | #define num_nilreg_symbols 33 |
---|
144 | #define nilreg_symbols_end ((BytePtr) &(nrs_symbol(num_nilreg_symbols))) |
---|
145 | #endif |
---|