Commit a44bffcc9557cf5f761a43bce44a59fa85feab2a

Authored by xypron.glpk@gmx.de
Committed by Alexander Graf
1 parent aee4f06dff

efi_loader: use EFI_PAGE_SIZE instead of 4096

We should use constant EFI_PAGE_SIZE instead of 4096 where the
coding relies on 4096 being EFI_PAGE_SIZE.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

Showing 1 changed file with 2 additions and 2 deletions Side-by-side Diff

... ... @@ -158,7 +158,7 @@
158 158 }
159 159  
160 160 /* Give us at least 4kb breathing room */
161   - fdt_size = ALIGN(fdt_size + 4096, 4096);
  161 + fdt_size = ALIGN(fdt_size + 4096, EFI_PAGE_SIZE);
162 162 fdt_pages = fdt_size >> EFI_PAGE_SHIFT;
163 163  
164 164 /* Safe fdt location is at 128MB */
... ... @@ -166,7 +166,7 @@
166 166 if (efi_allocate_pages(1, EFI_BOOT_SERVICES_DATA, fdt_pages,
167 167 &new_fdt_addr) != EFI_SUCCESS) {
168 168 /* If we can't put it there, put it somewhere */
169   - new_fdt_addr = (ulong)memalign(4096, fdt_size);
  169 + new_fdt_addr = (ulong)memalign(EFI_PAGE_SIZE, fdt_size);
170 170 if (efi_allocate_pages(1, EFI_BOOT_SERVICES_DATA, fdt_pages,
171 171 &new_fdt_addr) != EFI_SUCCESS) {
172 172 printf("ERROR: Failed to reserve space for FDT\n");