summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2010-10-08 00:04:15 +0800
committerJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2010-10-08 00:04:28 +0800
commita3c1e5d888d0ee317ffc7635694684bb71213c9c (patch)
tree24226d1678b57d7a58947fe8899b41facf630878 /arch
parent2fbdb02b11ded2619a0ad023910f8160ead5c48a (diff)
downloadbarebox-a3c1e5d888d0ee317ffc7635694684bb71213c9c.tar.gz
barebox-a3c1e5d888d0ee317ffc7635694684bb71213c9c.tar.xz
Replace direct header access with the API routines
Copied from U-Boot Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/lib/armlinux.c6
-rw-r--r--arch/blackfin/lib/blackfin_linux.c4
-rw-r--r--arch/m68k/lib/m68k-linuxboot.c8
-rw-r--r--arch/ppc/lib/ppclinux.c6
4 files changed, 12 insertions, 12 deletions
diff --git a/arch/arm/lib/armlinux.c b/arch/arm/lib/armlinux.c
index b50d535811..7c2cbf95ea 100644
--- a/arch/arm/lib/armlinux.c
+++ b/arch/arm/lib/armlinux.c
@@ -212,7 +212,7 @@ int do_bootm_linux(struct image_data *data)
void (*theKernel)(int zero, int arch, void *params);
image_header_t *os_header = &data->os->header;
- if (os_header->ih_type == IH_TYPE_MULTI) {
+ if (image_check_type(os_header, IH_TYPE_MULTI)) {
printf("Multifile images not handled at the moment\n");
return -1;
}
@@ -227,14 +227,14 @@ int do_bootm_linux(struct image_data *data)
return -1;
}
- theKernel = (void *)ntohl(os_header->ih_ep);
+ theKernel = (void *)image_get_ep(os_header);
debug("## Transferring control to Linux (at address 0x%p) ...\n",
theKernel);
setup_tags();
- if (relocate_image(data->os, (void *)ntohl(os_header->ih_load)))
+ if (relocate_image(data->os, (void *)image_get_load(os_header)))
return -1;
/* we assume that the kernel is in place */
diff --git a/arch/blackfin/lib/blackfin_linux.c b/arch/blackfin/lib/blackfin_linux.c
index ce5f3a54c2..eda3f4c011 100644
--- a/arch/blackfin/lib/blackfin_linux.c
+++ b/arch/blackfin/lib/blackfin_linux.c
@@ -47,10 +47,10 @@ static int do_bootm_linux(struct image_data *idata)
struct image_handle *os_handle = idata->os;
image_header_t *os_header = &os_handle->header;
- appl = (int (*)(char *))ntohl(os_header->ih_ep);
+ appl = (int (*)(char *))image_get_ep(os_header);
printf("Starting Kernel at 0x%08x\n", appl);
- if (relocate_image(os_handle, (void *)ntohl(os_header->ih_load)))
+ if (relocate_image(os_handle, (void *)image_get_load(os_header)))
return -1;
icache_disable();
diff --git a/arch/m68k/lib/m68k-linuxboot.c b/arch/m68k/lib/m68k-linuxboot.c
index 417a8e0cd7..e5e90a8722 100644
--- a/arch/m68k/lib/m68k-linuxboot.c
+++ b/arch/m68k/lib/m68k-linuxboot.c
@@ -109,20 +109,20 @@ static int do_bootm_linux(struct image_data *data)
const char *commandline = getenv ("bootargs");
uint32_t loadaddr,loadsize;
- if (os_header->ih_type == IH_TYPE_MULTI) {
+ if (image_check_type(os_header, IH_TYPE_MULTI)) {
printf("Multifile images not handled at the moment\n");
return -1;
}
printf("commandline: %s\n", commandline);
- theKernel = (void (*)(int,int,uint))ntohl((os_header->ih_ep));
+ theKernel = (void (*)(int,int,uint))image_get_ep(os_header);
debug ("## Transferring control to Linux (at address %08lx) ...\n",
(ulong) theKernel);
- loadaddr = (uint32_t)ntohl(os_header->ih_load);
- loadsize = (uint32_t)ntohl(os_header->ih_size);
+ loadaddr = (uint32_t)image_get_load(os_header);
+ loadsize = (uint32_t)image_get_size(os_header);
setup_boot_record( (char*)(loadaddr+loadsize),(char*)commandline);
if (relocate_image(data->os, (void *)loadaddr))
diff --git a/arch/ppc/lib/ppclinux.c b/arch/ppc/lib/ppclinux.c
index 35a9d31a8e..5ee908d132 100644
--- a/arch/ppc/lib/ppclinux.c
+++ b/arch/ppc/lib/ppclinux.c
@@ -45,7 +45,7 @@ static int do_bootm_linux(struct image_data *idata)
printf("entering %s: os_header: %p initrd_header: %p oftree: %s\n",
__FUNCTION__, os_header, initrd_header, idata->oftree);
- if (os_header->ih_type == IH_TYPE_MULTI) {
+ if (image_check_type(os_header, IH_TYPE_MULTI)) {
unsigned long *data = (unsigned long *)(idata->os->data);
unsigned long len1 = 0, len2 = 0;
@@ -199,9 +199,9 @@ static int do_bootm_linux(struct image_data *idata)
#endif /* CONFIG_MPC5xxx */
}
- kernel = (void (*)(bd_t *, ulong, ulong, ulong, ulong))ntohl(os_header->ih_ep); /* FIXME */
+ kernel = (void (*)(bd_t *, ulong, ulong, ulong, ulong))image_get_ep(os_header); /* FIXME */
- if (relocate_image(idata->os, (void *)ntohl(os_header->ih_load)))
+ if (relocate_image(idata->os, (void *)image_get_load(os_header)))
return -1;
#if defined(CFG_INIT_RAM_LOCK) && !defined(CONFIG_E500)