summaryrefslogtreecommitdiffstats
path: root/common/partitions/parser.h
diff options
context:
space:
mode:
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2013-02-16 14:47:07 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2013-02-16 23:39:08 +0100
commit263bb23ed2e21ed411b87c32b6c27db0f35a33a1 (patch)
treeecb72af967a6bf9b6fca87b7eb9911ee64c6eee1 /common/partitions/parser.h
parenta7d9ec049844616b5b5f45847e6dff133ea52d96 (diff)
downloadbarebox-263bb23ed2e21ed411b87c32b6c27db0f35a33a1.tar.gz
partitons: add framework
so we can support multiple format use filetpye to detect the parser to use Cc: Rob Herring <rob.herring@calxeda.com> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common/partitions/parser.h')
-rw-r--r--common/partitions/parser.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/common/partitions/parser.h b/common/partitions/parser.h
new file mode 100644
index 0000000..13506c0
--- /dev/null
+++ b/common/partitions/parser.h
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2013 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+ *
+ * Under GPLv2 only
+ */
+
+#ifndef __PARTITIONS_PARSER_H__
+#define __PARTITIONS_PARSER_H__
+
+#include <block.h>
+#include <filetype.h>
+#include <linux/list.h>
+
+#define MAX_PARTITION 8
+
+struct partition {
+ uint64_t first_sec;
+ uint64_t size;
+};
+
+struct partition_desc {
+ int used_entries;
+ struct partition parts[MAX_PARTITION];
+};
+
+struct partition_parser {
+ void (*parse)(void *buf, struct block_device *blk, struct partition_desc *pd);
+ enum filetype type;
+
+ struct list_head list;
+};
+
+int partition_parser_register(struct partition_parser *p);
+
+#endif /* __PARTITIONS_PARSER_H__ */