stub: make splash image payload const

This commit is contained in:
Lennart Poettering
2021-09-23 17:24:10 +02:00
parent 94b81afb08
commit 6e161dc860
3 changed files with 18 additions and 10 deletions
+16 -8
View 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;
+1 -1
View 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);
+1 -1
View 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];