aboutsummaryrefslogtreecommitdiffstats
path: root/memdisk/e820func.c
diff options
context:
space:
mode:
authorhpa <hpa>2001-12-11 01:20:33 +0000
committerhpa <hpa>2001-12-11 01:20:33 +0000
commit7de02ddf8887f37a5e3c0f810cbf45ac7029c165 (patch)
treed3c58b134dee7e2a5542bef8ce271a00f589a420 /memdisk/e820func.c
parent0d064db972a8bdff2e508a56f07e533348b84017 (diff)
downloadsyslinux.git-7de02ddf8887f37a5e3c0f810cbf45ac7029c165.tar.gz
syslinux.git-7de02ddf8887f37a5e3c0f810cbf45ac7029c165.tar.xz
syslinux.git-7de02ddf8887f37a5e3c0f810cbf45ac7029c165.zip
Don't initialize the E820 map statically -- it's too big
Diffstat (limited to 'memdisk/e820func.c')
-rw-r--r--memdisk/e820func.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/memdisk/e820func.c b/memdisk/e820func.c
index 72e1bf80..d9c8465a 100644
--- a/memdisk/e820func.c
+++ b/memdisk/e820func.c
@@ -22,8 +22,17 @@
#define MAXRANGES 64
/* All of memory starts out as one range of "indeterminate" type */
-struct e820range ranges[MAXRANGES] = { { 0ULL, 0 }, { 0ULL, (uint32_t)-1 } };
-int nranges = 1;
+struct e820range ranges[MAXRANGES];
+int nranges;
+
+
+void e820map_init(void)
+{
+ nranges = 1;
+ asm volatile("cld ; rep ; stosl %0,%%es:(%1)"
+ :: "a" (0), "S" (ranges), "c" (sizeof(ranges) >> 2));
+ ranges[1].type = -1;
+}
static void insertrange_at(int where, uint64_t start, uint32_t type)
{