Lines Matching +full:memory +full:- +full:map

1 // SPDX-License-Identifier: GPL-2.0
3 * Common EFI memory map functions.
19 * __efi_memmap_init - Common code for mapping the EFI memory map
20 * @data: EFI memory map data
23 * map the EFI memory map in efi.memmap based on how far into the boot
26 * During bootup EFI_MEMMAP_LATE in data->flags should be clear since we
35 struct efi_memory_map map; in __efi_memmap_init() local
38 phys_map = data->phys_map; in __efi_memmap_init()
40 if (data->flags & EFI_MEMMAP_LATE) in __efi_memmap_init()
41 map.map = memremap(phys_map, data->size, MEMREMAP_WB); in __efi_memmap_init()
43 map.map = early_memremap(phys_map, data->size); in __efi_memmap_init()
45 if (!map.map) { in __efi_memmap_init()
46 pr_err("Could not map the memory map! phys_map=%pa, size=0x%lx\n", in __efi_memmap_init()
47 &phys_map, data->size); in __efi_memmap_init()
48 return -ENOMEM; in __efi_memmap_init()
51 map.phys_map = data->phys_map; in __efi_memmap_init()
52 map.nr_map = data->size / data->desc_size; in __efi_memmap_init()
53 map.map_end = map.map + data->size; in __efi_memmap_init()
55 map.desc_version = data->desc_version; in __efi_memmap_init()
56 map.desc_size = data->desc_size; in __efi_memmap_init()
57 map.flags = data->flags; in __efi_memmap_init()
61 efi.memmap = map; in __efi_memmap_init()
67 * efi_memmap_init_early - Map the EFI memory map data structure
68 * @data: EFI memory map data
70 * Use early_memremap() to map the passed in EFI memory map and assign
80 data->flags = 0; in efi_memmap_init_early()
93 early_memunmap(efi.memmap.map, size); in efi_memmap_unmap()
95 memunmap(efi.memmap.map); in efi_memmap_unmap()
98 efi.memmap.map = NULL; in efi_memmap_unmap()
103 * efi_memmap_init_late - Map efi.memmap with memremap()
104 * @addr: Physical address of the new EFI memory map
105 * @size: Size in bytes of the new EFI memory map
107 * Setup a mapping of the EFI memory map using ioremap_cache(). This
116 * initialisation is complete as the fixmap space used to map the EFI
134 WARN_ON(efi.memmap.map); in efi_memmap_init_late()