diff options
author | emaste <emaste@FreeBSD.org> | 2016-01-07 02:42:56 +0000 |
---|---|---|
committer | emaste <emaste@FreeBSD.org> | 2016-01-07 02:42:56 +0000 |
commit | 61ad3780d61ddc78be22d49696bbb6d0e3f29654 (patch) | |
tree | 8e4fc4638072888afe18ccdfb0d461efd7da5069 /sys/boot/efi/loader | |
parent | c680da735e2eba73062b4caced26b2eb3379a27c (diff) | |
download | FreeBSD-src-61ad3780d61ddc78be22d49696bbb6d0e3f29654.zip FreeBSD-src-61ad3780d61ddc78be22d49696bbb6d0e3f29654.tar.gz |
MFC r288372: Use EFI page size constants instead of hardcoding 4096
Diffstat (limited to 'sys/boot/efi/loader')
-rw-r--r-- | sys/boot/efi/loader/copy.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/boot/efi/loader/copy.c b/sys/boot/efi/loader/copy.c index 1e54418..a7d6bf1 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; return (0); } @@ -114,7 +114,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++; |