/[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.31.8.1 - (show annotations)
Tue Dec 14 04:25:11 2010 UTC (3 years, 4 months ago) by rtoy
Branch: cross-sol-x86-branch
Changes since 1.31: +29 -2 lines
File MIME type: text/plain
First cut at a build for Solaris/x86.  Result doesn't work; it gets as
far as TYPE-INIT, but then crashes.

These changes still allow solaris/sparc and darwin/x86 to build, so we
haven't broken both sparc and x86 while doing this.

tools/cross-scripts/cross-x86-osx-solaris.lisp:
o New cross-compile script to use darwin/x86 to cross-compile to
  solaris/x86.

compiler/x86/parms.lisp:
o For now, put thel linkage space start at 0xc0000000 on Solaris/x86.

lisp/Config.sparc_common:
o Separate out the common parts between Solaris sparc and x86.  Move
  the different parts into the appropriate file.

lisp/Config.sparc_sunc:
o Add ASSEM_SRC and ARCH_SRC here, with the appropriate OS_SRC,
  OS_LINK_FLAGS, and OS_LIBS>

lisp/Config.x86_solaris_sunc:
o New file for building solaris/x86 using Sun C (aka Sun Studio aka
  Solaris Studio)

lisp/interrupt.c:
o Use a static array for the altstack.  Should eventually do what
  other x86 platforms do.

lisp/solaris-os.c:
o Don't need os_flush_icache on x86 (?), so make the body empty for
  x86.
o Add x86 version of os_sigcontext_reg and os_sigcontext_pc.

lisp/sunos-os.h:
o The pagesize is 4096 on x86 instead of 8192.
o Don't need (?) SAVE_CONTEXT.

lisp/x86-assem.S:
o Update to support Sun C assembler:
  - Add appropriate GNAME, FUNCDEF and ENDFUNC macros.
  - Sun assembler doesn't have int3 instruction, so add INT3 macro to
    do the appropriate things.
  - Sun assembler doesn't like control L characters in the file so
    remove them.

lisp/x86-validate.h:
o Add entry for Solaris.  This needs work, but it looks like these
  values will work.
1 /*
2 *
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 * $Header: /tiger/var/lib/cvsroots/cmucl/src/lisp/x86-validate.h,v 1.31.8.1 2010/12/14 04:25:11 rtoy Exp $
7 *
8 */
9
10 #ifndef _X86_VALIDATE_H_
11 #define _X86_VALIDATE_H_
12
13 /*
14 * Also look in compiler/x86/parms.lisp for some of the parameters.
15 *
16 * Address map:
17 *
18 * FreeBSD:
19 * 0x00000000->0x0E000000 224M C program and memory allocation.
20 * 0x0E000000->0x10000000 32M Foreign segment.
21 * 0x10000000->0x20000000 256M Read-Only Space.
22 * 0x20000000->0x28000000 128M Reserved for shared libraries.
23 * 0x28000000->0x38000000 256M Static Space.
24 * 0x38000000->0x40000000 128M Binding stack growing up.
25 * 0x40000000->0x48000000 128M Control stack growing down.
26 * 0x48000000->0xB0000000 1664M Dynamic Space.
27 * 0xB0000000->0xB1000000 Foreign Linkage Table
28 * 0xE0000000-> 256M C stack - Alien stack.
29 *
30 * OpenBSD:
31 * 0x00000000->0x0E000000 224M C program and memory allocation.
32 * 0x0E000000->0x10000000 32M Foreign segment.
33 * 0x10000000->0x20000000 256M Read-Only Space.
34 * 0x20000000->0x28000000 128M Binding stack growing up.
35 * 0x28000000->0x38000000 256M Static Space.
36 * 0x38000000->0x40000000 128M Control stack growing down.
37 * 0x40000000->0x48000000 128M Reserved for shared libraries.
38 * 0x48000000->0xB0000000 1664M Dynamic Space.
39 * 0xB0000000->0xB1000000 16M Foreign Linkage Table
40 * 0xE0000000-> 256M C stack - Alien stack.
41 *
42 * NetBSD:
43 * 0x00000000->0x0E000000 224M C program and memory allocation.
44 * 0x0E000000->0x10000000 32M Foreign segment.
45 * 0x10000000->0x20000000 256M Read-Only Space.
46 * 0x28000000->0x38000000 256M Static Space.
47 * 0x38000000->0x40000000 128M Binding stack growing up.
48 * 0x40000000->0x48000000 128M Control stack growing down.
49 * 0x48800000->0xB0000000 1656M Dynamic Space.
50 * 0xB0000000->0xB1000000 16M Foreign Linkage Table
51 * 0xE0000000-> 256M C stack - Alien stack.
52 *
53 * Linux:
54 * 0x00000000->0x08000000 128M Unused.
55 * 0x08000000->0x10000000 128M C program and memory allocation.
56 * 0x10000000->0x20000000 256M Read-Only Space.
57 * 0x20000000->0x28000000 128M Binding stack growing up.
58 * 0x28000000->0x38000000 256M Static Space.
59 * 0x38000000->0x40000000 128M Control stack growing down.
60 * 0x40000000->0x48000000 128M Reserved for shared libraries.
61 * 0x58000000->0x58100000 16M Foreign Linkage Table
62 * 0x58100000->0xBE000000 1631M Dynamic Space.
63 * 0xBFFF0000->0xC0000000 Unknown Linux mapping
64 *
65 * (Note: 0x58000000 allows us to run on a Linux system on an AMD
66 * x86-64. Hence we have a gap of unused memory starting at
67 * 0x48000000.)
68 */
69
70 #ifdef __FreeBSD__
71 #define READ_ONLY_SPACE_START (0x10000000)
72 #define READ_ONLY_SPACE_SIZE (0x0ffff000) /* 256MB - 1 page */
73
74 #define STATIC_SPACE_START (0x28f00000)
75 #define STATIC_SPACE_SIZE (0x0f0ff000) /* 241MB - 1 page */
76
77 #define BINDING_STACK_START (0x38000000)
78 #define BINDING_STACK_SIZE (0x07fff000) /* 128MB - 1 page */
79
80 #define CONTROL_STACK_START 0x40000000
81 #define CONTROL_STACK_SIZE 0x07fd8000 /* 128MB - SIGSTKSZ */
82 #define SIGNAL_STACK_START 0x47fd8000
83 #define SIGNAL_STACK_SIZE SIGSTKSZ
84
85 #define DYNAMIC_0_SPACE_START (0x48000000UL)
86 #ifdef GENCGC
87 #define DYNAMIC_SPACE_SIZE (0x78000000UL) /* May be up to 1.7 GB */
88 #else
89 #define DYNAMIC_SPACE_SIZE (0x04000000UL) /* 64MB */
90 #endif
91 #define DEFAULT_DYNAMIC_SPACE_SIZE (0x20000000UL) /* 512MB */
92 #ifdef LINKAGE_TABLE
93 #define FOREIGN_LINKAGE_SPACE_START ((unsigned long) LinkageSpaceStart)
94 #define FOREIGN_LINKAGE_SPACE_SIZE (0x100000UL) /* 1MB */
95 #endif
96 #endif /* __FreeBSD__ */
97
98
99 #ifdef __OpenBSD__
100 #define READ_ONLY_SPACE_START (0x10000000)
101 #define READ_ONLY_SPACE_SIZE (0x0ffff000) /* 256MB - 1 page */
102
103 #define STATIC_SPACE_START (0x28000000)
104 #define STATIC_SPACE_SIZE (0x0ffff000) /* 256MB - 1 page */
105
106 #define BINDING_STACK_START (0x38000000)
107 #define BINDING_STACK_SIZE (0x07fff000) /* 128MB - 1 page */
108
109 #define CONTROL_STACK_START (0x40000000)
110 #define CONTROL_STACK_SIZE (0x07fd8000) /* 128MB - SIGSTKSZ */
111
112 #define SIGNAL_STACK_START (0x47fd8000)
113 #define SIGNAL_STACK_SIZE SIGSTKSZ
114
115 #define DYNAMIC_0_SPACE_START (0x48000000)
116 #ifdef GENCGC
117 #define DYNAMIC_SPACE_SIZE (0x68000000) /* 1.625GB */
118 #else
119 #define DYNAMIC_SPACE_SIZE (0x04000000) /* 64MB */
120 #endif
121 #define DEFAULT_DYNAMIC_SPACE_SIZE (0x20000000) /* 512MB */
122 #endif
123
124 #if defined(__NetBSD__) || defined(DARWIN)
125 #define READ_ONLY_SPACE_START (SpaceStart_TargetReadOnly)
126 #define READ_ONLY_SPACE_SIZE (0x0ffff000) /* 256MB - 1 page */
127
128 #define STATIC_SPACE_START (SpaceStart_TargetStatic)
129 #define STATIC_SPACE_SIZE (0x0ffff000) /* 256MB - 1 page */
130
131 #define BINDING_STACK_START (0x38000000)
132 #define BINDING_STACK_SIZE (0x07fff000) /* 128MB - 1 page */
133
134 #define CONTROL_STACK_START (0x40000000)
135 #define CONTROL_STACK_SIZE (0x07fd8000) /* 128MB - SIGSTKSZ */
136
137 #define SIGNAL_STACK_START (0x47fd8000)
138 #define SIGNAL_STACK_SIZE SIGSTKSZ
139
140 #define DYNAMIC_0_SPACE_START (SpaceStart_TargetDynamic)
141 #ifdef GENCGC
142 #if defined(DARWIN)
143 /*
144 * On Darwin, /usr/lib/dyld appears to always be loaded at address
145 * #x8fe2e000. Hence, the maximum dynamic space size is 1206050816
146 * bytes, or just over 1.150 GB. Set the limit to 1.150 GB.
147 */
148 #define DYNAMIC_SPACE_SIZE (0x47E00000U) /* 1.150GB */
149 #else
150 #define DYNAMIC_SPACE_SIZE (0x67800000U) /* 1.656GB */
151 #endif
152 #else
153 #define DYNAMIC_SPACE_SIZE (0x04000000U) /* 64MB */
154 #endif
155 #define DEFAULT_DYNAMIC_SPACE_SIZE (0x20000000U) /* 512MB */
156 #ifdef LINKAGE_TABLE
157 #define FOREIGN_LINKAGE_SPACE_START (LinkageSpaceStart)
158 #define FOREIGN_LINKAGE_SPACE_SIZE (0x100000) /* 1MB */
159 #endif
160 #endif /* __NetBSD__ || DARWIN */
161
162 #ifdef __linux__
163 #define READ_ONLY_SPACE_START (SpaceStart_TargetReadOnly)
164 #define READ_ONLY_SPACE_SIZE (0x0ffff000) /* 256MB - 1 page */
165
166 #define STATIC_SPACE_START (SpaceStart_TargetStatic)
167 #define STATIC_SPACE_SIZE (0x0ffff000) /* 256MB - 1 page */
168
169 #define BINDING_STACK_START (0x20000000)
170 #define BINDING_STACK_SIZE (0x07fff000) /* 128MB - 1 page */
171
172 #define CONTROL_STACK_START 0x38000000
173 #define CONTROL_STACK_SIZE (0x07fff000 - 8192)
174 #define SIGNAL_STACK_START CONTROL_STACK_END
175 #define SIGNAL_STACK_SIZE SIGSTKSZ
176
177 #define DYNAMIC_0_SPACE_START (SpaceStart_TargetDynamic)
178
179 #ifdef GENCGC
180 #define DYNAMIC_SPACE_SIZE (0x66000000) /* 1.632GB */
181 #else
182 #define DYNAMIC_SPACE_SIZE (0x04000000) /* 64MB */
183 #endif
184 #define DEFAULT_DYNAMIC_SPACE_SIZE (0x20000000) /* 512MB */
185 #ifdef LINKAGE_TABLE
186 #define FOREIGN_LINKAGE_SPACE_START (LinkageSpaceStart)
187 #define FOREIGN_LINKAGE_SPACE_SIZE (0x100000) /* 1MB */
188 #endif
189 #endif
190
191 #ifdef SOLARIS
192 #define READ_ONLY_SPACE_START (SpaceStart_TargetReadOnly)
193 #define READ_ONLY_SPACE_SIZE (0x0ffff000) /* 256MB - 1 page */
194
195 #define STATIC_SPACE_START (SpaceStart_TargetStatic)
196 #define STATIC_SPACE_SIZE (0x0ffff000) /* 256MB - 1 page */
197
198 #define BINDING_STACK_START (0x20000000)
199 #define BINDING_STACK_SIZE (0x07fff000) /* 128MB - 1 page */
200
201 #define CONTROL_STACK_START 0x38000000
202 #define CONTROL_STACK_SIZE (0x07fff000 - 8192)
203 #define SIGNAL_STACK_SIZE SIGSTKSZ
204
205 #define DYNAMIC_0_SPACE_START (SpaceStart_TargetDynamic)
206
207 #ifdef GENCGC
208 #define DYNAMIC_SPACE_SIZE (0x66000000) /* 1.632GB */
209 #else
210 #define DYNAMIC_SPACE_SIZE (0x04000000) /* 64MB */
211 #endif
212 #define DEFAULT_DYNAMIC_SPACE_SIZE (0x20000000) /* 512MB */
213 #ifdef LINKAGE_TABLE
214 #define FOREIGN_LINKAGE_SPACE_START (LinkageSpaceStart)
215 #define FOREIGN_LINKAGE_SPACE_SIZE (0x100000) /* 1MB */
216 #endif
217 #endif
218
219 #define CONTROL_STACK_END (CONTROL_STACK_START + CONTROL_STACK_SIZE)
220
221 /* Note that GENCGC only uses dynamic_space 0. */
222 #define DYNAMIC_1_SPACE_START (DYNAMIC_0_SPACE_START + DYNAMIC_SPACE_SIZE)
223
224 #endif /* _X86_VALIDATE_H_ */

  ViewVC Help
Powered by ViewVC 1.1.5