[lib][uefi] Make exit_boot_service weak link

This allows different platforms to provide their own implementation
of exit_boot_service
This commit is contained in:
Kelvin Zhang
2025-04-28 17:35:47 -07:00
parent 0ac0911404
commit 27696ee6c2
2 changed files with 11 additions and 5 deletions

View File

@@ -28,6 +28,7 @@
#include "protocols/dt_fixup_protocol.h"
#include "protocols/gbl_efi_os_configuration_protocol.h"
#include "protocols/loaded_image_protocol.h"
#include <lk/compiler.h>
#include "switch_stack.h"
#include "types.h"
@@ -36,6 +37,11 @@
#include <string.h>
#include <sys/types.h>
__WEAK EfiStatus exit_boot_services(EfiHandle image_handle, size_t map_key) {
printf("%s is called\n", __FUNCTION__);
return SUCCESS;
}
namespace {
EfiStatus unload(EfiHandle handle) { return SUCCESS; }
@@ -164,11 +170,6 @@ EfiStatus install_configuration_table(const EfiGuid *guid, void *table) {
return UNSUPPORTED;
}
EfiStatus exit_boot_services(EfiHandle image_handle, size_t map_key) {
printf("%s is called\n", __FUNCTION__);
return SUCCESS;
}
void copy_mem(void *dest, const void *src, size_t len) {
memcpy(dest, src, len);
}

View File

@@ -121,4 +121,9 @@ struct EFI_LOADED_IMAGE_PROTOCOL {
static constexpr size_t EFI_LOADED_IMAGE_PROTOCOL_REVISION = 0x1000;
// This function would be called from GBL before jumping into android kernel
// LK provides a default no-op implementation that is weakly linked,
// different platforms can override with their own implementation.
EfiStatus exit_boot_services(EfiHandle image_handle, size_t map_key);
#endif