blob: c2bce534955636aa08176e041dd8ed03d51d5313 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
/*
* uImage support added by Marc Andre Tanner <mat@brain-dump.org>
*
* Cloned from ARM by Paul Mundt, 2009.
*/
#include <stdint.h>
#include <string.h>
#include <sys/types.h>
#include <image.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;
}
int uImage_sh_load(int argc, char **argv, const char *buf, off_t len,
struct kexec_info *info)
{
return zImage_sh_load(argc, argv, buf + sizeof(struct image_header),
len - sizeof(struct image_header), info);
}
|