]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
stub: make splash image payload const
authorLennart Poettering <lennart@poettering.net>
Mon, 20 Sep 2021 15:26:48 +0000 (17:26 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 23 Sep 2021 15:24:10 +0000 (17:24 +0200)
src/boot/efi/splash.c
src/boot/efi/splash.h
src/boot/efi/stub.c

index bbc151767583913efda416df4981a11e94f4fe8b..0071a9317b29fca8efa70178f9fb5fdda7dfb5ce 100644 (file)
@@ -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;
index b9f74ffbf279be0466608fd21846be3e3eaf39bc..37ccc6b6a40c5ef9c54450cea340a7356c868db2 100644 (file)
@@ -3,4 +3,4 @@
 
 #include <efi.h>
 
-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);
index 23f558c885ef61457906a41d61e65a67e48b12ea..3bbb25321e3f4d44dac0f54f50e51d74ceb71083 100644 (file)
@@ -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];