From 03939c0dfbf27d99e81d85e1bc0340fbee083d74 Mon Sep 17 00:00:00 2001 From: Jean-Christophe PLAGNIOL-VILLARD Date: Tue, 22 Jan 2013 15:40:36 +0100 Subject: filetype: add is_barebox_mips_head support Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD Signed-off-by: Sascha Hauer --- include/filetype.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'include/filetype.h') diff --git a/include/filetype.h b/include/filetype.h index 502b920927..3b0715f149 100644 --- a/include/filetype.h +++ b/include/filetype.h @@ -50,4 +50,20 @@ static inline int is_barebox_arm_head(const char *head) } #endif +#define MIPS_HEAD_SIZE 0x20 +#define MIPS_HEAD_MAGICWORD_OFFSET 0x10 +#define MIPS_HEAD_SIZE_OFFSET 0x1C + +#ifdef CONFIG_MIPS +static inline int is_barebox_mips_head(const char *head) +{ + return !strcmp(head + MIPS_HEAD_MAGICWORD_OFFSET, "barebox"); +} +#else +static inline int is_barebox_mips_head(const char *head) +{ + return 0; +} +#endif + #endif /* __FILE_TYPE_H */ -- cgit v1.2.3