From 12f32748aa291db1e8c1305e7fb4310e9728aad4 Mon Sep 17 00:00:00 2001 From: Jan Janssen Date: Thu, 30 Sep 2021 12:11:56 +0200 Subject: sd-boot: Get rid of uefi_call_wrapper The uefi_call_wrapper exists to convert to the right calling convention and presumably predates compilers that can do so natively. The only architecture where this is even needed is x86_64. But because we are building with GNU_EFI_USE_MS_ABI defined, the EFIAPI macro tells the compiler to use the right calling convention for EFI functions. Our shim callback (which is called by EFI itself) already relies on this. This also adds a safety check to make se we are compiling with GNU_EFI_USE_MS_ABI defined and also adds it to the compiler args unconditionally. It is only used with x86_64 anyways, so it should be fine to do so. EFI_FUNCTION_WRAPPER is unused in gnu-efi, so it is dropped. --- src/boot/efi/splash.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'src/boot/efi/splash.c') diff --git a/src/boot/efi/splash.c b/src/boot/efi/splash.c index 8cb343b50f..c27203eb8c 100644 --- a/src/boot/efi/splash.c +++ b/src/boot/efi/splash.c @@ -294,11 +294,13 @@ EFI_STATUS graphics_splash(const UINT8 *content, UINTN len, const EFI_GRAPHICS_O if (dib->y < GraphicsOutput->Mode->Info->VerticalResolution) y_pos = (GraphicsOutput->Mode->Info->VerticalResolution - dib->y) / 2; - uefi_call_wrapper(GraphicsOutput->Blt, 10, GraphicsOutput, - (EFI_GRAPHICS_OUTPUT_BLT_PIXEL *)background, - EfiBltVideoFill, 0, 0, 0, 0, - GraphicsOutput->Mode->Info->HorizontalResolution, - GraphicsOutput->Mode->Info->VerticalResolution, 0); + err = GraphicsOutput->Blt( + GraphicsOutput, (EFI_GRAPHICS_OUTPUT_BLT_PIXEL *)background, + EfiBltVideoFill, 0, 0, 0, 0, + GraphicsOutput->Mode->Info->HorizontalResolution, + GraphicsOutput->Mode->Info->VerticalResolution, 0); + if (EFI_ERROR(err)) + return err; /* EFI buffer */ blt_size = sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL) * dib->x * dib->y; @@ -306,9 +308,10 @@ EFI_STATUS graphics_splash(const UINT8 *content, UINTN len, const EFI_GRAPHICS_O if (!blt) return EFI_OUT_OF_RESOURCES; - err = uefi_call_wrapper(GraphicsOutput->Blt, 10, GraphicsOutput, - blt, EfiBltVideoToBltBuffer, x_pos, y_pos, 0, 0, - dib->x, dib->y, 0); + err = GraphicsOutput->Blt( + GraphicsOutput, blt, + EfiBltVideoToBltBuffer, x_pos, y_pos, 0, 0, + dib->x, dib->y, 0); if (EFI_ERROR(err)) return err; @@ -320,7 +323,8 @@ EFI_STATUS graphics_splash(const UINT8 *content, UINTN len, const EFI_GRAPHICS_O if (EFI_ERROR(err)) return err; - return uefi_call_wrapper(GraphicsOutput->Blt, 10, GraphicsOutput, - blt, EfiBltBufferToVideo, 0, 0, x_pos, y_pos, - dib->x, dib->y, 0); + return GraphicsOutput->Blt( + GraphicsOutput, blt, + EfiBltBufferToVideo, 0, 0, x_pos, y_pos, + dib->x, dib->y, 0); } -- cgit v1.2.3