From 013994166f910c9227904d67662d51a38d272876 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Wed, 20 May 2009 15:49:36 -0700 Subject: [PATCH] meminfo: distinguish between no flags and flags=1 For debugging reasons it's important to know if we have no flags at all or if we get flags = 1. Print [-] in the case of no flags at all. Signed-off-by: H. Peter Anvin --- com32/modules/meminfo.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/com32/modules/meminfo.c b/com32/modules/meminfo.c index 4f2b372..e88c824 100644 --- a/com32/modules/meminfo.c +++ b/com32/modules/meminfo.c @@ -1,6 +1,7 @@ /* ----------------------------------------------------------------------- * * * Copyright 2008 H. Peter Anvin - All Rights Reserved + * Copyright 2009 Intel Corporation; author: H. Peter Anvin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -64,12 +65,16 @@ static void dump_e820(void) memcpy(&ed, __com32.cs_bounce, sizeof ed); - if (oreg.ecx.l < 24) + if (oreg.ecx.l >= 24) { + /* ebx base length end type */ + printf("%8x %016llx %016llx %016llx %d [%x]", + ireg.ebx.l, ed.base, ed.len, ed.base+ed.len, ed.type, ed.extattr); + } else { + /* ebx base length end */ + printf("%8x %016llx %016llx %016llx %d [-]", + ireg.ebx.l, ed.base, ed.len, ed.base+ed.len, ed.type); ed.extattr = 1; - - /* ebx base length end 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])) -- 2.7.4