/[cmucl]/src/lisp/x86-validate.h
ViewVC logotype

Contents of /src/lisp/x86-validate.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.16 - (hide annotations)
Tue Aug 27 22:18:34 2002 UTC (11 years, 7 months ago) by moore
Branch: MAIN
CVS Tags: release-18e-base, LINKAGE_TABLE, release-18e-pre2, cold-pcl-base, UNICODE-BASE, release-18e, release-18e-pre1
Branch point for: UNICODE-BRANCH, release-18e-branch, cold-pcl
Changes since 1.15: +9 -1 lines
File MIME type: text/plain
On x86 FreeBSD and Linux, change the way foreign symbol addresses are resolved.
They now go through a table -- effectively a new space in the core file.
Function references are resolved lazily, data references are resolved on startup
and when a .so is loaded.  The end result is that cores can be dumped that
contain references to symbols in shared libraries.  Also, the dependence of the core on addresses in the Lisp runtime is broken.

The linkage table feature is controlled by :linkage-table and LINKAGE_TABLE in C
runtime.  Several foreign symbols are now Lisp static symbols, so a cross
compile is required whether or not the new stuff is used.  I've checked in
boot4-cross-foreign-linkage.lisp that builds the compiler for linkage table; do whatever you usually do for the non-linkage table case:)  Seriously, lets start
a discussion on standardizing "cross compilation," not to mention the general
build procedure.
1 ram 1.1 /*
2 dtc 1.7 *
3     * This code was written as part of the CMU Common Lisp project at
4     * Carnegie Mellon University, and has been placed in the public domain.
5     *
6 moore 1.16 * $Header: /tiger/var/lib/cvsroots/cmucl/src/lisp/x86-validate.h,v 1.16 2002/08/27 22:18:34 moore Exp $
7 dtc 1.7 *
8     */
9    
10     /*
11     * Address map:
12     *
13     * FreeBSD:
14     * 0x00000000->0x0E000000 224M C program and memory allocation.
15     * 0x0E000000->0x10000000 32M Foreign segment.
16     * 0x10000000->0x20000000 256M Read-Only Space.
17     * 0x20000000->0x28000000 128M Reserved for shared libraries.
18     * 0x28000000->0x38000000 256M Static Space.
19     * 0x38000000->0x40000000 128M Binding stack growing up.
20     * 0x40000000->0x48000000 128M Control stack growing down.
21     * 0x48000000->0xC8000000 2GB Dynamic Space.
22     * 0xE0000000-> 256M C stack - Alien stack.
23 dtc 1.9 *
24 pmai 1.14 * OpenBSD and NetBSD:
25 pmai 1.13 * 0x00000000->0x0E000000 224M C program and memory allocation.
26     * 0x0E000000->0x10000000 32M Foreign segment.
27     * 0x10000000->0x20000000 256M Read-Only Space.
28     * 0x20000000->0x28000000 128M Binding stack growing up.
29     * 0x28000000->0x38000000 256M Static Space.
30     * 0x38000000->0x40000000 128M Control stack growing down.
31     * 0x40000000->0x48000000 128M Reserved for shared libraries.
32     * 0x48000000->0xB8000000 1.75GB Dynamic Space.
33     * 0xE0000000-> 256M C stack - Alien stack.
34     *
35 dtc 1.11 * Linux:
36 dtc 1.7 * 0x00000000->0x08000000 128M Unused.
37     * 0x08000000->0x10000000 128M C program and memory allocation.
38     * 0x10000000->0x20000000 256M Read-Only Space.
39     * 0x20000000->0x28000000 128M Binding stack growing up.
40     * 0x28000000->0x38000000 256M Static Space.
41     * 0x38000000->0x40000000 128M Control stack growing down.
42     * 0x40000000->0x48000000 128M Reserved for shared libraries.
43     * 0x48000000->0xB8000000 1.75G Dynamic Space.
44     *
45     */
46    
47 dtc 1.9 #ifdef __FreeBSD__
48 dtc 1.7 #define READ_ONLY_SPACE_START (0x10000000)
49     #define READ_ONLY_SPACE_SIZE (0x0ffff000) /* 256MB - 1 page */
50    
51 moore 1.15 #define STATIC_SPACE_START (0x28f00000)
52     #define STATIC_SPACE_SIZE (0x0f0ff000) /* 241MB - 1 page */
53 dtc 1.7
54     #define BINDING_STACK_START (0x38000000)
55     #define BINDING_STACK_SIZE (0x07fff000) /* 128MB - 1 page */
56 dtc 1.9
57 dtc 1.7 #define CONTROL_STACK_START (0x40000000)
58     #define CONTROL_STACK_SIZE (0x08000000) /* 128MB */
59 dtc 1.9
60     #define DYNAMIC_0_SPACE_START (0x48000000)
61     #ifdef GENCGC
62     #define DYNAMIC_SPACE_SIZE (0x40000000) /* May be up to 2GB */
63 pmai 1.13 #else
64     #define DYNAMIC_SPACE_SIZE (0x04000000) /* 64MB */
65     #endif
66     #define DEFAULT_DYNAMIC_SPACE_SIZE (0x20000000) /* 512MB */
67 moore 1.16 #ifdef LINKAGE_TABLE
68     #define FOREIGN_LINKAGE_SPACE_START (0xb0000000)
69     #define FOREIGN_LINKAGE_SPACE_SIZE (0x100000) /* 1MB */
70 pmai 1.13 #endif
71 moore 1.16 #endif /* __FreeBSD__ */
72 pmai 1.13
73    
74 pmai 1.14 #if defined(__OpenBSD__) || defined(__NetBSD__)
75 pmai 1.13 #define READ_ONLY_SPACE_START (0x10000000)
76     #define READ_ONLY_SPACE_SIZE (0x0ffff000) /* 256MB - 1 page */
77    
78     #define STATIC_SPACE_START (0x28000000)
79     #define STATIC_SPACE_SIZE (0x0ffff000) /* 256MB - 1 page */
80    
81     #define BINDING_STACK_START (0x20000000)
82     #define BINDING_STACK_SIZE (0x07fff000) /* 128MB - 1 page */
83    
84     #define CONTROL_STACK_START (0x38000000)
85     #define CONTROL_STACK_SIZE (0x07fff000) /* 128MB - 1 page */
86    
87     #define DYNAMIC_0_SPACE_START (0x48000000)
88     #ifdef GENCGC
89     #define DYNAMIC_SPACE_SIZE (0x68000000) /* 1.625GB */
90 dtc 1.9 #else
91     #define DYNAMIC_SPACE_SIZE (0x04000000) /* 64MB */
92 dtc 1.7 #endif
93 dtc 1.12 #define DEFAULT_DYNAMIC_SPACE_SIZE (0x20000000) /* 512MB */
94 dtc 1.9 #endif
95    
96 ram 1.1
97 dtc 1.7 #ifdef __linux__
98 dtc 1.11 #define READ_ONLY_SPACE_START (0x10000000)
99     #define READ_ONLY_SPACE_SIZE (0x0ffff000) /* 256MB - 1 page */
100 dtc 1.9
101 dtc 1.11 #define STATIC_SPACE_START (0x28000000)
102     #define STATIC_SPACE_SIZE (0x0ffff000) /* 256MB - 1 page */
103 dtc 1.9
104 dtc 1.10 #define BINDING_STACK_START (0x20000000)
105 dtc 1.7 #define BINDING_STACK_SIZE (0x07fff000) /* 128MB - 1 page */
106 dtc 1.9
107 dtc 1.10 #define CONTROL_STACK_START (0x38000000)
108 dtc 1.7 #define CONTROL_STACK_SIZE (0x07fff000) /* 128MB - 1 page */
109 ram 1.1
110 dtc 1.10 #define DYNAMIC_0_SPACE_START (0x48000000)
111 dtc 1.4 #ifdef GENCGC
112 dtc 1.12 #define DYNAMIC_SPACE_SIZE (0x68000000) /* 1.625GB */
113 dtc 1.3 #else
114 dtc 1.4 #define DYNAMIC_SPACE_SIZE (0x04000000) /* 64MB */
115 dtc 1.3 #endif
116 dtc 1.12 #define DEFAULT_DYNAMIC_SPACE_SIZE (0x20000000) /* 512MB */
117 moore 1.16 #ifdef LINKAGE_TABLE
118     #define FOREIGN_LINKAGE_SPACE_START (0xb0000000)
119     #define FOREIGN_LINKAGE_SPACE_SIZE (0x100000) /* 1MB */
120     #endif
121 dtc 1.9 #endif
122 dtc 1.10
123 ram 1.1
124 dtc 1.9 #define CONTROL_STACK_END (CONTROL_STACK_START + CONTROL_STACK_SIZE)
125    
126     /* Note that GENCGC only uses dynamic_space 0. */
127 dtc 1.7 #define DYNAMIC_1_SPACE_START (DYNAMIC_0_SPACE_START + DYNAMIC_SPACE_SIZE)

  ViewVC Help
Powered by ViewVC 1.1.5