diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2008-12-28 21:37:27 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2008-12-28 21:37:27 -0500 |
commit | 4a754b38ee5f8fa9539e49033063b1854d32ae3e (patch) | |
tree | 9ef3bd7318e17dfee2d0d80e608873ce7c4b769e /src/pnpbios.c | |
parent | 4d7c37e12ef4ceb6903dd76ee700beb99fbf5f8e (diff) | |
download | qemu-seabios-4a754b38ee5f8fa9539e49033063b1854d32ae3e.tar.gz |
Add linker magic to ensure 16bit variables aren't repeated in 32bit code.
Add VAR16 macro to enable a variable to be available in both 32bit and
16bit code. This reduces the occurrences of "#if MODE16".
Also add ASM16 macro to reduce occurrences of "#if MODE16".
Diffstat (limited to 'src/pnpbios.c')
-rw-r--r-- | src/pnpbios.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/pnpbios.c b/src/pnpbios.c index 6f36a4a..21d140a 100644 --- a/src/pnpbios.c +++ b/src/pnpbios.c @@ -27,9 +27,8 @@ struct pnpheader { extern struct pnpheader PNPHEADER; extern const char pnp_string[]; -#if MODE16 -# if CONFIG_PNPBIOS -struct pnpheader PNPHEADER __aligned(16) VISIBLE16 = { +#if CONFIG_PNPBIOS +struct pnpheader PNPHEADER __aligned(16) VAR16 = { .signature = PNP_SIGNATURE, .version = 0x10, .length = sizeof(PNPHEADER), @@ -38,12 +37,11 @@ struct pnpheader PNPHEADER __aligned(16) VISIBLE16 = { .real_ds = SEG_BIOS, .prot_database = BUILD_BIOS_ADDR, }; -# else +#else // We need a copy of this string in the 0xf000 segment, but we are not // actually a PnP BIOS, so make sure it is *not* aligned, so OSes will // not see it if they scan. -const char pnp_string[] __aligned(2) VISIBLE16 = " $PnP"; -# endif +const char pnp_string[] __aligned(2) VAR16 = " $PnP"; #endif #define FUNCTION_NOT_SUPPORTED 0x82 |