From 0d4600f607e19e5af14815bdf94143af4b70ff7f Mon Sep 17 00:00:00 2001 From: Sean Bruno Date: Fri, 14 Oct 2016 17:25:29 +0000 Subject: [PATCH] Update i386 build of loader.efi (but leave it disabled) so that we at least build it now. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D7801 --- sys/boot/efi/loader/arch/i386/efimd.c | 5 ++++- sys/boot/efi/loader/arch/i386/elf32_freebsd.c | 10 +++++++--- sys/boot/efi/loader/arch/i386/exec.c | 6 ++++++ targets/pseudo/userland/misc/Makefile.depend | 2 +- 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/sys/boot/efi/loader/arch/i386/efimd.c b/sys/boot/efi/loader/arch/i386/efimd.c index 01905e664fdd..8e1d850d82cc 100644 --- a/sys/boot/efi/loader/arch/i386/efimd.c +++ b/sys/boot/efi/loader/arch/i386/efimd.c @@ -48,7 +48,10 @@ static EFI_GUID hcdp_guid = HCDP_TABLE_GUID; static UINTN mapkey; -uint64_t +int ldr_bootinfo(struct bootinfo *, uint64_t *); +int ldr_enter(const char *); + +static uint64_t ldr_alloc(vm_offset_t va) { diff --git a/sys/boot/efi/loader/arch/i386/elf32_freebsd.c b/sys/boot/efi/loader/arch/i386/elf32_freebsd.c index b3a18d27d387..d3c42613108e 100644 --- a/sys/boot/efi/loader/arch/i386/elf32_freebsd.c +++ b/sys/boot/efi/loader/arch/i386/elf32_freebsd.c @@ -35,12 +35,16 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + #include "bootstrap.h" #include "../libi386/libi386.h" #include "../btx/lib/btxv86.h" extern void __exec(caddr_t addr, ...); - +extern int bi_load(char *args, vm_offset_t *modulep, vm_offset_t *kernendp); +extern int ldr_enter(const char *kernel); static int elf32_exec(struct preloaded_file *amp); static int elf32_obj_exec(struct preloaded_file *amp); @@ -72,14 +76,14 @@ elf32_exec(struct preloaded_file *fp) ehdr = (Elf_Ehdr *)&(md->md_data); efi_time_fini(); - err = bi_load(fp->f_args, &boothowto, &bootdev, &bootinfop, &modulep, &kernend); + err = bi_load(fp->f_args, &modulep, &kernend); if (err != 0) { efi_time_init(); return(err); } entry = ehdr->e_entry & 0xffffff; - printf("Start @ 0x%lx ...\n", entry); + printf("Start @ 0x%x ...\n", entry); ldr_enter(fp->f_name); diff --git a/sys/boot/efi/loader/arch/i386/exec.c b/sys/boot/efi/loader/arch/i386/exec.c index 579f5593b24b..12a367cda5c2 100644 --- a/sys/boot/efi/loader/arch/i386/exec.c +++ b/sys/boot/efi/loader/arch/i386/exec.c @@ -36,6 +36,12 @@ __FBSDID("$FreeBSD$"); uint32_t __base; struct __v86 __v86; +/* XXX - Needed a definition here to implicitly define exit(); do not remove. */ +static void +exit(int x) +{ +} + void __v86int() { diff --git a/targets/pseudo/userland/misc/Makefile.depend b/targets/pseudo/userland/misc/Makefile.depend index 19ede3238843..a4091cc1d76f 100644 --- a/targets/pseudo/userland/misc/Makefile.depend +++ b/targets/pseudo/userland/misc/Makefile.depend @@ -77,7 +77,7 @@ DIRDEPS.amd64+= \ DIRDEPS.arm= ${_sys_boot_fdt} ${_sys_boot_efi} DIRDEPS.arm64= ${_sys_boot_fdt} ${_sys_boot_efi} -DIRDEPS.i386= ${DIRDEPS.x86sys} sys/boot/efi/libefi +DIRDEPS.i386= ${DIRDEPS.x86sys} ${_sys_boot_efi} DIRDEPS.powerpc= ${_sys_boot_fdt} sys/boot/libstand32 sys/boot/ofw sys/boot/uboot DIRDEPS.pc98= sys/boot/libstand32 DIRDEPS.sparc64= sys/boot/ofw ${_sys_boot_zfs}