2 * This software is part of the SBCL system. See the README file for
5 * This software is derived from the CMU CL system, which was
6 * written at Carnegie Mellon University and released into the
7 * public domain. The software is in the public domain and is
8 * provided with absolutely no warranty. See the COPYING and CREDITS
9 * files for more information.
20 * 0x00000000->0x0E000000 224M C program and memory allocation.
21 * 0x0E000000->0x10000000 32M Foreign segment.
22 * 0x10000000->0x20000000 256M Read-Only Space.
23 * 0x20000000->0x30000000 256M Reserved for shared libraries.
24 * 0x30000000->0x38000000 128M Static Space.
25 * 0x38000000->0x40000000 128M Binding stack growing up.
26 * 0x40000000->0x48000000 128M Control stack growing down.
27 * 0x48000000->0xC8000000 2GB Dynamic Space.
28 * 0xE0000000-> 256M C stack - Alien stack.
31 * almost the same as FreeBSD
33 * Linux: Note that this map has some problems and requires some further
34 * development so is not implemented below.
35 * 0x00000000->0x08000000 128M Unused.
36 * 0x08000000->0x10000000 128M C program and memory allocation.
37 * 0x10000000->0x20000000 256M Read-Only Space.
38 * 0x20000000->0x28000000 128M Binding stack growing up.
39 * 0x28000000->0x38000000 256M Static Space.
40 * 0x38000000->0x40000000 128M Control stack growing down.
41 * 0x40000000->0x48000000 128M Reserved for shared libraries.
42 * 0x48000000->0xB8000000 1.75G Dynamic Space.
44 * FIXME: There's something wrong with addressing maps which are so
45 * brittle that they can be commented as fixed addresses. Try to
46 * parameterize these so they can be set at build time.
49 #if defined(__FreeBSD__) || defined(__OpenBSD__)
50 #define READ_ONLY_SPACE_SIZE (0x0ffff000) /* 256MB - 1 page */
52 #if defined __FreeBSD__
53 #define STATIC_SPACE_SIZE (0x07fff000) /* 128M - 1 page */
54 #elif defined __OpenBSD__
55 #define STATIC_SPACE_SIZE (0x0ffff000) /* 256M - 1 page */
57 #error unsupported BSD variant
61 #define BINDING_STACK_START (0x38000000)
62 #define BINDING_STACK_SIZE (0x07fff000) /* 128MB - 1 page */
64 #define CONTROL_STACK_START (0x40000000)
65 #define CONTROL_STACK_SIZE (0x08000000) /* 128MB */
67 #define DYNAMIC_0_SPACE_START (0x48000000)
69 #define DYNAMIC_SPACE_SIZE (0x40000000) /* May be up to 2GB */
71 #define DYNAMIC_SPACE_SIZE (0x04000000) /* 64MB */
75 /* FIXME: It's gross to have numbers like 0x50000000 wired into the
76 * code in multiple places like this. (Not only does this file know
77 * about it, but Lisp code knows about it, because Lisp code is able
78 * to generate absolute addresses for all the static symbols even
79 * before it's read the map file.) I don't know whether I should
80 * actually *fix* this, but I should at least document it some with a
81 * KLUDGE marker. And it might even be fixable, by putting all this
82 * memory space arbitrariness into an architecture-dependent Lisp
83 * file. If so, perhaps I should write somewhere in a "design
84 * principles" or "coding principles" file that information like this
85 * always flows from Lisp code to C code, through sbcl.h. */
87 #define READ_ONLY_SPACE_SIZE (0x02800000) /* 40MB */
89 #define STATIC_SPACE_SIZE (0x02fff000) /* 48MB - 1 page */
91 #define BINDING_STACK_START (0x60000000)
92 #define BINDING_STACK_SIZE (0x07fff000) /* 128MB - 1 page */
94 #define CONTROL_STACK_START (0x50000000)
95 #define CONTROL_STACK_SIZE (0x07fff000) /* 128MB - 1 page */
97 #define DYNAMIC_0_SPACE_START (0x09000000)
99 #define DYNAMIC_SPACE_SIZE (0x20000000) /* 512MB */
101 #define DYNAMIC_SPACE_SIZE (0x04000000) /* 64MB */
105 #define CONTROL_STACK_END (CONTROL_STACK_START + CONTROL_STACK_SIZE)
107 /* Note that GENCGC only uses dynamic_space 0. */
108 #define DYNAMIC_1_SPACE_START (DYNAMIC_0_SPACE_START + DYNAMIC_SPACE_SIZE)