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

Function msraddrbyname

util/msrtool/msrutils.c:167–181  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

165}
166
167uint32_t msraddrbyname(const char *name) {
168 uint8_t t;
169 const uint32_t addr = strtoul(name, NULL, 16);
170 const struct msrdef *m;
171 if (!targets)
172 return addr;
173 for (t = 0; t < targets_found; t++)
174 for (m = targets[t]->msrs; !MSR_ISEOT(*m); m++) {
175 if (addr == m->addr)
176 return m->addr;
177 if (!strcasecmp(name, m->symbol))
178 return m->addr;
179 }
180 return addr;
181}
182
183void dumpmsrdefs(const struct targetdef *t) {
184 const struct msrdef *m;

Callers 1

mainFunction · 0.85

Calls 2

strcasecmpFunction · 0.85
strtoulFunction · 0.50

Tested by

no test coverage detected