diff options
author | Ahmad Khalifa <ahmadkhalifa570@gmail.com> | 2024-05-14 19:40:06 +0000 |
---|---|---|
committer | Warner Losh <imp@FreeBSD.org> | 2024-09-20 14:45:08 +0000 |
commit | f8ca5d45c3c1829759ecd87cb95d53e5ab7d0811 (patch) | |
tree | 179353400abf9573a274df964c5041303d984e75 /stand/common | |
parent | 6818ff7797c6a9ab104e5d7e91d4e422874bf50d (diff) |
stand: Add support for 64-bit machines with 32-bit UEFI implementations
Some machines have 64-bit capable cpus but are stuck on 32-bit uefi
firmware.
Add support for them by building a new "loader_ia32" with
LOADER_DEFAULT_INTERP along with the 64-bit one. The loader
can be disabled using MK_LOADER_IA32.
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1098
Diffstat (limited to 'stand/common')
-rw-r--r-- | stand/common/bootstrap.h | 2 | ||||
-rw-r--r-- | stand/common/load_elf.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/stand/common/bootstrap.h b/stand/common/bootstrap.h index 09c4832f5855..ab1e5249fc2a 100644 --- a/stand/common/bootstrap.h +++ b/stand/common/bootstrap.h @@ -239,7 +239,7 @@ struct preloaded_file size_t f_size; /* file size */ struct kernel_module *f_modules; /* list of modules if any */ struct preloaded_file *f_next; /* next file */ -#ifdef __amd64__ +#if defined(__amd64__) || defined(__i386__) bool f_kernphys_relocatable; #endif #if defined(__i386__) diff --git a/stand/common/load_elf.c b/stand/common/load_elf.c index 8877e5f8b7e0..eaa6bef6ee86 100644 --- a/stand/common/load_elf.c +++ b/stand/common/load_elf.c @@ -217,7 +217,7 @@ static int elf_section_header_convert(const Elf_Ehdr *ehdr, Elf_Shdr *shdr) } #endif -#ifdef __amd64__ +#if defined(__amd64__) || defined(__i386__) static bool is_kernphys_relocatable(elf_file_t ef) { @@ -491,7 +491,7 @@ __elfN(loadfile_raw)(char *filename, uint64_t dest, /* Load OK, return module pointer */ *result = (struct preloaded_file *)fp; err = 0; -#ifdef __amd64__ +#if defined(__amd64__) || defined(__i386__) fp->f_kernphys_relocatable = multiboot || is_kernphys_relocatable(&ef); #endif #ifdef __i386__ |