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 = $(defines) ;
DEFINES += _BOOT_MODE ; DEFINES += _BOOT_MODE ;
if $(TARGET_BOOT_PLATFORM) = efi && $(TARGET_ARCH) = x86_64 { if $(TARGET_BOOT_PLATFORM) = efi {
if $(TARGET_ARCH) = x86_64 {
DEFINES += BOOT_SUPPORT_ELF64 ; DEFINES += BOOT_SUPPORT_ELF64 ;
} else { } else {
DEFINES += DEFINES += BOOT_SUPPORT_ELF32 ;
BOOT_SUPPORT_ELF32 }
BOOT_SUPPORT_ELF64 } else {
; DEFINES += BOOT_SUPPORT_ELF64 ;
DEFINES += BOOT_SUPPORT_ELF32 ;
} }
local kernelArchSources = local kernelArchSources =

View File

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

View File

@ -130,7 +130,7 @@ struct ELF64Class {
AllocateRegion(AddrType* _address, AddrType size, uint8 protection, AllocateRegion(AddrType* _address, AddrType size, uint8 protection,
void **_mappedAddress) 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 // 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. // the mappings in the loader address space are at KERNEL_LOAD_BASE.
@ -145,30 +145,26 @@ struct ELF64Class {
return status; return status;
*_mappedAddress = address; *_mappedAddress = address;
#if defined(_BOOT_PLATFORM_BIOS)
addr_t result; *_address = (AddrType)(addr_t)address + KERNEL_FIXUP_FOR_LONG_MODE;
platform_bootloader_address_to_kernel_address(address, &result); #else
*_address = result; platform_bootloader_address_to_kernel_address(address, _address);
#if B_HAIKU_BITS == 32
*_address += KERNEL_FIXUP_FOR_LONG_MODE;
#endif #endif
return B_OK; return B_OK;
} }
static inline void* static inline void*
Map(AddrType _address) Map(AddrType address)
{ {
addr_t address; #ifdef _BOOT_PLATFORM_BIOS
#if B_HAIKU_BITS == 32 return (void*)(addr_t)(address - KERNEL_FIXUP_FOR_LONG_MODE);
address = _address - KERNEL_FIXUP_FOR_LONG_MODE;
#else #else
address = _address;
#endif
void *result; void *result;
if (platform_kernel_address_to_bootloader_address(address, &result) != B_OK) { 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; return result;
#endif
} }
}; };