Clean up RCS ids
[projects/cmucl/cmucl.git] / src / lisp / sparc-validate.h
CommitLineData
82a2bc67 1/*
2
82a2bc67 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*/
7
e67c0397 8#ifndef _SPARC_VALIDATE_H_
9#define _SPARC_VALIDATE_H_
10
e5a4d017 11/*
12 * Address map:
13 *
846ddb1c 14 * 0x00000000->0x0f800000 248M C code and stuff(?)
15 * 0x0f800000->0x10000000 8M for linkage table area
e5a4d017 16 * 0x10000000->0x20000000 256M Read-Only Space.
17 * 0x20000000->0x28000000 128M Binding stack growing up.
18 * 0x28000000->0x38000000 256M Static Space.
d538fdfd 19 * 0x38000000->0x40000000 128M Control stack growing up.
e5a4d017 20 * 0x40000000->0x80000000 1024M Dynamic space 1
21 * 0x80000000->0xc0000000 1024M Dynamic space 2
22 * 0xc0000000->0xffffffff 1024M C stack, dynamic libs, etc.
23 *
f7c525cc 24 * With GENCGC:
25 *
26 * 0x00000000->0x0f800000 248M C code and stuff(?)
27 * 0x0f800000->0x10000000 8M for linkage table area
28 * 0x10000000->0x20000000 256M Read-Only Space.
29 * 0x20000000->0x28000000 128M Binding stack growing up.
30 * 0x28000000->0x38000000 256M Static Space.
31 * 0x38000000->0x40000000 128M Control stack growing up.
8bc08fc7 32 * 0x40000000->0xf0000000 2816M Dynamic space 1
33 * 0xf0000000->0xffffffff 1024M C stack, dynamic libs, etc.
f7c525cc 34 *
35 * But look at the definitions below to see how much is really
36 * allocated. The numbers above are the maximums allowed. We might
37 * use less.
38 *
e5a4d017 39 * Almost. We leave a hole of size 32 KB at the end of each of these
40 * spaces.
41 *
42 *
43 * It may be possible to increase the size of the dynamic spaces even
44 * further, but Casper H.S. Dik says shared libraries are loaded
45 * directly under the stack, so we need to leave some space for the C
46 * stack and shared libraries. He also says the top of stack is
8bc08fc7 47 * 0xffbf0000 for Ultrasparcs in Solaris 7+, but it's 0xf0000000 for
e5a4d017 48 * sun4m (and 4u in S2.6-) 0xe0000000 for sun4d)
49 *
50 * Shared libraries can be mapped anywhere there's room.
51 */
36232b68 52
f7c525cc 53/* Need this to define the spaces described in Lisp */
54
55/*#include "internals.h"*/
56
d0f77a5b 57/* 128 MB */
58#define MB_128 (0x08000000)
e5a4d017 59/*
60 *
61 * Note: I'm not sure why, but the sizes must be on a
62 * SPARSE_BLOCK_SIZE (32 KB) boundary. (See seg_force_resident in
63 * sunos-os.c. If not, then mapping the holes causes segfaults in
64 * initialization.)
65 *
846ddb1c 66 * Sparse block size must be larger than the system page size.
e5a4d017 67 */
49fdb025 68
846ddb1c 69#define SPARSE_BLOCK_SIZE (1<<15)
70#define SPARSE_SIZE_MASK (SPARSE_BLOCK_SIZE-1)
71
72
49fdb025 73#ifdef LINKAGE_TABLE
74/*
75 * This space start better match the value of
76 * target-foreign-linkage-space-start defined in sparc/parms.lisp!
77 *
78 * See the notes there!
79 */
f7c525cc 80
81#define FOREIGN_LINKAGE_SPACE_START (LinkageSpaceStart)
49fdb025 82
83/*
84 * This allows for about 510K symbols (assuming each entry is 16 bytes
85 * long). Hope that's enough! Make sure this doesn't overlap the
86 * READ_ONLY_SPACE_START!
87 */
9a8c1c2f 88#define FOREIGN_LINKAGE_SPACE_SIZE (0x00800000 - SPARSE_BLOCK_SIZE) /* 8 MB - 32 KB */
49fdb025 89#endif
90
91
f7c525cc 92#define READ_ONLY_SPACE_START (SpaceStart_TargetReadOnly)
9a8c1c2f 93#define READ_ONLY_SPACE_SIZE ((2*MB_128) - SPARSE_BLOCK_SIZE) /* 256 MB - 32 KB, 256 MB max */
94
e5a4d017 95#define BINDING_STACK_START (0x20000000)
9a8c1c2f 96#define BINDING_STACK_SIZE (MB_128 - SPARSE_BLOCK_SIZE) /* 128 MB - 32 KB, 128 MB max */
e5a4d017 97
f7c525cc 98#define STATIC_SPACE_START (SpaceStart_TargetStatic)
9a8c1c2f 99#define STATIC_SPACE_SIZE ((2*MB_128) - SPARSE_BLOCK_SIZE) /* 256 MB - 32 KB, 256 MB max */
36232b68 100
e5a4d017 101#define CONTROL_STACK_START (0x38000000)
9a8c1c2f 102#define CONTROL_STACK_SIZE (MB_128 - SPARSE_BLOCK_SIZE) /* 128 MB - 32 KB, 128 MB max */
44a8f0c7 103#define CONTROL_STACK_END (CONTROL_STACK_START + control_stack_size)
36232b68 104
f7c525cc 105#define DYNAMIC_0_SPACE_START (SpaceStart_TargetDynamic)
106
6168f3bb 107/* This isn't used with GENCGC */
e5a4d017 108#define DYNAMIC_1_SPACE_START (0x80000000)
36232b68 109
e5a4d017 110/* The default dynamic space to allocate */
d0c874d1 111/*
112 * On Solaris 10, Martin Rydstrom reports that subtracting off
113 * SPARSE_BLOCK_SIZE causes CMUCL not to work (GC lossage). But
114 * specifying -dynamic-space-size 256 works fine. I don't understand
115 * how that can be, but we lets not subtract it off.
116 */
117#if 0
9a8c1c2f 118#define DEFAULT_DYNAMIC_SPACE_SIZE (0x10000000 - SPARSE_BLOCK_SIZE) /* 256 MB - 32 KB */
d0c874d1 119#else
9a8c1c2f 120#define DEFAULT_DYNAMIC_SPACE_SIZE (0x10000000) /* 256 MB */
d0c874d1 121#endif
36232b68 122
e5a4d017 123/* The maximum dynamic space that we can allocate */
6168f3bb 124#ifdef GENCGC
846ddb1c 125/*
f7c525cc 126 * For GENCGC, we can use both dynamic spaces, so we get at least
127 * double the heap size.
846ddb1c 128 */
9a8c1c2f 129#define DYNAMIC_SPACE_SIZE (0xB0000000 - SPARSE_BLOCK_SIZE) /* 2816 MB - 32 KB max */
6168f3bb 130#else
9a8c1c2f 131#define DYNAMIC_SPACE_SIZE (0x40000000 - SPARSE_BLOCK_SIZE) /* 1GB - 32 KB max */
6168f3bb 132#endif
e67c0397 133
134#endif /* _SPARC_VALIDATE_H_ */