summaryrefslogtreecommitdiffstats
path: root/include/filetype.h
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2012-10-03 21:11:48 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2012-10-03 21:11:48 +0200
commitbee8dddbfcb07de469105a660e426fa132f96b6a (patch)
tree11568bb2d8fa6cbbdc1b468093b5202eb5bcddeb /include/filetype.h
parentd8b30e6c3823bfe50c3e060aab39b0fab2de933f (diff)
parent93ca711e64d7a4d79aee15b4ce415688f5415fda (diff)
downloadbarebox-bee8dddbfcb07de469105a660e426fa132f96b6a.tar.gz
Merge branch 'for-next/omap'
Conflicts: Makefile
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 37eb620..209dc11 100644
--- a/include/filetype.h
+++ b/include/filetype.h
@@ -27,4 +27,20 @@ enum filetype file_detect_type(void *_buf);
enum filetype file_name_detect_type(const char *filename);
enum filetype is_fat_or_mbr(const unsigned char *sector, unsigned long *bootsec);
+#define ARM_HEAD_SIZE 0x30
+#define ARM_HEAD_MAGICWORD_OFFSET 0x20
+#define ARM_HEAD_SIZE_OFFSET 0x2C
+
+#ifdef CONFIG_ARM
+static inline int is_barebox_arm_head(const char *head)
+{
+ return !strcmp(head + ARM_HEAD_MAGICWORD_OFFSET, "barebox");
+}
+#else
+static inline int is_barebox_arm_head(const char *head)
+{
+ return 0;
+}
+#endif
+
#endif /* __FILE_TYPE_H */