diff options
author | Shao Miller <shao.miller@yrdsb.edu.on.ca> | 2010-03-09 18:24:41 -0500 |
---|---|---|
committer | Shao Miller <shao.miller@yrdsb.edu.on.ca> | 2010-06-11 01:49:10 +0000 |
commit | 9d52e438f991e1d7667df6a5eead2e240b0164eb (patch) | |
tree | 0a5f77b9f0f338bf1f444b7b6819a0c88e575293 /memdisk | |
parent | 1a23222896a27d62a762042352e2f72472a1605d (diff) | |
download | syslinux-9d52e438f991e1d7667df6a5eead2e240b0164eb.tar.gz syslinux-9d52e438f991e1d7667df6a5eead2e240b0164eb.tar.xz syslinux-9d52e438f991e1d7667df6a5eead2e240b0164eb.zip |
memdisk: Force 32-bit mBFT "safe hook" pointer field
When mstructs.h is used by MDISKCHK.COM, pointers have
a 16-bit size and thus the mBFT structure sizeof() is
smaller under OpenWatcom. We now union this pointer
member with a uint32_t to force the field to at least
32 bits.
There is another pointer in this header file which is
already unioned with a uint32_t, due to that field's
dual-purpose. That field is fine under OpenWatcom.
Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
Diffstat (limited to 'memdisk')
-rw-r--r-- | memdisk/mstructs.h | 5 | ||||
-rw-r--r-- | memdisk/setup.c | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/memdisk/mstructs.h b/memdisk/mstructs.h index 47dffe95..e060aceb 100644 --- a/memdisk/mstructs.h +++ b/memdisk/mstructs.h @@ -106,7 +106,10 @@ struct mdi { MEMDISK_PACKED_PREFIX struct mBFT { struct acpi_description_header acpi; - struct safe_hook *safe_hook; /* "Safe hook" physical address */ + union { + struct safe_hook *ptr; + uint32_t phys_addr; + } safe_hook; /* "Safe hook" physical address */ struct mdi mdi; } MEMDISK_PACKED_POSTFIX; diff --git a/memdisk/setup.c b/memdisk/setup.c index a9ae63d0..ffaa2c66 100644 --- a/memdisk/setup.c +++ b/memdisk/setup.c @@ -1132,7 +1132,7 @@ void setup(const struct real_mode_args *rm_args_ptr) hptr->safe_hook.mBFT.ptr->acpi.signature[1] = 'B'; hptr->safe_hook.mBFT.ptr->acpi.signature[2] = 'F'; hptr->safe_hook.mBFT.ptr->acpi.signature[3] = 'T'; - hptr->safe_hook.mBFT.ptr->safe_hook = &hptr->safe_hook; + hptr->safe_hook.mBFT.ptr->safe_hook.ptr = &hptr->safe_hook; hptr->safe_hook.mBFT.ptr->acpi.checksum = -checksum_buf(hptr->safe_hook.mBFT.ptr, hptr->safe_hook.mBFT.ptr->acpi.length); |