lib/cbfs: more cleanup for 32/64 issues
Change-Id: I5499a99cec82b464c5146cfc2008d683d079b23a Signed-off-by: Ronald G. Minnich <rminnich@gmail.com> Reviewed-on: http://review.coreboot.org/7068 Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com> Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
This commit is contained in:
parent
f33d270d97
commit
ff178beee5
|
@ -123,7 +123,7 @@ void * cbfs_load_stage(struct cbfs_media *media, const char *name)
|
||||||
cbfs_get_file_content(media, name, CBFS_TYPE_STAGE, NULL);
|
cbfs_get_file_content(media, name, CBFS_TYPE_STAGE, NULL);
|
||||||
/* this is a mess. There is no ntohll. */
|
/* this is a mess. There is no ntohll. */
|
||||||
/* for now, assume compatible byte order until we solve this. */
|
/* for now, assume compatible byte order until we solve this. */
|
||||||
uint32_t entry;
|
uintptr_t entry;
|
||||||
uint32_t final_size;
|
uint32_t final_size;
|
||||||
|
|
||||||
if (stage == NULL)
|
if (stage == NULL)
|
||||||
|
@ -137,7 +137,7 @@ void * cbfs_load_stage(struct cbfs_media *media, const char *name)
|
||||||
final_size = cbfs_decompress(stage->compression,
|
final_size = cbfs_decompress(stage->compression,
|
||||||
((unsigned char *) stage) +
|
((unsigned char *) stage) +
|
||||||
sizeof(struct cbfs_stage),
|
sizeof(struct cbfs_stage),
|
||||||
(void *) (uint32_t) stage->load,
|
(void *) (uintptr_t) stage->load,
|
||||||
stage->len);
|
stage->len);
|
||||||
if (!final_size)
|
if (!final_size)
|
||||||
return (void *) -1;
|
return (void *) -1;
|
||||||
|
|
|
@ -220,7 +220,7 @@ int cbfs_decompress(int algo, void *src, void *dst, int len)
|
||||||
case CBFS_COMPRESS_NONE:
|
case CBFS_COMPRESS_NONE:
|
||||||
/* Reads need to be aligned at 4 bytes to avoid
|
/* Reads need to be aligned at 4 bytes to avoid
|
||||||
poor flash performance. */
|
poor flash performance. */
|
||||||
while (len && ((u32)src & 3)) {
|
while (len && ((uintptr_t)src & 3)) {
|
||||||
*(u8*)dst++ = *(u8*)src++;
|
*(u8*)dst++ = *(u8*)src++;
|
||||||
len--;
|
len--;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue