[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:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user