]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
boot: Drop use of LibLocateProtocol
authorJan Janssen <medhefgo@web.de>
Thu, 26 May 2022 08:59:53 +0000 (10:59 +0200)
committerJan Janssen <medhefgo@web.de>
Thu, 9 Jun 2022 10:50:13 +0000 (12:50 +0200)
src/boot/efi/console.c
src/boot/efi/devicetree.c
src/boot/efi/graphics.c
src/boot/efi/measure.c
src/boot/efi/random-seed.c
src/boot/efi/splash.c

index 937ad7ddfd052aee0103b1e263c51aa76c3e6602..009d3672b8944948dabbcd45bc0596554ea662c0 100644 (file)
@@ -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;
 
index d5186d10d0fd9869521fff414443402e7576bb32..15513a98e6f4f755c02373e2de089d3fad9b0326 100644 (file)
@@ -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.");
index 62a3512fa38b26ded1f8c33b97cac27e395263dd..9e69c2703da172bb52c154787deef1ece984f859 100644 (file)
@@ -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;
index c9ce8f19e0fbf0f7d03714bcb368e6201d399f7b..b388d4bc4050a5dcc30002b32fae4244f4f76bee 100644 (file)
@@ -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;
 
index a9ee2736736ff1a4c452b57854bd81cf8bb0afdf..f1221ae2a760529055c44fcf937d6ddeb4751e95 100644 (file)
@@ -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)
index e0d075c911f8afa5f5a3592a4487318d64330f56..2fd2db6ba0b1ca66d10ccc7afa54c310aeb2017f 100644 (file)
@@ -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;