Skip to content

Commit 6e161dc

Browse files
committed
stub: make splash image payload const
1 parent 94b81af commit 6e161dc

File tree

3 files changed

+18
-10
lines changed

3 files changed

+18
-10
lines changed

src/boot/efi/splash.c

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,13 @@ struct bmp_map {
3737
UINT8 reserved;
3838
} _packed_;
3939

40-
static EFI_STATUS bmp_parse_header(UINT8 *bmp, UINTN size, struct bmp_dib **ret_dib,
41-
struct bmp_map **ret_map, UINT8 **pixmap) {
40+
static EFI_STATUS bmp_parse_header(
41+
const UINT8 *bmp,
42+
UINTN size,
43+
struct bmp_dib **ret_dib,
44+
struct bmp_map **ret_map,
45+
const UINT8 **pixmap) {
46+
4247
struct bmp_file *file;
4348
struct bmp_dib *dib;
4449
struct bmp_map *map;
@@ -154,10 +159,13 @@ static VOID pixel_blend(UINT32 *dst, const UINT32 source) {
154159
*dst = (rb | g);
155160
}
156161

157-
static EFI_STATUS bmp_to_blt(EFI_GRAPHICS_OUTPUT_BLT_PIXEL *buf,
158-
struct bmp_dib *dib, struct bmp_map *map,
159-
UINT8 *pixmap) {
160-
UINT8 *in;
162+
static EFI_STATUS bmp_to_blt(
163+
EFI_GRAPHICS_OUTPUT_BLT_PIXEL *buf,
164+
struct bmp_dib *dib,
165+
struct bmp_map *map,
166+
const UINT8 *pixmap) {
167+
168+
const UINT8 *in;
161169

162170
assert(buf);
163171
assert(dib);
@@ -246,13 +254,13 @@ static EFI_STATUS bmp_to_blt(EFI_GRAPHICS_OUTPUT_BLT_PIXEL *buf,
246254
return EFI_SUCCESS;
247255
}
248256

249-
EFI_STATUS graphics_splash(UINT8 *content, UINTN len, const EFI_GRAPHICS_OUTPUT_BLT_PIXEL *background) {
257+
EFI_STATUS graphics_splash(const UINT8 *content, UINTN len, const EFI_GRAPHICS_OUTPUT_BLT_PIXEL *background) {
250258
EFI_GRAPHICS_OUTPUT_BLT_PIXEL pixel = {};
251259
static const EFI_GUID GraphicsOutputProtocolGuid = EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID;
252260
EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput = NULL;
253261
struct bmp_dib *dib;
254262
struct bmp_map *map;
255-
UINT8 *pixmap;
263+
const UINT8 *pixmap;
256264
UINT64 blt_size;
257265
_cleanup_freepool_ VOID *blt = NULL;
258266
UINTN x_pos = 0;

src/boot/efi/splash.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33

44
#include <efi.h>
55

6-
EFI_STATUS graphics_splash(UINT8 *content, UINTN len, const EFI_GRAPHICS_OUTPUT_BLT_PIXEL *background);
6+
EFI_STATUS graphics_splash(const UINT8 *content, UINTN len, const EFI_GRAPHICS_OUTPUT_BLT_PIXEL *background);

src/boot/efi/stub.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *sys_table) {
173173
return log_error_status_stall(err, L"Unable to locate embedded .linux section: %r", err);
174174

175175
/* Show splash screen as early as possible */
176-
graphics_splash((UINT8*) loaded_image->ImageBase + addrs[SECTION_SPLASH], szs[SECTION_SPLASH], NULL);
176+
graphics_splash((const UINT8*) loaded_image->ImageBase + addrs[SECTION_SPLASH], szs[SECTION_SPLASH], NULL);
177177

178178
if (szs[SECTION_CMDLINE] > 0) {
179179
cmdline = (CHAR8*) loaded_image->ImageBase + addrs[SECTION_CMDLINE];

0 commit comments

Comments
 (0)