blob: 7fa63814e39a6ae11e99ac45ba0c289d73833826 [file] [edit]
/*
* Copyright (c) 2026 The Fuchsia Authors
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <common.h>
#include <efi_loader.h>
#include <gbl_efi_debug_protocol.h>
static efi_status_t EFIAPI fatal_error(struct GblEfiDebugProtocol *self,
const void *frame_ptr,
GblEfiDebugErrorTag tag)
{
EFI_ENTRY("%p, %p, %llu", self, frame_ptr, tag);
printf("GBL FATAL ERROR: tag %llu, frame_ptr %p\n", tag, frame_ptr);
return EFI_EXIT(EFI_SUCCESS);
}
static const efi_guid_t guid = EFI_GUID(0x98ca3da1, 0xc1ac, 0x4402, 0x9c, 0x16,
0x75, 0x58, 0xd3, 0xed, 0x57, 0x05);
static GblEfiDebugProtocol protocol = {
.revision = GBL_EFI_DEBUG_PROTOCOL_REVISION,
.fatal_error = fatal_error,
};
efi_status_t efi_gbl_debug_register(void)
{
efi_status_t ret = efi_add_protocol(efi_root, &guid, (void *)&protocol);
if (ret != EFI_SUCCESS)
printf("Cannot install GBL_EFI_DEBUG_PROTOCOL\n");
return ret;
}