aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-10-13 14:21:29 -0700
committerH. Peter Anvin <hpa@zytor.com>2008-10-13 14:21:29 -0700
commit50b496340e63a7d81c6033b739381af2858d8ac2 (patch)
tree2758fc4d726f7460ac46d9cb8753a3c277fa7bfc
parent3628c6485cdfc96d5fb9837af23d351a8d038391 (diff)
downloadsyslinux-elf-50b496340e63a7d81c6033b739381af2858d8ac2.tar.gz
syslinux-elf-50b496340e63a7d81c6033b739381af2858d8ac2.tar.xz
syslinux-elf-50b496340e63a7d81c6033b739381af2858d8ac2.zip
meminfo: update to deal with ACPI 3 and other braindamage
Add support for ACPI 3 and certain broken e820 implementations in the meminfo program. Some e820 implementations expect the buffer to remain the same between different invocations, despite the fact that there is absolutely no guarantee to that effect in the spec. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r--com32/modules/meminfo.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/com32/modules/meminfo.c b/com32/modules/meminfo.c
index 81678c5c..4f2b3725 100644
--- a/com32/modules/meminfo.c
+++ b/com32/modules/meminfo.c
@@ -25,6 +25,7 @@ struct e820_data {
uint64_t base;
uint64_t len;
uint32_t type;
+ uint32_t extattr;
} __attribute__((packed));
static const char * const e820_types[] = {
@@ -32,6 +33,7 @@ static const char * const e820_types[] = {
"reserved",
"ACPI reclaim",
"ACPI NVS",
+ "unusable",
};
static void dump_e820(void)
@@ -48,17 +50,26 @@ static void dump_e820(void)
ireg.edi.w[0] = OFFS(__com32.cs_bounce);
ireg.es = SEG(__com32.cs_bounce);
+ memset(&ed, 0, sizeof ed);
+ ed.extattr = 1;
+
do {
+ memcpy(__com32.cs_bounce, &ed, sizeof ed);
+
__intcall(0x15, &ireg, &oreg);
if (oreg.eflags.l & EFLAGS_CF ||
- oreg.eax.l != 0x534d4150)
+ oreg.eax.l != 0x534d4150 ||
+ oreg.ecx.l < 20)
break;
memcpy(&ed, __com32.cs_bounce, sizeof ed);
+ if (oreg.ecx.l < 24)
+ ed.extattr = 1;
+
/* ebx base length end type */
- printf("%8x %016llx %016llx %016llx %x",
- ireg.ebx.l, ed.base, ed.len, ed.base+ed.len, ed.type);
+ printf("%8x %016llx %016llx %016llx %d [%x]",
+ ireg.ebx.l, ed.base, ed.len, ed.base+ed.len, ed.type, ed.extattr);
type = ed.type - 1;
if (type < sizeof(e820_types)/sizeof(e820_types[0]))