aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaphael S. Carvalho <raphael.scarv@gmail.com>2013-10-17 19:05:32 -0300
committerH. Peter Anvin <hpa@linux.intel.com>2013-10-17 15:57:04 -0700
commit4ac63b5ac412d54462e292daf65a309775bc0448 (patch)
treeca6e0d060dd28a18f255c9adaff0302c87ab1f47
parent67aaaeeb22832a0b82e5043877d26d1a9602bf2a (diff)
downloadsyslinux-4ac63b5ac412d54462e292daf65a309775bc0448.tar.gz
syslinux-4ac63b5ac412d54462e292daf65a309775bc0448.tar.xz
syslinux-4ac63b5ac412d54462e292daf65a309775bc0448.zip
chain: Fix chainloading on 6.02
My commit 09f4ac33 broke 'com32/lib/syslinux/disk.c' __lowmem doesn't work for declarations outside the core. Using __lowmem outside the core wouldn't have the desired effect, then lmalloc must be used instead to store dapa into the correct section (".lowmem"). Reported-by: Dark Raven <drdarkraven@gmail.com> Signed-off-by: Raphael S. Carvalho <raphael.scarv@gmail.com> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
-rw-r--r--com32/lib/syslinux/disk.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/com32/lib/syslinux/disk.c b/com32/lib/syslinux/disk.c
index 0b0c737e..a824acc5 100644
--- a/com32/lib/syslinux/disk.c
+++ b/com32/lib/syslinux/disk.c
@@ -171,22 +171,28 @@ out:
static void *ebios_setup(const struct disk_info *const diskinfo, com32sys_t *inreg,
uint64_t lba, uint8_t count, uint8_t op_code)
{
- static __lowmem struct disk_ebios_dapa dapa;
+ static struct disk_ebios_dapa *dapa = NULL;
void *buf;
+ if (!dapa) {
+ dapa = lmalloc(sizeof *dapa);
+ if (!dapa)
+ return NULL;
+ }
+
buf = lmalloc(count * diskinfo->bps);
if (!buf)
return NULL;
- dapa.len = sizeof(dapa);
- dapa.count = count;
- dapa.off = OFFS(buf);
- dapa.seg = SEG(buf);
- dapa.lba = lba;
+ dapa->len = sizeof(*dapa);
+ dapa->count = count;
+ dapa->off = OFFS(buf);
+ dapa->seg = SEG(buf);
+ dapa->lba = lba;
inreg->eax.b[1] = op_code;
- inreg->esi.w[0] = OFFS(&dapa);
- inreg->ds = SEG(&dapa);
+ inreg->esi.w[0] = OFFS(dapa);
+ inreg->ds = SEG(dapa);
inreg->edx.b[0] = diskinfo->disk;
return buf;