|
iPXE
|
Flattened Device Tree memory map. More...
#include <stdint.h>#include <string.h>#include <errno.h>#include <assert.h>#include <byteswap.h>#include <ipxe/uaccess.h>#include <ipxe/memmap.h>#include <ipxe/io.h>#include <ipxe/fdt.h>#include <ipxe/fdtmem.h>Go to the source code of this file.
Macros | |
| #define | FDTMEM_MAX32 0xffffffff |
| Maximum 32-bit physical address. More... | |
Functions | |
| FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
| size_t | ABS_SYMBOL (_memsz) |
| Total in-memory size (calculated by linker) More... | |
| size_t | ABS_SYMBOL (_max_align) |
| Relocation required alignment (defined by prefix or linker) More... | |
| static int | fdtmem_update_node (struct memmap_region *region, struct fdt *fdt, unsigned int offset, const char *match, unsigned int flags) |
| Update memory region descriptor based on device tree node. More... | |
| static int | fdtmem_update_tree (struct memmap_region *region, struct fdt *fdt) |
| Update memory region descriptor based on device tree. More... | |
| static void | fdtmem_describe (uint64_t min, uint64_t max, struct fdt *fdt, struct memmap_region *region) |
| Describe memory region. More... | |
| static size_t | fdtmem_len (struct fdt *fdt) |
| Get length for copy of iPXE and device tree. More... | |
| physaddr_t | fdtmem_relocate (struct fdt_header *hdr, physaddr_t max) |
| Find a relocation address for iPXE. More... | |
| int | fdtmem_register (struct fdt_header *hdr, physaddr_t max) |
| Copy and register system device tree. More... | |
| static void | fdtmem_describe_region (uint64_t min, int hide, struct memmap_region *region) |
| Describe memory region from system memory map. More... | |
| PROVIDE_MEMMAP (fdt, memmap_describe, fdtmem_describe_region) | |
| PROVIDE_MEMMAP_INLINE (fdt, memmap_sync) | |
Variables | |
| char | _prefix [] |
| Start address of the iPXE image. More... | |
| char | _end [] |
| End address of the iPXE image. More... | |
| static size_t | memsz = ABS_VALUE_INIT ( _memsz ) |
| static size_t | max_align = ABS_VALUE_INIT ( _max_align ) |
| struct used_region fdtmem_used | __used_region |
| In-use memory region for iPXE and system device tree copy. More... | |
| static physaddr_t | fdtmem_max |
| Maximum accessible physical address. More... | |
Flattened Device Tree memory map.
Definition in file fdtmem.c.
| #define FDTMEM_MAX32 0xffffffff |
| FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
| size_t ABS_SYMBOL | ( | _memsz | ) |
Total in-memory size (calculated by linker)
| size_t ABS_SYMBOL | ( | _max_align | ) |
Relocation required alignment (defined by prefix or linker)
|
static |
Update memory region descriptor based on device tree node.
| region | Memory region of interest to be updated |
| fdt | Device tree |
| offset | Starting node offset |
| match | Required device type (or NULL) |
| flags | Region flags |
| rc | Return status code |
Definition at line 78 of file fdtmem.c.
References count, DBGC, desc, fdt_describe(), fdt_reg_address(), fdt_reg_cells(), fdt_reg_count(), fdt_reg_size(), fdt_string(), flags, index, MEMMAP_FL_RESERVED, memmap_update(), offset, rc, regs, size, start, strcmp(), and strerror().
Referenced by fdtmem_update_tree().
|
static |
Update memory region descriptor based on device tree.
| region | Memory region of interest to be updated |
| fdt | Device tree |
| rc | Return status code |
Definition at line 170 of file fdtmem.c.
References be64_to_cpu, DBGC, fdt_path(), fdtmem_update_node(), for_each_fdt_reservation, MEMMAP_FL_MEMORY, MEMMAP_FL_RESERVED, memmap_update(), NULL, offset, rc, fdt_reservation::size, fdt_reservation::start, and strerror().
Referenced by fdtmem_describe().
|
static |
Describe memory region.
| min | Minimum address |
| max | Maximum accessible physical address |
| fdt | Device tree |
| region | Region descriptor to fill in |
Definition at line 211 of file fdtmem.c.
References fdtmem_update_tree(), max, MEMMAP_FL_INACCESSIBLE, memmap_init(), memmap_update(), min, and NULL.
Referenced by fdtmem_describe_region(), and fdtmem_relocate().
Get length for copy of iPXE and device tree.
| fdt | Device tree |
| len | Total length |
Definition at line 233 of file fdtmem.c.
References assert(), FDT_MAX_ALIGN, fdt::len, len, memsz, and PAGE_SIZE.
Referenced by fdtmem_register(), and fdtmem_relocate().
| physaddr_t fdtmem_relocate | ( | struct fdt_header * | hdr, |
| physaddr_t | max | ||
| ) |
Find a relocation address for iPXE.
| hdr | FDT header |
| max | Maximum accessible physical address |
| new | New physical address for relocation |
Find a suitably aligned address towards the top of existent 32-bit memory to which iPXE may be relocated, along with a copy of the system device tree.
This function may be called very early in initialisation, before .data is writable or .bss has been zeroed. Neither this function nor any function that it calls may write to or rely upon the zero initialisation of any static variables.
Definition at line 264 of file fdtmem.c.
References _prefix, addr, assert(), DBGC, DBGC_MEMMAP, fdt_parse(), fdtmem_describe(), fdtmem_len(), FDTMEM_MAX32, hdr, fdt::len, len, max, memmap_region::max, max_align, MEMMAP_FL_RESERVED, MEMMAP_FL_USED, memmap_is_usable(), memmap_update(), memsz, memmap_region::min, next, old, rc, and strerror().
| int fdtmem_register | ( | struct fdt_header * | hdr, |
| physaddr_t | max | ||
| ) |
Copy and register system device tree.
| hdr | FDT header |
| max | Maximum accessible physical address |
| rc | Return status code |
Definition at line 345 of file fdtmem.c.
References _end, _prefix, assert(), DBGC, fdt_parse(), fdtmem_len(), fdtmem_max, hdr, fdt::len, max, memcpy(), memmap_dump_all(), memmap_use(), rc, strerror(), and sysfdt.
|
static |
Describe memory region from system memory map.
| min | Minimum address |
| hide | Hide in-use regions from the memory map |
| region | Region descriptor to fill in |
Definition at line 389 of file fdtmem.c.
References fdtmem_describe(), fdtmem_max, memmap_update_used(), min, and sysfdt.
| PROVIDE_MEMMAP | ( | fdt | , |
| memmap_describe | , | ||
| fdtmem_describe_region | |||
| ) |
| PROVIDE_MEMMAP_INLINE | ( | fdt | , |
| memmap_sync | |||
| ) |
| char _prefix[] |
Start address of the iPXE image.
Referenced by fdtmem_register(), and fdtmem_relocate().
| char _end[] |
End address of the iPXE image.
Referenced by fdtmem_register().
|
static |
Definition at line 51 of file fdtmem.c.
Referenced by com32_load_image(), com32_prepare_bounce_buffer(), comboot_prepare_segment(), fdtmem_len(), fdtmem_relocate(), multiboot_load_raw(), nbi_prepare_segment(), nbi_process_segments(), and prep_segment().
|
static |
Definition at line 55 of file fdtmem.c.
Referenced by fdtmem_relocate().
| struct used_region fdtmem_used __used_region |
|
static |
Maximum accessible physical address.
Definition at line 63 of file fdtmem.c.
Referenced by fdtmem_describe_region(), and fdtmem_register().
1.8.15