aboutsummaryrefslogtreecommitdiffstats
path: root/com32/lib/syslinux/memmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'com32/lib/syslinux/memmap.c')
-rw-r--r--com32/lib/syslinux/memmap.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/com32/lib/syslinux/memmap.c b/com32/lib/syslinux/memmap.c
index 5a0a34f7..c5f1b251 100644
--- a/com32/lib/syslinux/memmap.c
+++ b/com32/lib/syslinux/memmap.c
@@ -46,6 +46,7 @@ struct e820_entry {
uint64_t start;
uint64_t len;
uint32_t type;
+ uint32_t extattr;
};
struct syslinux_memmap *syslinux_memory_map(void)
@@ -74,7 +75,7 @@ struct syslinux_memmap *syslinux_memory_map(void)
ireg.eax.l = 0xe820;
ireg.edx.l = 0x534d4150;
ireg.ebx.l = 0;
- ireg.ecx.l = 20;
+ ireg.ecx.l = sizeof(*e820buf);
ireg.es = SEG(e820buf);
ireg.edi.w[0] = OFFS(e820buf);
@@ -86,6 +87,12 @@ struct syslinux_memmap *syslinux_memory_map(void)
(oreg.ecx.l < 20))
break;
+ if (oreg.ecx.l >= 24)
+ e820buf->extattr = 1; /* Enabled, normal */
+
+ if (!(e820buf->extattr & 1))
+ continue;
+
type = e820buf->type == 1 ? SMT_FREE : SMT_RESERVED;
start = e820buf->start;
len = e820buf->len;