From: Jan Janssen Date: Thu, 26 May 2022 08:59:53 +0000 (+0200) Subject: boot: Drop use of LibLocateProtocol X-Git-Tag: v252-rc1~835^2~8 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6a261332bc266e4b52e393dfacfdbb6383bc2bf3;p=thirdparty%2Fsystemd.git boot: Drop use of LibLocateProtocol --- diff --git a/src/boot/efi/console.c b/src/boot/efi/console.c index 937ad7ddfd0..009d3672b89 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 d5186d10d0f..15513a98e6f 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 62a3512fa38..9e69c2703da 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 c9ce8f19e0f..b388d4bc405 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 a9ee2736736..f1221ae2a76 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 e0d075c911f..2fd2db6ba0b 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;