mirror of
https://github.com/AsahiLinux/u-boot
synced 2025-02-18 06:58:54 +00:00
efi_loader: Keep memory mapping sorted when splitting an entry
The code assumes sorted mappings in descending address order. When splitting a mapping, insert the new part next to the current mapping. Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de> Reviewed-by: Alexander Graf <agraf@suse.de> Signed-off-by: Alexander Graf <agraf@suse.de>
This commit is contained in:
parent
b61d857b2f
commit
b6a9517275
1 changed files with 2 additions and 1 deletions
|
@ -135,7 +135,8 @@ static int efi_mem_carve_out(struct efi_mem_list *map,
|
|||
newmap->desc = map->desc;
|
||||
newmap->desc.physical_start = carve_start;
|
||||
newmap->desc.num_pages = (map_end - carve_start) >> EFI_PAGE_SHIFT;
|
||||
list_add_tail(&newmap->link, &efi_mem);
|
||||
/* Insert before current entry (descending address order) */
|
||||
list_add_tail(&newmap->link, &map->link);
|
||||
|
||||
/* Shrink the map to [ map_start ... carve_start ] */
|
||||
map_desc->num_pages = (carve_start - map_start) >> EFI_PAGE_SHIFT;
|
||||
|
|
Loading…
Add table
Reference in a new issue