From 263bb23ed2e21ed411b87c32b6c27db0f35a33a1 Mon Sep 17 00:00:00 2001 From: Jean-Christophe PLAGNIOL-VILLARD Date: Sat, 16 Feb 2013 14:47:07 +0100 Subject: partitons: add framework so we can support multiple format use filetpye to detect the parser to use Cc: Rob Herring Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD Signed-off-by: Sascha Hauer --- common/partitions/parser.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 common/partitions/parser.h (limited to 'common/partitions/parser.h') diff --git a/common/partitions/parser.h b/common/partitions/parser.h new file mode 100644 index 0000000000..13506c00a0 --- /dev/null +++ b/common/partitions/parser.h @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2013 Jean-Christophe PLAGNIOL-VILLARD + * + * Under GPLv2 only + */ + +#ifndef __PARTITIONS_PARSER_H__ +#define __PARTITIONS_PARSER_H__ + +#include +#include +#include + +#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__ */ -- cgit v1.2.3