efi: Support the efi command in the app

At present the 'efi' command only works in the EFI payload. Update it to
work in the app too, so the memory map can be examined.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
This commit is contained in:
Simon Glass
2022-01-04 03:51:12 -07:00
committed by Heinrich Schuchardt
parent ce1dc0cc17
commit 25a326b006
4 changed files with 82 additions and 16 deletions

View File

@@ -610,4 +610,19 @@ int efi_store_memory_map(struct efi_priv *priv);
*/
int efi_call_exit_boot_services(void);
/**
* efi_get_mmap() - Get the memory map from EFI
*
* This is used in the app. The caller must free *@descp when done
*
* @descp: Returns allocated pointer to EFI memory map table
* @sizep: Returns size of table in bytes
* @keyp: Returns memory-map key
* @desc_sizep: Returns size of each @desc_base record
* @versionp: Returns version number of memory map
* @return 0 on success, -ve on error
*/
int efi_get_mmap(struct efi_mem_desc **descp, int *sizep, uint *keyp,
int *desc_sizep, uint *versionp);
#endif /* _LINUX_EFI_H */