Subrata Banik has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/81615?usp=email )
Change subject: drivers/intel/fsp2_0: Enhance portability with uintptr_t/size_t ......................................................................
drivers/intel/fsp2_0: Enhance portability with uintptr_t/size_t
Replaces fixed-width integers for pointers and sizes with uintptr_t and size_t, promoting portability across 32-bit and 64-bit architectures.
For FSP-API specific UPD assignments, relying on `efi_uintn_t` rather fixed size datatype uint32_t/uint64_t.
BUG=b:242829490 TEST=Firmware splash screen visible on google/rex0 w/ both 32-bit and 64-bit compilation.
Change-Id: Iab5c612e0640441a2a10e77949416de2afdb8985 Signed-off-by: Subrata Banik subratabanik@google.com --- M src/drivers/intel/fsp2_0/fsp_gop_blt.c M src/drivers/intel/fsp2_0/include/fsp/fsp_gop_blt.h M src/include/bootsplash.h M src/lib/bmp_logo.c 4 files changed, 10 insertions(+), 9 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/15/81615/1
diff --git a/src/drivers/intel/fsp2_0/fsp_gop_blt.c b/src/drivers/intel/fsp2_0/fsp_gop_blt.c index 8b64502..52e4595 100644 --- a/src/drivers/intel/fsp2_0/fsp_gop_blt.c +++ b/src/drivers/intel/fsp2_0/fsp_gop_blt.c @@ -133,7 +133,7 @@
/* Fill BMP image into BLT buffer format */ static void *fill_blt_buffer(efi_bmp_image_header *header, - uint32_t logo_ptr, uint32_t blt_buffer_size) + uintptr_t logo_ptr, size_t blt_buffer_size) { efi_graphics_output_blt_pixel *gop_blt_buffer; efi_graphics_output_blt_pixel *gop_blt_ptr; @@ -233,11 +233,12 @@ }
/* Convert a *.BMP graphics image to a GOP blt buffer */ -void fsp_convert_bmp_to_gop_blt(uint32_t *logo, uint32_t *logo_size, - uint32_t *blt_ptr, uint32_t *blt_size, +void fsp_convert_bmp_to_gop_blt(efi_uintn_t *logo, uint32_t *logo_size, + efi_uintn_t *blt_ptr, efi_uintn_t *blt_size, uint32_t *pixel_height, uint32_t *pixel_width) { - uint32_t logo_ptr, logo_ptr_size, blt_buffer_size; + uintptr_t logo_ptr; + size_t logo_ptr_size, blt_buffer_size; efi_bmp_image_header *bmp_header;
if (!logo || !logo_size || !blt_ptr || !blt_size || !pixel_height || !pixel_width) @@ -265,5 +266,5 @@ *blt_size = blt_buffer_size; *pixel_height = bmp_header->PixelHeight; *pixel_width = bmp_header->PixelWidth; - *blt_ptr = (uint32_t)fill_blt_buffer(bmp_header, logo_ptr, blt_buffer_size); + *blt_ptr = (uintptr_t)fill_blt_buffer(bmp_header, logo_ptr, blt_buffer_size); } diff --git a/src/drivers/intel/fsp2_0/include/fsp/fsp_gop_blt.h b/src/drivers/intel/fsp2_0/include/fsp/fsp_gop_blt.h index 7ffb54c..ff15483 100644 --- a/src/drivers/intel/fsp2_0/include/fsp/fsp_gop_blt.h +++ b/src/drivers/intel/fsp2_0/include/fsp/fsp_gop_blt.h @@ -7,8 +7,8 @@ #include <types.h>
/* Convert a *.BMP graphics image to a GOP blt buffer */ -void fsp_convert_bmp_to_gop_blt(uint32_t *logo, uint32_t *logo_size, - uint32_t *blt_ptr, uint32_t *blt_size, +void fsp_convert_bmp_to_gop_blt(efi_uintn_t *logo, uint32_t *logo_size, + efi_uintn_t *blt_ptr, efi_uintn_t *blt_size, uint32_t *pixel_height, uint32_t *pixel_width);
#endif /* FSP_GOP_BLT_H */ diff --git a/src/include/bootsplash.h b/src/include/bootsplash.h index 86048a4..0c9b032 100644 --- a/src/include/bootsplash.h +++ b/src/include/bootsplash.h @@ -20,7 +20,7 @@ * For example: Introduce configurable BMP logo for customization on platforms like ChromeOS */ const char *bmp_logo_filename(void); -void bmp_load_logo(uint32_t *logo_ptr, uint32_t *logo_size); +void bmp_load_logo(uintptr_t *logo_ptr, size_t *logo_size); void bmp_release_logo(void);
#endif diff --git a/src/lib/bmp_logo.c b/src/lib/bmp_logo.c index 2888777..ee0626a 100644 --- a/src/lib/bmp_logo.c +++ b/src/lib/bmp_logo.c @@ -16,7 +16,7 @@ } #endif
-void bmp_load_logo(uint32_t *logo_ptr, uint32_t *logo_size) +void bmp_load_logo(uintptr_t *logo_ptr, size_t *logo_size) { void *logo_buffer;