summaryrefslogtreecommitdiffstats
path: root/include/filetype.h
diff options
context:
space:
mode:
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2013-01-22 15:40:36 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2013-01-22 22:03:44 +0100
commit03939c0dfbf27d99e81d85e1bc0340fbee083d74 (patch)
tree688a6dd44bfb866610cbd27e68d1b3ba4118cd68 /include/filetype.h
parentd40e6e14769aed5e0d024752037d5b42a71f6063 (diff)
downloadbarebox-03939c0dfbf27d99e81d85e1bc0340fbee083d74.tar.gz
filetype: add is_barebox_mips_head support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/filetype.h')
-rw-r--r--include/filetype.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/filetype.h b/include/filetype.h
index 502b920..3b0715f 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 */