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

Function main

util/ectool/ectool.c:63–172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61int verbose = 0, dump_idx = 0, dump_ram = 0, dump_query = 0, get_ports = 0;
62
63int main(int argc, char *argv[])
64{
65 int i, opt, option_index = 0;
66 long write_data = -1;
67 long write_addr = -1;
68
69 static struct option long_options[] = {
70 {"version", 0, 0, 'v'},
71 {"help", 0, 0, 'h'},
72 {"verbose", 0, 0, 'V'},
73 {"idx", 0, 0, 'i'},
74 {"query", 0, 0, 'q'},
75 {"getports", 0, 0, 'p'},
76 {0, 0, 0, 0}
77 };
78
79 if (argv[1] == NULL) {
80 print_usage(argv[0]);
81 exit(1);
82 }
83
84 while ((opt = getopt_long(argc, argv, "vh?Vidqpw:z:",
85 long_options, &option_index)) != EOF) {
86 switch (opt) {
87 case 'v':
88 print_version();
89 exit(0);
90 break;
91 case 'V':
92 verbose = 1;
93 break;
94 case 'i':
95 dump_idx = 1;
96 dump_ram = 1;
97 break;
98 case 'w':
99 write_addr = strtol(optarg , NULL, 16);
100 break;
101 case 'z':
102 write_data = strtol(optarg , NULL, 16);
103 break;
104 case 'd':
105 dump_ram = 1;
106 break;
107 case 'q':
108 dump_query = 1;
109 break;
110 case 'p':
111 get_ports = 1;
112 break;
113 case 'h':
114 case '?':
115 default:
116 print_usage(argv[0]);
117 exit(0);
118 break;
119 }
120 }

Callers

nothing calls this directly

Calls 12

exitFunction · 0.85
getopt_longFunction · 0.85
fprintfFunction · 0.85
get_ec_portsFunction · 0.85
printfFunction · 0.85
print_usageFunction · 0.70
print_versionFunction · 0.70
ec_writeFunction · 0.70
ec_readFunction · 0.70
ec_queryFunction · 0.70
ec_idx_readFunction · 0.70
strtolFunction · 0.50

Tested by

no test coverage detected