@@ -1677,7 +1677,7 @@ module = {
module = {
name = fdt;
- arm64 = loader/arm64/fdt.c;
+ arm64 = loader/efi/fdt.c;
common = lib/fdt.c;
enable = fdt;
};
@@ -26,11 +26,12 @@
#include <grub/mm.h>
#include <grub/types.h>
#include <grub/cpu/linux.h>
-#include <grub/cpu/fdtload.h>
#include <grub/efi/efi.h>
+#include <grub/efi/fdtload.h>
#include <grub/efi/pe32.h>
#include <grub/i18n.h>
#include <grub/lib/cmdline.h>
+#include <grub/machine/memory.h>
GRUB_MOD_LICENSE ("GPLv3+");
@@ -27,12 +27,13 @@
#include <grub/misc.h>
#include <grub/mm.h>
#include <grub/types.h>
-#include <grub/cpu/fdtload.h>
#include <grub/cpu/linux.h>
#include <grub/efi/efi.h>
+#include <grub/efi/fdtload.h>
#include <grub/efi/pe32.h> /* required by struct xen_hypervisor_header */
#include <grub/i18n.h>
#include <grub/lib/cmdline.h>
+#include <grub/machine/memory.h>
GRUB_MOD_LICENSE ("GPLv3+");
similarity index 93%
rename from grub-core/loader/arm64/fdt.c
rename to grub-core/loader/efi/fdt.c
@@ -18,12 +18,13 @@
#include <grub/fdt.h>
#include <grub/mm.h>
-#include <grub/cpu/fdtload.h>
#include <grub/err.h>
#include <grub/dl.h>
#include <grub/command.h>
#include <grub/file.h>
#include <grub/efi/efi.h>
+#include <grub/efi/fdtload.h>
+#include <grub/machine/memory.h>
static void *loaded_fdt;
static void *fdt;
@@ -32,12 +33,12 @@ void *
grub_fdt_load (grub_size_t additional_size)
{
void *raw_fdt;
- grub_size_t size;
+ unsigned int size;
if (fdt)
{
size = GRUB_EFI_BYTES_TO_PAGES (grub_fdt_get_totalsize (fdt));
- grub_efi_free_pages ((grub_efi_physical_address_t) fdt, size);
+ grub_efi_free_pages ((grub_addr_t) fdt, size);
}
if (loaded_fdt)
@@ -49,7 +50,7 @@ grub_fdt_load (grub_size_t additional_size)
raw_fdt ? grub_fdt_get_totalsize (raw_fdt) : GRUB_FDT_EMPTY_TREE_SZ;
size += additional_size;
- grub_dprintf ("linux", "allocating %ld bytes for fdt\n", size);
+ grub_dprintf ("linux", "allocating %d bytes for fdt\n", size);
fdt = grub_efi_allocate_pages (0, GRUB_EFI_BYTES_TO_PAGES (size));
if (!fdt)
return NULL;
@@ -88,7 +89,7 @@ grub_fdt_unload (void) {
if (!fdt) {
return;
}
- grub_efi_free_pages ((grub_efi_physical_address_t) fdt,
+ grub_efi_free_pages ((grub_addr_t) fdt,
GRUB_EFI_BYTES_TO_PAGES (grub_fdt_get_totalsize (fdt)));
fdt = NULL;
}
@@ -3,4 +3,7 @@
#define GRUB_EFI_MAX_USABLE_ADDRESS 0xffffffffffffULL
+#define GRUB_EFI_PAGE_SHIFT 12
+#define GRUB_EFI_BYTES_TO_PAGES(bytes) (((bytes) + 0xfff) >> GRUB_EFI_PAGE_SHIFT)
+
#endif /* ! GRUB_MEMORY_CPU_HEADER */
similarity index 89%
rename from include/grub/arm64/fdtload.h
rename to include/grub/efi/fdtload.h
@@ -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