
On 2/8/21 11:18 PM, Heinrich Schuchardt wrote:
On 2/8/21 1:52 PM, Jose Marinho wrote:
The ESRT is initialised during efi_init_objlist after efi_initialize_system_table().
The ESRT is initially created with size for 50 FW image entries. The ESRT is resized when it runs out of space. Every resize adds 50 additional entries. The ESRT is populated from information provided by FMP instances only.
Signed-off-by: Jose Marinhojose.marinho@arm.com
<josem> one limitation is, if any FMP instance is installed and then uninstalled during the same boottime flow, the ESRT entries will not be removed <josem> this limitation is because I cannot find a proper UEFI way to hook to a FMP protocol uninstall. <xypron> register an event with RegisterProtocolNotify(). <xypron> EFI_CALL(efi_register_protocol_notify(...)) after exporting the function in /include/efi_loader <xypron> The event can be created with efi_create_event().
RegisterProtocolNotifiy() only tells you that a protocol is newly installed, or reinstalled.
If you open the protocol with EFI_OPEN_PROTOCOL_BY_DRIVER, than EFI_BOOT_SERVICES.UninstallProtocolInterface() will call EFI_BOOT_SERVICES.DisconnectController() for the driver which will end up in calling the Stop() function of the driver binding protocol.
Instead of using RegisterProtocolNotifiy() it would be better if the FMP driver would call ConnectController() after installing its protocol.
This project is gone to show you all delights of EFI driver development.
Best regards
Heinrich