summaryrefslogtreecommitdiffstats
path: root/sys/boot/ia64/common
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2002-04-19 06:43:09 +0000
committermarcel <marcel@FreeBSD.org>2002-04-19 06:43:09 +0000
commitb37c8f0b41c9ea94963b3e1a8e0b8e0c2094a4c6 (patch)
tree8de1c84c45e7ef741724ec192fb2a725446cdab3 /sys/boot/ia64/common
parent394d9d65e369665fe083d7e8e072ccc667d7175d (diff)
downloadFreeBSD-src-b37c8f0b41c9ea94963b3e1a8e0b8e0c2094a4c6.zip
FreeBSD-src-b37c8f0b41c9ea94963b3e1a8e0b8e0c2094a4c6.tar.gz
Allocate sufficient pages to hold the bootinfo block and stop
hardwiring the location.
Diffstat (limited to 'sys/boot/ia64/common')
-rw-r--r--sys/boot/ia64/common/exec.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/sys/boot/ia64/common/exec.c b/sys/boot/ia64/common/exec.c
index 1d99d72..c98f93c 100644
--- a/sys/boot/ia64/common/exec.c
+++ b/sys/boot/ia64/common/exec.c
@@ -148,20 +148,23 @@ elf_exec(struct preloaded_file *fp)
return(EFTYPE); /* XXX actually EFUCKUP */
hdr = (Elf_Ehdr *)&(md->md_data);
- printf("Entering %s at 0x%lx...\n", fp->f_name, hdr->e_entry);
+ status = BS->AllocatePages(AllocateAnyPages, EfiLoaderData,
+ EFI_SIZE_TO_PAGES(sizeof(struct bootinfo)), (void*)&bi);
+ if (EFI_ERROR(status)) {
+ printf("unable to create bootinfo block (status=0x%lx)\n",
+ (long)status);
+ return (ENOMEM);
+ }
- /*
- * Ugly hack, similar to linux. Dump the bootinfo into a
- * special page reserved in the link map.
- */
- bi = (struct bootinfo *) 0x508000;
bzero(bi, sizeof(struct bootinfo));
bi_load(bi, fp, &mapkey);
+ printf("Entering %s at 0x%lx...\n", fp->f_name, hdr->e_entry);
+
status = BS->ExitBootServices(IH, mapkey);
if (EFI_ERROR(status)) {
printf("ExitBootServices returned 0x%lx\n", status);
- return;
+ return (EINVAL);
}
psr = disable_ic();
OpenPOWER on IntegriCloud