aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/cmdline-parser.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/cmdline-parser.h')
-rw-r--r--include/linux/cmdline-parser.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/include/linux/cmdline-parser.h b/include/linux/cmdline-parser.h
new file mode 100644
index 000000000000..98e892ef6d5a
--- /dev/null
+++ b/include/linux/cmdline-parser.h
@@ -0,0 +1,43 @@
1/*
2 * Parsing command line, get the partitions information.
3 *
4 * Written by Cai Zhiyong <caizhiyong@huawei.com>
5 *
6 */
7#ifndef CMDLINEPARSEH
8#define CMDLINEPARSEH
9
10#include <linux/blkdev.h>
11
12/* partition flags */
13#define PF_RDONLY 0x01 /* Device is read only */
14#define PF_POWERUP_LOCK 0x02 /* Always locked after reset */
15
16struct cmdline_subpart {
17 char name[BDEVNAME_SIZE]; /* partition name, such as 'rootfs' */
18 sector_t from;
19 sector_t size;
20 int flags;
21 struct cmdline_subpart *next_subpart;
22};
23
24struct cmdline_parts {
25 char name[BDEVNAME_SIZE]; /* block device, such as 'mmcblk0' */
26 unsigned int nr_subparts;
27 struct cmdline_subpart *subpart;
28 struct cmdline_parts *next_parts;
29};
30
31void cmdline_parts_free(struct cmdline_parts **parts);
32
33int cmdline_parts_parse(struct cmdline_parts **parts, const char *cmdline);
34
35struct cmdline_parts *cmdline_parts_find(struct cmdline_parts *parts,
36 const char *bdev);
37
38void cmdline_parts_set(struct cmdline_parts *parts, sector_t disk_size,
39 int slot,
40 int (*add_part)(int, struct cmdline_subpart *, void *),
41 void *param);
42
43#endif /* CMDLINEPARSEH */