[fdtmem] Update to use the generic system memory map API

Provide an implementation of the system memory map API based on the
system device tree, excluding any memory outside the size of the
accessible physical address space and defining an in-use region to
cover the relocated copy of iPXE and the system device tree.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2025-05-14 22:30:13 +01:00
parent bab3d76717
commit 3f6ee95737
5 changed files with 150 additions and 147 deletions

View File

@@ -10,9 +10,25 @@
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
#include <stdint.h>
#include <ipxe/fdt.h>
extern physaddr_t fdtmem_relocate ( struct fdt_header *hdr, size_t limit );
extern int fdtmem_register ( struct fdt_header *hdr, size_t limit );
#ifdef MEMMAP_FDT
#define MEMMAP_PREFIX_fdt
#else
#define MEMMAP_PREFIX_fdt __fdt_
#endif
/**
* Synchronise in-use regions with the externally visible system memory map
*
*/
static inline __attribute__ (( always_inline )) void
MEMMAP_INLINE ( fdt, memmap_sync ) ( void ) {
/* Nothing to do */
}
struct fdt_header;
extern physaddr_t fdtmem_relocate ( struct fdt_header *hdr, physaddr_t max );
extern int fdtmem_register ( struct fdt_header *hdr, physaddr_t max );
#endif /* _IPXE_FDTMEM_H */

View File

@@ -124,6 +124,7 @@ struct used_region {
/* Include all architecture-independent ACPI API headers */
#include <ipxe/null_memmap.h>
#include <ipxe/fdtmem.h>
/* Include all architecture-dependent ACPI API headers */
#include <bits/memmap.h>