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

Function main

util/intelvbttool/intelvbttool.c:1081–1230  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1079}
1080
1081int main(int argc, char **argv)
1082{
1083 int opt, ret, option_index = 0;
1084
1085 size_t has_input = 0, has_output = 0;
1086 size_t dump = 0, in_legacy = 0;
1087 char *in_vbt = NULL, *in_oprom = NULL;
1088 char *out_vbt = NULL, *patch_oprom = NULL;
1089 static struct option long_options[] = {
1090 {"help", 0, 0, 'h'},
1091 {"outdump", 0, 0, 'd'},
1092 {"inlegacy", 0, 0, 'l'},
1093 {"invbt", required_argument, 0, 'f'},
1094 {"inoprom", required_argument, 0, 'o'},
1095 {"outvbt", required_argument, 0, 'v'},
1096 {"patchoprom", required_argument, 0, 'p'},
1097 {0, 0, 0, 0}
1098 };
1099
1100 while ((opt = getopt_long(argc, argv, "hdlf:o:v:p:i",
1101 long_options, &option_index)) != EOF) {
1102 switch (opt) {
1103 case 'd':
1104 dump = 1;
1105 has_output = 1;
1106 break;
1107 case 'l':
1108 in_legacy = 1;
1109 has_input = 1;
1110 break;
1111 case 'f':
1112 in_vbt = strdup(optarg);
1113 has_input = 1;
1114 break;
1115 case 'o':
1116 in_oprom = strdup(optarg);
1117 has_input = 1;
1118 break;
1119 case 'v':
1120 out_vbt = strdup(optarg);
1121 has_output = 1;
1122 break;
1123 case 'p':
1124 patch_oprom = strdup(optarg);
1125 has_output = 1;
1126 break;
1127 case '?':
1128 case 'h':
1129 print_usage(argv[0], long_options);
1130 exit(0);
1131 break;
1132 }
1133 }
1134
1135 if (!has_input)
1136 printerr("No input specified !\n");
1137 if (!has_output)
1138 printerr("No output specified !\n");

Callers

nothing calls this directly

Calls 15

getopt_longFunction · 0.85
exitFunction · 0.85
printerrFunction · 0.85
read_physmemFunction · 0.85
is_valid_vbiosFunction · 0.85
free_foFunction · 0.85
parse_vbiosFunction · 0.85
parse_vbtFunction · 0.85
print_vbtFunction · 0.85
dump_vbtFunction · 0.85
write_fileFunction · 0.85
printFunction · 0.85

Tested by

no test coverage detected