MCPcopy Create free account
hub / github.com/coreboot/coreboot / main

Function main

util/cbfstool/ifittool.c:139–469  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

137};
138
139int main(int argc, char *argv[])
140{
141 int c;
142 const char *input_file = NULL;
143 const char *name = NULL;
144 const char *region_name = NULL;
145 const char *file_region_name = NULL;
146 enum fit_operation op = NO_OP;
147 bool dump = false, clear_table = false;
148 size_t max_table_size = 0;
149 size_t table_entry = 0;
150 uint32_t addr = 0;
151 size_t topswap_size = 0;
152 enum fit_type fit_type = 0;
153 uint32_t headeroffset = HEADER_OFFSET_UNKNOWN;
154
155 verbose = 0;
156
157 if (argc < 4) {
158 usage(argv[0]);
159 return 1;
160 }
161
162 while (1) {
163 int optindex = 0;
164 char *suffix = NULL;
165
166 c = getopt_long(argc, argv, optstring, long_options, &optindex);
167
168 if (c == -1)
169 break;
170
171 switch (c) {
172 case 'h':
173 usage(argv[0]);
174 return 1;
175 case 'a':
176 if (op != NO_OP) {
177 ERROR("specified multiple actions at once\n");
178 usage(argv[0]);
179 return 1;
180 }
181 op = ADD_CBFS_OP;
182 break;
183 case 'A':
184 if (op != NO_OP) {
185 ERROR("specified multiple actions at once\n");
186 usage(argv[0]);
187 return 1;
188 }
189 op = ADD_REGI_OP;
190 break;
191 case 'c':
192 clear_table = true;
193 break;
194 case 'd':
195 if (op != NO_OP) {
196 ERROR("specified multiple actions at once\n");

Callers

nothing calls this directly

Calls 15

getopt_longFunction · 0.85
partitioned_file_reopenFunction · 0.85
partitioned_file_closeFunction · 0.85
buffer_cloneFunction · 0.85
cbfs_image_from_bufferFunction · 0.85
fit_get_tableFunction · 0.85
fit_clear_tableFunction · 0.85
fit_add_entryFunction · 0.85
fit_add_microcode_fileFunction · 0.85
cbfs_get_entryFunction · 0.85

Tested by

no test coverage detected