diff options
author | Sebastian Andrzej Siewior <sebastian@breakpoint.cc> | 2010-01-22 18:15:38 +0100 |
---|---|---|
committer | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2010-03-31 10:01:29 +0200 |
commit | de5dd4d4036211b0a8e1839ce87984a074eb18f8 (patch) | |
tree | bf66e9eb865a868bbbf572cdebbddb0e94cd6488 /kexec/arch/sh/kexec-uImage-sh.c | |
parent | 872edb58246b9f310bd99315e5e102ab754fb765 (diff) |
Let SH adn ARM use common uImage probe code
The now generic probe function is more complete than the currently used.
It seems that ARM's and SH's uImage are always uncompressed so it might
be good to check for this.
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Marc Andre Tanner <mat@brain-dump.org>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Diffstat (limited to 'kexec/arch/sh/kexec-uImage-sh.c')
-rw-r--r-- | kexec/arch/sh/kexec-uImage-sh.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/kexec/arch/sh/kexec-uImage-sh.c b/kexec/arch/sh/kexec-uImage-sh.c index c2bce53..e983165 100644 --- a/kexec/arch/sh/kexec-uImage-sh.c +++ b/kexec/arch/sh/kexec-uImage-sh.c @@ -7,24 +7,13 @@ #include <string.h> #include <sys/types.h> #include <image.h> +#include <kexec-uImage.h> #include "../../kexec.h" #include "kexec-sh.h" int uImage_sh_probe(const char *buf, off_t len) { - struct image_header header; - - if ((uintmax_t)len < (uintmax_t)sizeof(header)) - return -1; - - memcpy(&header, buf, sizeof(header)); - - if (cpu_to_be32(header.ih_magic) != IH_MAGIC) - return -1; - - /* XXX: check CRC Checksum? */ - - return 0; + return uImage_probe(buf, len, IH_ARCH_SH); } int uImage_sh_load(int argc, char **argv, const char *buf, off_t len, |