diff options
author | jhb <jhb@FreeBSD.org> | 2015-11-05 20:21:43 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2015-11-05 20:21:43 +0000 |
commit | 5d01b91c3622334d65149252896859a1f677668a (patch) | |
tree | c29ff870b25cf168927076af872676fdc668cda4 | |
parent | 66054dcdbaa093b7cfab4d887808d302fc7fbaa3 (diff) | |
download | FreeBSD-src-5d01b91c3622334d65149252896859a1f677668a.zip FreeBSD-src-5d01b91c3622334d65149252896859a1f677668a.tar.gz |
MFC 288372:
Use EFI page size constants instead of hardcoding 4096.
-rw-r--r-- | sys/boot/amd64/efi/copy.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/boot/amd64/efi/copy.c b/sys/boot/amd64/efi/copy.c index 705fb05..cd8b6da 100644 --- a/sys/boot/amd64/efi/copy.c +++ b/sys/boot/amd64/efi/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 @@ x86_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; return (0); } @@ -114,7 +114,7 @@ x86_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++; |