From: Lennart Poettering Date: Mon, 20 Sep 2021 15:26:48 +0000 (+0200) Subject: stub: make splash image payload const X-Git-Tag: v250-rc1~629^2~15 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6e161dc86062fc4e221d0e265348ab2d55d79190;p=thirdparty%2Fsystemd.git stub: make splash image payload const --- diff --git a/src/boot/efi/splash.c b/src/boot/efi/splash.c index bbc15176758..0071a9317b2 100644 --- a/src/boot/efi/splash.c +++ b/src/boot/efi/splash.c @@ -37,8 +37,13 @@ struct bmp_map { UINT8 reserved; } _packed_; -static EFI_STATUS bmp_parse_header(UINT8 *bmp, UINTN size, struct bmp_dib **ret_dib, - struct bmp_map **ret_map, UINT8 **pixmap) { +static EFI_STATUS bmp_parse_header( + const UINT8 *bmp, + UINTN size, + struct bmp_dib **ret_dib, + struct bmp_map **ret_map, + const UINT8 **pixmap) { + struct bmp_file *file; struct bmp_dib *dib; struct bmp_map *map; @@ -154,10 +159,13 @@ static VOID pixel_blend(UINT32 *dst, const UINT32 source) { *dst = (rb | g); } -static EFI_STATUS bmp_to_blt(EFI_GRAPHICS_OUTPUT_BLT_PIXEL *buf, - struct bmp_dib *dib, struct bmp_map *map, - UINT8 *pixmap) { - UINT8 *in; +static EFI_STATUS bmp_to_blt( + EFI_GRAPHICS_OUTPUT_BLT_PIXEL *buf, + struct bmp_dib *dib, + struct bmp_map *map, + const UINT8 *pixmap) { + + const UINT8 *in; assert(buf); assert(dib); @@ -246,13 +254,13 @@ static EFI_STATUS bmp_to_blt(EFI_GRAPHICS_OUTPUT_BLT_PIXEL *buf, return EFI_SUCCESS; } -EFI_STATUS graphics_splash(UINT8 *content, UINTN len, const EFI_GRAPHICS_OUTPUT_BLT_PIXEL *background) { +EFI_STATUS graphics_splash(const UINT8 *content, UINTN len, const EFI_GRAPHICS_OUTPUT_BLT_PIXEL *background) { EFI_GRAPHICS_OUTPUT_BLT_PIXEL pixel = {}; static const EFI_GUID GraphicsOutputProtocolGuid = EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID; EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput = NULL; struct bmp_dib *dib; struct bmp_map *map; - UINT8 *pixmap; + const UINT8 *pixmap; UINT64 blt_size; _cleanup_freepool_ VOID *blt = NULL; UINTN x_pos = 0; diff --git a/src/boot/efi/splash.h b/src/boot/efi/splash.h index b9f74ffbf27..37ccc6b6a40 100644 --- a/src/boot/efi/splash.h +++ b/src/boot/efi/splash.h @@ -3,4 +3,4 @@ #include -EFI_STATUS graphics_splash(UINT8 *content, UINTN len, const EFI_GRAPHICS_OUTPUT_BLT_PIXEL *background); +EFI_STATUS graphics_splash(const UINT8 *content, UINTN len, const EFI_GRAPHICS_OUTPUT_BLT_PIXEL *background); diff --git a/src/boot/efi/stub.c b/src/boot/efi/stub.c index 23f558c885e..3bbb25321e3 100644 --- a/src/boot/efi/stub.c +++ b/src/boot/efi/stub.c @@ -173,7 +173,7 @@ EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *sys_table) { return log_error_status_stall(err, L"Unable to locate embedded .linux section: %r", err); /* Show splash screen as early as possible */ - graphics_splash((UINT8*) loaded_image->ImageBase + addrs[SECTION_SPLASH], szs[SECTION_SPLASH], NULL); + graphics_splash((const UINT8*) loaded_image->ImageBase + addrs[SECTION_SPLASH], szs[SECTION_SPLASH], NULL); if (szs[SECTION_CMDLINE] > 0) { cmdline = (CHAR8*) loaded_image->ImageBase + addrs[SECTION_CMDLINE];