From: Abdellatif El Khlifi <[email protected]>

Provide a weak function that can be overridden

Some boards need to perform custom actions on ExitBootService()
related to FWU. This function can be overridden by the board.

Signed-off-by: Abdellatif El Khlifi <[email protected]>
Cc: Sughosh Ganu <[email protected]>
Cc: Tom Rini <[email protected]>
Cc: Ilias Apalodimas <[email protected]>
Cc: Simon Glass <[email protected]>
Cc: Michal Simek <[email protected]>
Cc: Marek Vasut <[email protected]>
Cc: Casey Connolly <[email protected]>

---

Changelog of changes:
===========================

v4:

* Update the function headers in fwu_arm_psa.c to pass kernel-doc tests

v1:

* Adding the feature

 lib/fwu_updates/fwu_arm_psa.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/lib/fwu_updates/fwu_arm_psa.c b/lib/fwu_updates/fwu_arm_psa.c
index 9ae40775ff0..98108f8418c 100644
--- a/lib/fwu_updates/fwu_arm_psa.c
+++ b/lib/fwu_updates/fwu_arm_psa.c
@@ -1210,6 +1210,19 @@ static bool fwu_all_images_accepted(const struct 
fwu_data *fwu_data)
        return true;
 }
 
+/**
+ * fwu_notify_exit_boot_services() - FWU notification handler
+ *
+ * Description: Some boards need to perform custom actions on ExitBootService()
+ * related to FWU. This function can be overridden by the board.
+ *
+ * Return: EFI_SUCCESS on success. Otherwise, failure.
+ */
+efi_status_t __weak fwu_notify_exit_boot_services(void)
+{
+       return EFI_SUCCESS;
+}
+
 /**
  * fwu_accept_notify_exit_boot_services() - ExitBootServices callback
  *
@@ -1248,6 +1261,8 @@ static void EFIAPI 
fwu_accept_notify_exit_boot_services(struct efi_event *event,
        }
 
 out:
+       fwu_notify_exit_boot_services();
+
        EFI_EXIT(efi_ret);
 }
 
-- 
2.43.0

Reply via email to