summaryrefslogtreecommitdiffstats
path: root/sys/boot/ia64
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2004-11-28 00:26:11 +0000
committermarcel <marcel@FreeBSD.org>2004-11-28 00:26:11 +0000
commit1fb788a6b0ec8d65f1a089a5f2fdbe6b6832951e (patch)
tree0096a2e60eb2b1c7e760840e450b74f411e41136 /sys/boot/ia64
parenta14ee64402891d9c36e916ce17b01895b7ca2794 (diff)
downloadFreeBSD-src-1fb788a6b0ec8d65f1a089a5f2fdbe6b6832951e.zip
FreeBSD-src-1fb788a6b0ec8d65f1a089a5f2fdbe6b6832951e.tar.gz
Add efimd.c. This file contains MD code used by the EFI library. While
changing the Makefile, fail the creation of loader.efi when there are unresolved symbols in loader.sym. This avoids silently creating a faulty EFI binary.
Diffstat (limited to 'sys/boot/ia64')
-rw-r--r--sys/boot/ia64/efi/Makefile9
-rw-r--r--sys/boot/ia64/efi/efimd.c40
2 files changed, 47 insertions, 2 deletions
diff --git a/sys/boot/ia64/efi/Makefile b/sys/boot/ia64/efi/Makefile
index 7c2f631..a3b126f 100644
--- a/sys/boot/ia64/efi/Makefile
+++ b/sys/boot/ia64/efi/Makefile
@@ -2,7 +2,7 @@
PROG= loader.sym
INTERNALPROG=
-SRCS= conf.c dev_net.c main.c start.S vers.c
+SRCS= conf.c dev_net.c efimd.c main.c start.S vers.c
NOMAN=
CFLAGS+= -DLOADER
@@ -47,11 +47,16 @@ vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version
sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
OBJCOPY?= objcopy
+OBJDUMP?= objdump
loader.efi: loader.sym
+ if [ `${OBJDUMP} -t ${.ALLSRC} | fgrep '*UND*' | wc -l` != 0 ]; then \
+ ${OBJDUMP} -t ${.ALLSRC} | fgrep '*UND*'; \
+ exit 1; \
+ fi
${OBJCOPY} -j .data -j .dynamic -j .dynstr -j .dynsym -j .hash \
-j .rela.dyn -j .reloc -j .sdata -j .text \
- --target=efi-app-${MACHINE_ARCH} loader.sym loader.efi
+ --target=efi-app-${MACHINE_ARCH} ${.ALLSRC} ${.TARGET}
loader.help: help.common
cat ${.ALLSRC} | awk -f ${.CURDIR}/../../common/merge_help.awk \
diff --git a/sys/boot/ia64/efi/efimd.c b/sys/boot/ia64/efi/efimd.c
new file mode 100644
index 0000000..1ff4090
--- /dev/null
+++ b/sys/boot/ia64/efi/efimd.c
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2004 Marcel Moolenaar
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <efi.h>
+#include <efilib.h>
+
+#include <machine/vmparam.h>
+
+EFI_PHYSICAL_ADDRESS
+efimd_va2pa(EFI_VIRTUAL_ADDRESS va)
+{
+
+ return (IA64_RR_MASK(va));
+}
OpenPOWER on IntegriCloud