From 83cd82c3c456ae4ee2836038d81b0bb1a8636608 Mon Sep 17 00:00:00 2001 From: dfr Date: Fri, 14 Sep 2001 08:26:00 +0000 Subject: [PATCH] Make this do the right thing (mostly). We should still reserve the pages that the kernel loads into using the EFI AllocatePages call. --- sys/boot/efi/libefi/copy.c | 18 +++++++++++++----- sys/boot/ia64/common/copy.c | 18 +++++++++++++----- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/sys/boot/efi/libefi/copy.c b/sys/boot/efi/libefi/copy.c index 01c31d88e4dd..a2bb6fea4e7d 100644 --- a/sys/boot/efi/libefi/copy.c +++ b/sys/boot/efi/libefi/copy.c @@ -31,8 +31,6 @@ static const char rcsid[] = /* * MD primitives supporting placement of module data - * - * XXX should check load address/size against memory top. */ #include @@ -43,19 +41,29 @@ static const char rcsid[] = int efi_copyin(void *src, vm_offset_t dest, size_t len) { - bcopy(src, (void*) dest, len); + EFI_PHYSICAL_ADDRESS p = IA64_RR_MASK(dest); +#if 0 + BS->AllocatePages(AllocateAddress, EfiRuntimeServicesData, + len >> 12, &p); +#endif + bcopy(src, (void*) p, len); return (len); } int efi_copyout(vm_offset_t src, void *dest, size_t len) { - bcopy((void*) src, dest, len); + bcopy((void*) IA64_RR_MASK(src), dest, len); return (len); } int efi_readin(int fd, vm_offset_t dest, size_t len) { - return (read(fd, (void*) dest, 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)); } diff --git a/sys/boot/ia64/common/copy.c b/sys/boot/ia64/common/copy.c index 01c31d88e4dd..a2bb6fea4e7d 100644 --- a/sys/boot/ia64/common/copy.c +++ b/sys/boot/ia64/common/copy.c @@ -31,8 +31,6 @@ static const char rcsid[] = /* * MD primitives supporting placement of module data - * - * XXX should check load address/size against memory top. */ #include @@ -43,19 +41,29 @@ static const char rcsid[] = int efi_copyin(void *src, vm_offset_t dest, size_t len) { - bcopy(src, (void*) dest, len); + EFI_PHYSICAL_ADDRESS p = IA64_RR_MASK(dest); +#if 0 + BS->AllocatePages(AllocateAddress, EfiRuntimeServicesData, + len >> 12, &p); +#endif + bcopy(src, (void*) p, len); return (len); } int efi_copyout(vm_offset_t src, void *dest, size_t len) { - bcopy((void*) src, dest, len); + bcopy((void*) IA64_RR_MASK(src), dest, len); return (len); } int efi_readin(int fd, vm_offset_t dest, size_t len) { - return (read(fd, (void*) dest, 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)); }