aboutsummaryrefslogtreecommitdiff
path: root/src/core/memmap.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/memmap.h')
-rw-r--r--src/core/memmap.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/src/core/memmap.h b/src/core/memmap.h
new file mode 100644
index 0000000..b2ee787
--- /dev/null
+++ b/src/core/memmap.h
@@ -0,0 +1,53 @@
+/* machine map, in words. the default has the code area, the compiler tables,
+ the genome and the stacks first (PW words in all) and the heap last: it
+ starts at PW and grows at run time, up to MW words of memory. MW is the
+ host's memory size; the array behind it is untouched until the heap grows
+ into it. a smaller board is a different build: src/tools/genmap writes a
+ directory whose memmap.h and genome agree, and the C cores are compiled
+ against that directory. do not edit the numbers by hand in one file only.
+
+ include genome.h before this header when both are in the translation
+ unit. the linked image's GORG then wins; it has to be the same value
+ this header would have defined.
+
+ PW is the first word past the initial stacks. emitted code can add heap
+ segments, and native code-address tables grow with those reservations.
+ MW bounds data addresses. a fixed map (HEAP_GROW 0) has MW == PW.
+
+ DSLIM and RSLIM are the interpreter's stack checks. a straight-line
+ block can push about 1024 words after the check, which is why the data
+ limit sits 1100 words above DSLO. the genome's prologue checks the current frame segment and adds another
+ segment when needed. */
+#ifndef MEMMAP_H
+#define MEMMAP_H
+#define PW 0x1C5000
+#define CODE_END 0x80000
+#define HEAP_LO 0x1C5000
+#define HEAP_HI 0x225000
+#define HEAP_GROW 1
+#ifndef MW
+#define MW 0x8000000
+#endif
+#if MW < HEAP_HI
+#error MW is below the end of the initial heap
+#endif
+#define ZFP 0x90000
+#ifdef GORG
+#if GORG != 0x114100
+#error genome GORG does not match this map
+#endif
+#else
+#define GORG 0x114100
+#endif
+#define FBOT 0x164100
+#define FTOP 0x1A4100
+#define RS0 0x1A4100
+#define MARK0 0x1B4100
+#define MARKN 0x8000
+#define DSLO 0x1BC100
+#define DSHI 0x1C4FF0
+#define DS0 DSHI
+#define SYSGATE (ZFP + 2)
+#define DSLIM (DSLO + 1100)
+#define RSLIM (MARK0 - 8)
+#endif