*/
#include <common.h>
+#include <bootm.h>
#include <command.h>
#include <linux/ctype.h>
#include <net.h>
static unsigned long load_elf_image_shdr(unsigned long addr);
/* Allow ports to override the default behavior */
-__attribute__((weak))
-unsigned long do_bootelf_exec(ulong (*entry)(int, char * const[]),
+static unsigned long do_bootelf_exec(ulong (*entry)(int, char * const[]),
int argc, char * const argv[])
{
unsigned long ret;
* defaults to 0x4200
*/
tmp = getenv("bootaddr");
- if (tmp)
+ if (!tmp)
bootaddr = CONFIG_SYS_VXWORKS_BOOT_ADDR;
else
bootaddr = simple_strtoul(tmp, NULL, 16);
*/
bootline = getenv("bootargs");
if (bootline) {
- memcpy((void *) bootaddr, bootline,
- max(strlen(bootline), 255));
- flush_cache(bootaddr, max(strlen(bootline), 255));
+ memcpy((void *)bootaddr, bootline,
+ max(strlen(bootline), (size_t)255));
+ flush_cache(bootaddr, max(strlen(bootline), (size_t)255));
} else {
sprintf(build_buf, CONFIG_SYS_VXWORKS_BOOT_DEVICE);
tmp = getenv("bootfile");
CONFIG_SYS_VXWORKS_ADD_PARAMS);
#endif
- memcpy((void *) bootaddr, build_buf,
- max(strlen(build_buf), 255));
- flush_cache(bootaddr, max(strlen(build_buf), 255));
+ memcpy((void *)bootaddr, build_buf,
+ max(strlen(build_buf), (size_t)255));
+ flush_cache(bootaddr, max(strlen(build_buf), (size_t)255));
}
/*
/* Load each program header */
for (i = 0; i < ehdr->e_phnum; ++i) {
- void *dst = (void *) phdr->p_paddr;
+ void *dst = (void *)(uintptr_t) phdr->p_paddr;
void *src = (void *) addr + phdr->p_offset;
debug("Loading phdr %i to 0x%p (%i bytes)\n",
i, dst, phdr->p_filesz);
}
if (shdr->sh_type == SHT_NOBITS) {
- memset((void *)shdr->sh_addr, 0, shdr->sh_size);
+ memset((void *)(uintptr_t) shdr->sh_addr, 0,
+ shdr->sh_size);
} else {
image = (unsigned char *) addr + shdr->sh_offset;
- memcpy((void *) shdr->sh_addr,
+ memcpy((void *)(uintptr_t) shdr->sh_addr,
(const void *) image,
shdr->sh_size);
}