From 96ff1a24a7474b91c44a3dcd6f3abf3ec0542191 Mon Sep 17 00:00:00 2001 From: Ada Christine Date: Tue, 13 Feb 2024 01:04:02 +0000 Subject: reorganize a bit --- kjarna/efi/protocol.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 kjarna/efi/protocol.c (limited to 'kjarna/efi/protocol.c') diff --git a/kjarna/efi/protocol.c b/kjarna/efi/protocol.c new file mode 100644 index 0000000..e4be9cd --- /dev/null +++ b/kjarna/efi/protocol.c @@ -0,0 +1,24 @@ +#include + +#include "kjarna_efi.h" + +void *efi_get_protocol(EFI_HANDLE handle, EFI_GUID *guid) +{ + void *protocol; + + efi_errno = gBS->OpenProtocol( + handle, + guid, + &protocol, + efi_context->handle, + nullptr, + EFI_OPEN_PROTOCOL_GET_PROTOCOL); + + if (EFI_ERROR(efi_errno)) + { + return nullptr; + } + + return protocol; +} + -- cgit v1.3.1-1-g115d