aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFeng Tang <feng.tang@intel.com>2010-06-30 14:33:13 +0800
committerFeng Tang <feng.tang@intel.com>2010-07-20 11:10:04 +0800
commit316e4ce6068bf53c3e5622f81f4de33443376f67 (patch)
tree36d6cc9befd91bad0e2f2d59f6531e3c1215fd89
parentf83c57717377fa74c89d27e72bf138d4265731fb (diff)
downloadsyslinux-316e4ce6068bf53c3e5622f81f4de33443376f67.tar.gz
syslinux-316e4ce6068bf53c3e5622f81f4de33443376f67.tar.xz
syslinux-316e4ce6068bf53c3e5622f81f4de33443376f67.zip
elflink: meminfo.c: change cs_bounce buf to lmalloc
-rw-r--r--com32/elflink/modules/meminfo.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/com32/elflink/modules/meminfo.c b/com32/elflink/modules/meminfo.c
index d5e3f380..db9718ae 100644
--- a/com32/elflink/modules/meminfo.c
+++ b/com32/elflink/modules/meminfo.c
@@ -44,27 +44,32 @@ static void dump_e820(void)
com32sys_t ireg, oreg;
struct e820_data ed;
uint32_t type;
+ void *low_ed;
+
+ low_ed = lmalloc(sizeof ed);
+ if (!low_ed)
+ return;
memset(&ireg, 0, sizeof ireg);
ireg.eax.w[0] = 0xe820;
ireg.edx.l = 0x534d4150;
ireg.ecx.l = sizeof(struct e820_data);
- ireg.edi.w[0] = OFFS(__com32.cs_bounce);
- ireg.es = SEG(__com32.cs_bounce);
+ ireg.edi.w[0] = OFFS(low_ed);
+ ireg.es = SEG(low_ed);
memset(&ed, 0, sizeof ed);
ed.extattr = 1;
do {
- memcpy(__com32.cs_bounce, &ed, sizeof ed);
+ memcpy(low_ed, &ed, sizeof ed);
__intcall(0x15, &ireg, &oreg);
if (oreg.eflags.l & EFLAGS_CF ||
oreg.eax.l != 0x534d4150 || oreg.ecx.l < 20)
break;
- memcpy(&ed, __com32.cs_bounce, sizeof ed);
+ memcpy(&ed, low_ed, sizeof ed);
if (oreg.ecx.l >= 24) {
/* ebx base length end type */
@@ -86,6 +91,8 @@ static void dump_e820(void)
ireg.ebx.l = oreg.ebx.l;
} while (ireg.ebx.l);
+
+ free(low_ed);
}
static void dump_legacy(void)