MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / main

Function main

BaseTools/Source/C/GenPage/GenPage.c:294–440  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

292}
293
294int
295main (
296 int argc,
297 char **argv
298 )
299{
300 VOID *BaseMemory;
301 INTN result;
302 CHAR8 *OutputFile = NULL;
303 CHAR8 *InputFile = NULL;
304 EFI_STATUS Status;
305 UINT64 TempValue;
306
307 SetUtilityName("GenPage");
308
309 if (argc == 1) {
310 Usage();
311 return STATUS_ERROR;
312 }
313
314 argc --;
315 argv ++;
316
317 if ((stricmp (argv[0], "-h") == 0) || (stricmp (argv[0], "--help") == 0)) {
318 Usage();
319 return 0;
320 }
321
322 if (stricmp (argv[0], "--version") == 0) {
323 Version();
324 return 0;
325 }
326
327 while (argc > 0) {
328 if ((stricmp (argv[0], "-o") == 0) || (stricmp (argv[0], "--output") == 0)) {
329 if (argv[1] == NULL || argv[1][0] == '-') {
330 Error (NULL, 0, 1003, "Invalid option value", "Output file is missing for -o option");
331 return STATUS_ERROR;
332 }
333 OutputFile = argv[1];
334 argc -= 2;
335 argv += 2;
336 continue;
337 }
338
339 if ((stricmp (argv[0], "-b") == 0) || (stricmp (argv[0], "--baseaddr") == 0)) {
340 if (argv[1] == NULL || argv[1][0] == '-') {
341 Error (NULL, 0, 1003, "Invalid option value", "Base address is missing for -b option");
342 return STATUS_ERROR;
343 }
344 Status = AsciiStringToUint64 (argv[1], FALSE, &TempValue);
345 if (EFI_ERROR (Status)) {
346 Error (NULL, 0, 1003, "Invalid option value", "Base address is not valid intergrator");
347 return STATUS_ERROR;
348 }
349 gPageTableBaseAddress = (UINT32) TempValue;
350 argc -= 2;
351 argv += 2;

Callers

nothing calls this directly

Calls 7

SetUtilityNameFunction · 0.85
AsciiStringToUint64Function · 0.85
UsageFunction · 0.70
VersionFunction · 0.70
ErrorFunction · 0.50
freeFunction · 0.50

Tested by

no test coverage detected