summaryrefslogtreecommitdiffstats
path: root/src/boot/efi/splash.c
diff options
context:
space:
mode:
authorJan Janssen <medhefgo@web.de>2021-09-30 12:11:56 +0200
committerJan Janssen <medhefgo@web.de>2021-10-17 11:55:57 +0200
commit12f32748aa291db1e8c1305e7fb4310e9728aad4 (patch)
treec19933452b62ff7de743eaea6765d75a34d6371e /src/boot/efi/splash.c
parentsd-boot: Convert VOID -> void (diff)
downloadsystemd-12f32748aa291db1e8c1305e7fb4310e9728aad4.tar.xz
systemd-12f32748aa291db1e8c1305e7fb4310e9728aad4.zip
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.
Diffstat (limited to 'src/boot/efi/splash.c')
-rw-r--r--src/boot/efi/splash.c26
1 files changed, 15 insertions, 11 deletions
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);
}