Revert "boot/efi/x86: enable support for 64-bit ELF"

This reverts commit 5897f7b623.

See #17961 for additional information. This breaks the official
builds by growing the bios_ia32 loader too much.

Change-Id: I63bc0c95839ef681a260efdd6ddf527d6699c1f4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5704
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This commit is contained in:
Alexander von Gluck IV 2022-09-29 08:30:16 -05:00 committed by waddlesplash
parent b4a9a0c94f
commit c2dcf10676
3 changed files with 25 additions and 26 deletions

View File

@ -10,13 +10,15 @@ for platform in [ MultiBootSubDirSetup bios_ia32 efi pxe_ia32 ] {
DEFINES = $(defines) ;
DEFINES += _BOOT_MODE ;
if $(TARGET_BOOT_PLATFORM) = efi && $(TARGET_ARCH) = x86_64 {
DEFINES += BOOT_SUPPORT_ELF64 ;
if $(TARGET_BOOT_PLATFORM) = efi {
if $(TARGET_ARCH) = x86_64 {
DEFINES += BOOT_SUPPORT_ELF64 ;
} else {
DEFINES += BOOT_SUPPORT_ELF32 ;
}
} else {
DEFINES +=
BOOT_SUPPORT_ELF32
BOOT_SUPPORT_ELF64
;
DEFINES += BOOT_SUPPORT_ELF64 ;
DEFINES += BOOT_SUPPORT_ELF32 ;
}
local kernelArchSources =

View File

@ -61,16 +61,17 @@ for platform in [ MultiBootSubDirSetup ] {
;
if $(TARGET_BOOT_PLATFORM) != efi {
DEFINES += _BOOT_PLATFORM_BIOS ;
}
if $(TARGET_BOOT_PLATFORM) = efi && $(TARGET_ARCH) = x86_64 {
DEFINES += BOOT_SUPPORT_ELF64 ;
} else {
DEFINES +=
_BOOT_PLATFORM_BIOS
BOOT_SUPPORT_ELF32
BOOT_SUPPORT_ELF64
;
} else {
if $(TARGET_ARCH) = x86_64 {
DEFINES += BOOT_SUPPORT_ELF64 ;
} else {
DEFINES += BOOT_SUPPORT_ELF32 ;
}
}
}
case "sparc" :

View File

@ -130,7 +130,7 @@ struct ELF64Class {
AllocateRegion(AddrType* _address, AddrType size, uint8 protection,
void **_mappedAddress)
{
#if B_HAIKU_BITS == 32
#if defined(_BOOT_PLATFORM_BIOS)
// Assume the real 64-bit base address is KERNEL_LOAD_BASE_64_BIT and
// the mappings in the loader address space are at KERNEL_LOAD_BASE.
@ -145,30 +145,26 @@ struct ELF64Class {
return status;
*_mappedAddress = address;
addr_t result;
platform_bootloader_address_to_kernel_address(address, &result);
*_address = result;
#if B_HAIKU_BITS == 32
*_address += KERNEL_FIXUP_FOR_LONG_MODE;
#if defined(_BOOT_PLATFORM_BIOS)
*_address = (AddrType)(addr_t)address + KERNEL_FIXUP_FOR_LONG_MODE;
#else
platform_bootloader_address_to_kernel_address(address, _address);
#endif
return B_OK;
}
static inline void*
Map(AddrType _address)
Map(AddrType address)
{
addr_t address;
#if B_HAIKU_BITS == 32
address = _address - KERNEL_FIXUP_FOR_LONG_MODE;
#ifdef _BOOT_PLATFORM_BIOS
return (void*)(addr_t)(address - KERNEL_FIXUP_FOR_LONG_MODE);
#else
address = _address;
#endif
void *result;
if (platform_kernel_address_to_bootloader_address(address, &result) != B_OK) {
panic("Couldn't convert address %#" PRIx64 "\n", _address);
panic("Couldn't convert address %#" PRIx64, address);
}
return result;
#endif
}
};