| OLD | NEW |
| 1 /** | 1 /** |
| 2 * Copyright (c) 2011 NVIDIA Corporation. All rights reserved. | 2 * Copyright (c) 2011 NVIDIA Corporation. All rights reserved. |
| 3 * | 3 * |
| 4 * See file CREDITS for list of people who contributed to this | 4 * See file CREDITS for list of people who contributed to this |
| 5 * project. | 5 * project. |
| 6 * | 6 * |
| 7 * This program is free software; you can redistribute it and/or | 7 * This program is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU General Public License as | 8 * modify it under the terms of the GNU General Public License as |
| 9 * published by the Free Software Foundation; either version 2 of | 9 * published by the Free Software Foundation; either version 2 of |
| 10 * the License, or (at your option) any later version. | 10 * the License, or (at your option) any later version. |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 | 34 |
| 35 #include "cbootimage.h" | 35 #include "cbootimage.h" |
| 36 | 36 |
| 37 | 37 |
| 38 /* | 38 /* |
| 39 * Enums | 39 * Enums |
| 40 */ | 40 */ |
| 41 | 41 |
| 42 typedef enum | 42 typedef enum |
| 43 { | 43 { |
| 44 token_none = 0, | 44 » token_none = 0, |
| 45 token_attribute, | 45 » token_attribute, |
| 46 token_bootloader, | 46 » token_bootloader, |
| 47 token_page_size, | 47 » token_block_size, |
| 48 token_redundancy, | 48 » token_page_size, |
| 49 token_version, | 49 » token_partition_size, |
| 50 token_bct_file, | 50 » token_dev_type, |
| 51 token_addon, | 51 » token_dev_param, |
| 52 » token_redundancy, |
| 53 » token_version, |
| 54 » token_bct_file, |
| 55 » token_addon, |
| 56 » token_sdmmc_params, |
| 57 » token_spiflash_params, |
| 58 » token_data_width, |
| 59 » token_clock_divider, |
| 60 » token_clock_source, |
| 61 » token_read_command_type_fast, |
| 62 » token_max_power_class_supported, |
| 52 | 63 |
| 53 token_force32 = 0x7fffffff | 64 » token_force32 = 0x7fffffff |
| 54 } parse_token; | 65 } parse_token; |
| 55 | 66 |
| 67 typedef enum |
| 68 { |
| 69 field_type_none = 0, |
| 70 field_type_enum, |
| 71 field_type_u32, |
| 72 field_type_u8, |
| 73 field_type_force32 = 0x7fffffff |
| 74 } field_type; |
| 75 |
| 56 /* Forward declarations */ | 76 /* Forward declarations */ |
| 57 typedef int (*process_function)(build_image_context *context, | 77 typedef int (*process_function)(build_image_context *context, |
| 58 parse_token token, | 78 parse_token token, |
| 59 » » » » char *Remiainder); | 79 » » » » char *remainder); |
| 80 |
| 81 typedef int (*process_subfield_function)(build_image_context *context, |
| 82 » » » » » u_int32_t index, |
| 83 » » » » » parse_token token, |
| 84 » » » » » u_int32_t value); |
| 85 |
| 60 | 86 |
| 61 typedef struct | 87 typedef struct |
| 62 { | 88 { |
| 63 » char» *prefix; | 89 » char *name; |
| 64 » parse_token» token; | 90 » u_int32_t value; |
| 65 » process_function» process; | 91 } enum_item; |
| 92 |
| 93 typedef struct |
| 94 { |
| 95 » char *name; |
| 96 » u_int32_t token; |
| 97 » field_type type; |
| 98 » enum_item *enum_table; |
| 99 } field_item; |
| 100 |
| 101 typedef struct |
| 102 { |
| 103 » char *prefix; |
| 104 » parse_token token; |
| 105 » field_item *field_table; |
| 106 » process_subfield_function process; |
| 107 } parse_subfield_item; |
| 108 |
| 109 typedef struct |
| 110 { |
| 111 » char *prefix; |
| 112 » parse_token token; |
| 113 » process_function process; |
| 66 } parse_item; | 114 } parse_item; |
| 67 | 115 |
| 68 /* | 116 /* |
| 69 * Function prototypes | 117 * Function prototypes |
| 70 */ | 118 */ |
| 71 void process_config_file(build_image_context *context); | 119 void process_config_file(build_image_context *context); |
| 72 | 120 |
| 73 | 121 |
| 74 #endif /* #ifndef INCLUDED_PARSE_H */ | 122 #endif /* #ifndef INCLUDED_PARSE_H */ |
| OLD | NEW |