summaryrefslogtreecommitdiffstats
path: root/sys/boot/efi
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2004-11-28 00:30:22 +0000
committermarcel <marcel@FreeBSD.org>2004-11-28 00:30:22 +0000
commite1b8c62f9a07a70d857ae47db44a1272a23dfede (patch)
tree70853a6b174692d6235a0b0bf335930e223022ec /sys/boot/efi
parent1fb788a6b0ec8d65f1a089a5f2fdbe6b6832951e (diff)
downloadFreeBSD-src-e1b8c62f9a07a70d857ae47db44a1272a23dfede.zip
FreeBSD-src-e1b8c62f9a07a70d857ae47db44a1272a23dfede.tar.gz
o Introduce efimd_va2pa() to translate addresses in efi_copy{in|out}()
and efi_readin(). This removes MD code from copy.c. o Don't unconditionally add pal.S to SRCS. It's specific to ia64.
Diffstat (limited to 'sys/boot/efi')
-rw-r--r--sys/boot/efi/include/efilib.h2
-rw-r--r--sys/boot/efi/libefi/Makefile18
-rw-r--r--sys/boot/efi/libefi/copy.c33
3 files changed, 21 insertions, 32 deletions
diff --git a/sys/boot/efi/include/efilib.h b/sys/boot/efi/include/efilib.h
index 1e7b269..abd3e50 100644
--- a/sys/boot/efi/include/efilib.h
+++ b/sys/boot/efi/include/efilib.h
@@ -34,5 +34,7 @@ extern EFI_RUNTIME_SERVICES *RS;
void *efi_get_table(EFI_GUID *tbl);
void efi_main(EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *system_table);
+EFI_PHYSICAL_ADDRESS efimd_va2pa(EFI_VIRTUAL_ADDRESS);
+
EFI_STATUS main(int argc, CHAR16 *argv[]);
void exit(EFI_STATUS status);
diff --git a/sys/boot/efi/libefi/Makefile b/sys/boot/efi/libefi/Makefile
index c5b1e0f..c52ffc9 100644
--- a/sys/boot/efi/libefi/Makefile
+++ b/sys/boot/efi/libefi/Makefile
@@ -2,25 +2,25 @@
.PATH: ${.CURDIR}/../../../${MACHINE_ARCH}/${MACHINE_ARCH}
-LIB= efi
+LIB= efi
INTERNALLIB=
-SRCS= libefi.c efi_console.c time.c copy.c devicename.c module.c
-SRCS+= delay.c efifs.c efinet.c elf_freebsd.c bootinfo.c pal.S
+SRCS= bootinfo.c copy.c delay.c devicename.c efi_console.c efifs.c efinet.c \
+ elf_freebsd.c libefi.c module.c time.c
.if ${MACHINE_ARCH} == "ia64"
-SRCS+= efifpswa.c
+SRCS+= efifpswa.c pal.S
.endif
-CFLAGS+= -I${.CURDIR}/../include
-CFLAGS+= -I${.CURDIR}/../include/${MACHINE_ARCH}
-CFLAGS+= -I${.CURDIR}/../../../../lib/libstand
+CFLAGS+= -I${.CURDIR}/../include
+CFLAGS+= -I${.CURDIR}/../include/${MACHINE_ARCH}
+CFLAGS+= -I${.CURDIR}/../../../../lib/libstand
# Pick up the bootstrap header for some interface items
-CFLAGS+= -I${.CURDIR}/../../common
+CFLAGS+= -I${.CURDIR}/../../common
-.if defined(BOOT_DISK_DEBUG)
# Make the disk code more talkative
+.if defined(BOOT_DISK_DEBUG)
CFLAGS+= -DDISK_DEBUG
.endif
diff --git a/sys/boot/efi/libefi/copy.c b/sys/boot/efi/libefi/copy.c
index 7bc4edf..4b4b9bd 100644
--- a/sys/boot/efi/libefi/copy.c
+++ b/sys/boot/efi/libefi/copy.c
@@ -27,42 +27,29 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-/*
- * MD primitives supporting placement of module data
- */
-#include <stand.h>
-
#include <efi.h>
#include <efilib.h>
-#include <machine/ia64_cpu.h>
-#include <machine/vmparam.h>
+#include <stand.h>
int
-efi_copyin(void *src, vm_offset_t dest, size_t len)
+efi_copyin(void *src, vm_offset_t va, size_t len)
{
- EFI_PHYSICAL_ADDRESS p = IA64_RR_MASK(dest);
-#if 0
- BS->AllocatePages(AllocateAddress, EfiRuntimeServicesData,
- len >> 12, &p);
-#endif
- bcopy(src, (void*) p, len);
+
+ bcopy(src, (void *)efimd_va2pa(va), len);
return (len);
}
int
-efi_copyout(vm_offset_t src, void *dest, size_t len)
+efi_copyout(vm_offset_t va, void *dst, size_t len)
{
- bcopy((void*) IA64_RR_MASK(src), dest, len);
+
+ bcopy((void *)efimd_va2pa(va), dst, len);
return (len);
}
int
-efi_readin(int fd, vm_offset_t dest, size_t len)
+efi_readin(int fd, vm_offset_t va, size_t len)
{
- EFI_PHYSICAL_ADDRESS p = IA64_RR_MASK(dest);
-#if 0
- BS->AllocatePages(AllocateAddress, EfiRuntimeServicesData,
- len >> 12, &p);
-#endif
- return (read(fd, (void*) p, len));
+
+ return (read(fd, (void *)efimd_va2pa(va), len));
}
OpenPOWER on IntegriCloud