Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(266)

Unified Diff: parse.h

Issue 6579034: Add the device type/parameters support for cbootimage tool. (Closed) Base URL: http://git.chromium.org/git/cbootimage.git@master
Patch Set: Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « nvboot_bct.h ('k') | parse.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: parse.h
diff --git a/parse.h b/parse.h
index 457b546affbcf04112d0ec5df48f9f56ca4506da..f2e8ad6f873b00dc25f42882753007dcd38742d6 100644
--- a/parse.h
+++ b/parse.h
@@ -41,28 +41,76 @@
typedef enum
{
- token_none = 0,
- token_attribute,
- token_bootloader,
- token_page_size,
- token_redundancy,
- token_version,
- token_bct_file,
- token_addon,
-
- token_force32 = 0x7fffffff
+ token_none = 0,
+ token_attribute,
+ token_bootloader,
+ token_block_size,
+ token_page_size,
+ token_partition_size,
+ token_dev_type,
+ token_dev_param,
+ token_redundancy,
+ token_version,
+ token_bct_file,
+ token_addon,
+ token_sdmmc_params,
+ token_spiflash_params,
+ token_data_width,
+ token_clock_divider,
+ token_clock_source,
+ token_read_command_type_fast,
+ token_max_power_class_supported,
+
+ token_force32 = 0x7fffffff
} parse_token;
+typedef enum
+{
+ field_type_none = 0,
+ field_type_enum,
+ field_type_u32,
+ field_type_u8,
+ field_type_force32 = 0x7fffffff
+} field_type;
+
/* Forward declarations */
typedef int (*process_function)(build_image_context *context,
parse_token token,
- char *Remiainder);
+ char *remainder);
+
+typedef int (*process_subfield_function)(build_image_context *context,
+ u_int32_t index,
+ parse_token token,
+ u_int32_t value);
+
+
+typedef struct
+{
+ char *name;
+ u_int32_t value;
+} enum_item;
+
+typedef struct
+{
+ char *name;
+ u_int32_t token;
+ field_type type;
+ enum_item *enum_table;
+} field_item;
+
+typedef struct
+{
+ char *prefix;
+ parse_token token;
+ field_item *field_table;
+ process_subfield_function process;
+} parse_subfield_item;
typedef struct
{
- char *prefix;
- parse_token token;
- process_function process;
+ char *prefix;
+ parse_token token;
+ process_function process;
} parse_item;
/*
« no previous file with comments | « nvboot_bct.h ('k') | parse.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698