diff options
| author | Sughosh Ganu <[email protected]> | 2024-10-15 21:07:07 +0530 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2024-10-15 13:45:29 -0600 |
| commit | 2f6191526a1325b6ddb59795a093eca69dbf8976 (patch) | |
| tree | 8f50f00ee55466956045e92ce95641b4fd78c47c /include | |
| parent | 22f2c9ed9f533a56bed09bd4e0e37852b6b9f3b1 (diff) | |
lmb: notify of any changes to the LMB memory map
In U-Boot, LMB and EFI are two primary modules who provide memory
allocation and reservation API's. Both these modules operate with the
same regions of memory for allocations. Use the LMB memory map update
event to notify other interested listeners about a change in it's
memory map. This can then be used by the other module to keep track of
available and used memory.
There is no need to send these notifications when the LMB module is
being unit-tested. Add a flag to the lmb structure to indicate if the
memory map is being used for tests, and suppress sending any
notifications when running these unit tests.
Signed-off-by: Sughosh Ganu <[email protected]>
Diffstat (limited to 'include')
| -rw-r--r-- | include/efi_loader.h | 14 | ||||
| -rw-r--r-- | include/lmb.h | 2 |
2 files changed, 16 insertions, 0 deletions
diff --git a/include/efi_loader.h b/include/efi_loader.h index 511281e150e..ac203957181 100644 --- a/include/efi_loader.h +++ b/include/efi_loader.h @@ -784,6 +784,20 @@ efi_status_t efi_get_memory_map(efi_uintn_t *memory_map_size, uint32_t *descriptor_version); /* Adds a range into the EFI memory map */ efi_status_t efi_add_memory_map(u64 start, u64 size, int memory_type); + +/** + * efi_add_memory_map_pg() - add pages to the memory map + * + * @start: start address, must be a multiple of EFI_PAGE_SIZE + * @pages: number of pages to add + * @memory_type: type of memory added + * @overlap_only_ram: region may only overlap RAM + * Return: status code + */ +efi_status_t efi_add_memory_map_pg(u64 start, u64 pages, + int memory_type, + bool overlap_only_ram); + /* Adds a conventional range into the EFI memory map */ efi_status_t efi_add_conventional_memory_map(u64 ram_start, u64 ram_end, u64 ram_top); diff --git a/include/lmb.h b/include/lmb.h index ec477c1f51d..837002121d9 100644 --- a/include/lmb.h +++ b/include/lmb.h @@ -46,10 +46,12 @@ struct lmb_region { * * @free_mem: List of free memory regions * @used_mem: List of used/reserved memory regions + * @test: Is structure being used for LMB tests */ struct lmb { struct alist free_mem; struct alist used_mem; + bool test; }; /** |
