From 3f9278b48ff4bc0d2cf1604034b3bba548572f04 Mon Sep 17 00:00:00 2001 From: Ada Christine Date: Sun, 11 Feb 2024 23:48:04 +0000 Subject: kjarna initial impl --- kjarna/protocol.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 kjarna/protocol.c (limited to 'kjarna/protocol.c') diff --git a/kjarna/protocol.c b/kjarna/protocol.c new file mode 100644 index 0000000..e4be9cd --- /dev/null +++ b/kjarna/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