aarch64: Fix 64-bit pointer related casts

BUG=None
BRANCH=none
TEST=Ran image in foundation model
Signed-off-by: Marcelo Povoa <marcelogp@chromium.org>

Change-Id: I80a92673c163b3df312ce632eb52e5bb1e7ab1db
Reviewed-on: https://chromium-review.googlesource.com/185273
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Commit-Queue: Marcelo Póvoa <marcelogp@chromium.org>
Tested-by: Marcelo Póvoa <marcelogp@chromium.org>
This commit is contained in:
Marcelo Povoa 2014-02-06 15:17:40 -08:00 committed by chrome-internal-fetch
commit e2f19689ac
3 changed files with 10 additions and 10 deletions

View file

@ -175,22 +175,23 @@ void * cbfs_load_stage(struct cbfs_media *media, const char *name)
cbfs_get_file_content(media, name, CBFS_TYPE_STAGE);
/* this is a mess. There is no ntohll. */
/* for now, assume compatible byte order until we solve this. */
uint32_t entry;
uintptr_t entry;
if (stage == NULL)
return (void *) -1;
LOG("loading stage %s @ 0x%x (%d bytes), entry @ 0x%llx\n",
LOG("loading stage %s @ 0x%llx (%d bytes), entry @ 0x%llx\n",
name,
(uint32_t) stage->load, stage->memlen,
stage->load, stage->memlen,
stage->entry);
/* Stages rely the below clearing so that the bss is initialized. */
memset((void *) (uint32_t) stage->load, 0, stage->memlen);
memset((void *) (uintptr_t) stage->load, 0, stage->memlen);
if (cbfs_decompress(stage->compression,
((unsigned char *) stage) +
sizeof(struct cbfs_stage),
(void *) (uint32_t) stage->load,
(void *) (uintptr_t) stage->load,
stage->len))
return (void *) -1;
@ -217,8 +218,7 @@ int cbfs_execute_stage(struct cbfs_media *media, const char *name)
return 1;
}
/* FIXME: This isn't right */
LOG("run @ %p\n", (void *) ntohl((uint32_t) stage->entry));
LOG("run @ %p\n", (void *) (uintptr_t) ntohll(stage->entry));
return run_address((void *)(uintptr_t)ntohll(stage->entry));
}

View file

@ -184,7 +184,7 @@ void *cbmem_add(u32 id, u64 size)
cbmem_toc[0].base += size;
cbmem_toc[0].size -= size;
return (void *)(u32)cbmem_toc[i].base;
return (void *)(uintptr_t)cbmem_toc[i].base;
}
void *cbmem_find(u32 id)

View file

@ -332,7 +332,7 @@ static int build_self_segment_list(
new->s_memsz = ntohl(segment->mem_len);
new->compression = ntohl(segment->compression);
new->s_srcaddr = (u32) ((unsigned char *)first_segment)
new->s_srcaddr = (uintptr_t) ((unsigned char *)first_segment)
+ ntohl(segment->offset);
new->s_filesz = ntohl(segment->len);
printk(BIOS_DEBUG, " New segment dstaddr 0x%lx memsize 0x%lx srcaddr 0x%lx filesize 0x%lx\n",
@ -526,7 +526,7 @@ void *selfload(struct lb_memory *mem, struct cbfs_payload *payload)
printk(BIOS_SPEW, "Loaded segments\n");
return (void *)entry;
return (void *)(uintptr_t)entry;
out:
return NULL;