Commit 083c6e24 authored by Leif Lindholm's avatar Leif Lindholm Committed by Daniel Kiper

arm64/efi: move EFI_PAGE definitions to efi/memory.h

The EFI page definitions and macros are generic and should not be confined
to arm64 headers - so move to efi/memory.h.
Also add EFI_PAGE_SIZE macro.

Update loader sources to reflect new header location.
Signed-off-by: default avatarLeif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: default avatarDaniel Kiper <daniel.kiper@oracle.com>
parent e5ba6b26
......@@ -28,6 +28,7 @@
#include <grub/cpu/linux.h>
#include <grub/efi/efi.h>
#include <grub/efi/fdtload.h>
#include <grub/efi/memory.h>
#include <grub/efi/pe32.h>
#include <grub/i18n.h>
#include <grub/lib/cmdline.h>
......
......@@ -30,6 +30,7 @@
#include <grub/cpu/linux.h>
#include <grub/efi/efi.h>
#include <grub/efi/fdtload.h>
#include <grub/efi/memory.h>
#include <grub/efi/pe32.h> /* required by struct xen_hypervisor_header */
#include <grub/i18n.h>
#include <grub/lib/cmdline.h>
......
......@@ -24,6 +24,7 @@
#include <grub/file.h>
#include <grub/efi/efi.h>
#include <grub/efi/fdtload.h>
#include <grub/efi/memory.h>
static void *loaded_fdt;
static void *fdt;
......
......@@ -29,7 +29,4 @@ grub_fdt_unload (void);
grub_err_t
grub_fdt_install (void);
#define GRUB_EFI_PAGE_SHIFT 12
#define GRUB_EFI_BYTES_TO_PAGES(bytes) (((bytes) + 0xfff) >> GRUB_EFI_PAGE_SHIFT)
#endif
......@@ -22,6 +22,13 @@
#include <grub/err.h>
#include <grub/types.h>
/* The term "page" in UEFI refers only to a 4 KiB-aligned 4 KiB size region of
memory. It is not concerned with underlying translation management concepts,
but only used as the granule for memory allocations. */
#define GRUB_EFI_PAGE_SHIFT 12
#define GRUB_EFI_PAGE_SIZE (1 << GRUB_EFI_PAGE_SHIFT)
#define GRUB_EFI_BYTES_TO_PAGES(bytes) (((bytes) + 0xfff) >> GRUB_EFI_PAGE_SHIFT)
#define GRUB_MMAP_REGISTER_BY_FIRMWARE 1
grub_err_t grub_machine_mmap_register (grub_uint64_t start, grub_uint64_t size,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment