From 6a261332bc266e4b52e393dfacfdbb6383bc2bf3 Mon Sep 17 00:00:00 2001 From: Jan Janssen Date: Thu, 26 May 2022 10:59:53 +0200 Subject: [PATCH] boot: Drop use of LibLocateProtocol --- src/boot/efi/console.c | 4 ++-- src/boot/efi/devicetree.c | 2 +- src/boot/efi/graphics.c | 2 +- src/boot/efi/measure.c | 4 ++-- src/boot/efi/random-seed.c | 2 +- src/boot/efi/splash.c | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/boot/efi/console.c b/src/boot/efi/console.c index 937ad7ddfd..009d3672b8 100644 --- a/src/boot/efi/console.c +++ b/src/boot/efi/console.c @@ -48,7 +48,7 @@ EFI_STATUS console_key_read(UINT64 *key, UINT64 timeout_usec) { if (!checked) { /* Get the *first* TextInputEx device.*/ - err = LibLocateProtocol(&SimpleTextInputExProtocol, (void **) &extraInEx); + err = BS->LocateProtocol(&SimpleTextInputExProtocol, NULL, (void **) &extraInEx); if (EFI_ERROR(err) || BS->CheckEvent(extraInEx->WaitForKeyEx) == EFI_INVALID_PARAMETER) /* If WaitForKeyEx fails here, the firmware pretends it talks this * protocol, but it really doesn't. */ @@ -185,7 +185,7 @@ EFI_STATUS query_screen_resolution(UINT32 *ret_w, UINT32 *ret_h) { EFI_STATUS err; EFI_GRAPHICS_OUTPUT_PROTOCOL *go; - err = LibLocateProtocol(&GraphicsOutputProtocol, (void **) &go); + err = BS->LocateProtocol(&GraphicsOutputProtocol, NULL, (void **) &go); if (EFI_ERROR(err)) return err; diff --git a/src/boot/efi/devicetree.c b/src/boot/efi/devicetree.c index d5186d10d0..15513a98e6 100644 --- a/src/boot/efi/devicetree.c +++ b/src/boot/efi/devicetree.c @@ -41,7 +41,7 @@ static EFI_STATUS devicetree_fixup(struct devicetree_state *state, UINTN len) { assert(state); - err = LibLocateProtocol(&EfiDtFixupProtocol, (void **)&fixup); + err = BS->LocateProtocol(&EfiDtFixupProtocol, NULL, (void **) &fixup); if (EFI_ERROR(err)) return log_error_status_stall(EFI_SUCCESS, L"Could not locate device tree fixup protocol, skipping."); diff --git a/src/boot/efi/graphics.c b/src/boot/efi/graphics.c index 62a3512fa3..9e69c2703d 100644 --- a/src/boot/efi/graphics.c +++ b/src/boot/efi/graphics.c @@ -19,7 +19,7 @@ EFI_STATUS graphics_mode(BOOLEAN on) { BOOLEAN stdin_locked; EFI_STATUS err; - err = LibLocateProtocol((EFI_GUID*) EFI_CONSOLE_CONTROL_GUID, (void **)&ConsoleControl); + err = BS->LocateProtocol((EFI_GUID *) EFI_CONSOLE_CONTROL_GUID, NULL, (void **) &ConsoleControl); if (EFI_ERROR(err)) /* console control protocol is nonstandard and might not exist. */ return err == EFI_NOT_FOUND ? EFI_SUCCESS : err; diff --git a/src/boot/efi/measure.c b/src/boot/efi/measure.c index c9ce8f19e0..b388d4bc40 100644 --- a/src/boot/efi/measure.c +++ b/src/boot/efi/measure.c @@ -84,7 +84,7 @@ static EFI_TCG *tcg1_interface_check(void) { UINT32 features; EFI_TCG *tcg; - status = LibLocateProtocol((EFI_GUID*) EFI_TCG_GUID, (void **) &tcg); + status = BS->LocateProtocol((EFI_GUID *) EFI_TCG_GUID, NULL, (void **) &tcg); if (EFI_ERROR(status)) return NULL; @@ -113,7 +113,7 @@ static EFI_TCG2 * tcg2_interface_check(void) { EFI_STATUS status; EFI_TCG2 *tcg; - status = LibLocateProtocol((EFI_GUID*) EFI_TCG2_GUID, (void **) &tcg); + status = BS->LocateProtocol((EFI_GUID *) EFI_TCG2_GUID, NULL, (void **) &tcg); if (EFI_ERROR(status)) return NULL; diff --git a/src/boot/efi/random-seed.c b/src/boot/efi/random-seed.c index a9ee273673..f1221ae2a7 100644 --- a/src/boot/efi/random-seed.c +++ b/src/boot/efi/random-seed.c @@ -26,7 +26,7 @@ static EFI_STATUS acquire_rng(UINTN size, void **ret) { /* Try to acquire the specified number of bytes from the UEFI RNG */ - err = LibLocateProtocol((EFI_GUID*) EFI_RNG_GUID, (void**) &rng); + err = BS->LocateProtocol((EFI_GUID *) EFI_RNG_GUID, NULL, (void **) &rng); if (EFI_ERROR(err)) return err; if (!rng) diff --git a/src/boot/efi/splash.c b/src/boot/efi/splash.c index e0d075c911..2fd2db6ba0 100644 --- a/src/boot/efi/splash.c +++ b/src/boot/efi/splash.c @@ -279,7 +279,7 @@ EFI_STATUS graphics_splash(const UINT8 *content, UINTN len, const EFI_GRAPHICS_O background = &pixel; } - err = LibLocateProtocol(&GraphicsOutputProtocol, (void **)&GraphicsOutput); + err = BS->LocateProtocol(&GraphicsOutputProtocol, NULL, (void **) &GraphicsOutput); if (EFI_ERROR(err)) return err; -- 2.25.1