summaryrefslogtreecommitdiffstats
path: root/sys/boot
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2015-09-29 15:49:53 +0000
committerjhb <jhb@FreeBSD.org>2015-09-29 15:49:53 +0000
commit91736e0038dbbc345d1b904eb7310f56932acc32 (patch)
tree82e32909fbcb7ea1faa24040fd6c8b9f2aa1d19d /sys/boot
parenteba92cd9052b7330c05411fe4c937afcb71f12bb (diff)
downloadFreeBSD-src-91736e0038dbbc345d1b904eb7310f56932acc32.zip
FreeBSD-src-91736e0038dbbc345d1b904eb7310f56932acc32.tar.gz
Use EFI page size constants instead of hardcoding 4096.
Reviewed by: emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D3692
Diffstat (limited to 'sys/boot')
-rw-r--r--sys/boot/efi/loader/copy.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/boot/efi/loader/copy.c b/sys/boot/efi/loader/copy.c
index 3d42d7e..716e9ea 100644
--- a/sys/boot/efi/loader/copy.c
+++ b/sys/boot/efi/loader/copy.c
@@ -41,7 +41,7 @@ __FBSDID("$FreeBSD$");
#define EFI_STAGING_SIZE 48
#endif
-#define STAGE_PAGES ((EFI_STAGING_SIZE) * 1024 * 1024 / 4096)
+#define STAGE_PAGES EFI_SIZE_TO_PAGES((EFI_STAGING_SIZE) * 1024 * 1024)
EFI_PHYSICAL_ADDRESS staging, staging_end;
int stage_offset_set = 0;
@@ -59,7 +59,7 @@ efi_copy_init(void)
(unsigned long)(status & EFI_ERROR_MASK));
return (status);
}
- staging_end = staging + STAGE_PAGES * 4096;
+ staging_end = staging + STAGE_PAGES * EFI_PAGE_SIZE;
#if defined(__aarch64__) || defined(__arm__)
/*
@@ -132,7 +132,7 @@ efi_copy_finish(void)
src = (uint64_t *)staging;
dst = (uint64_t *)(staging - stage_offset);
- last = (uint64_t *)(staging + STAGE_PAGES * EFI_PAGE_SIZE);
+ last = (uint64_t *)staging_end;
while (src < last)
*dst++ = *src++;
OpenPOWER on IntegriCloud