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

Function print_bitdef

util/msrtool/msrutils.c:9–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7#include "msrtool.h"
8
9static void print_bitdef(FILE *f, const struct msrbits *mb, const char *tail) {
10 uint8_t endbit;
11 if (!reserved && 0 == strcmp(mb->name, "RSVD"))
12 return;
13 if (1 == mb->size)
14 fprintf(f, "# %5d", mb->start);
15 else {
16 endbit = mb->start - mb->size + 1;
17 fprintf(f, "# %*d:%d", endbit < 10 ? 3 : 2, mb->start, endbit);
18 }
19 if (0 == strcmp(mb->name, "RSVD"))
20 fprintf(f, " [%s]", mb->desc);
21 else
22 fprintf(f, " %s %s", mb->name, mb->desc);
23 fprintf(f, "%s", tail);
24}
25
26static void print_bitval(FILE *f, const struct msrbits *mb, const struct msr val) {
27 uint8_t i;

Callers 4

dumpmsrdefsFunction · 0.85
dumpmsrdefsvalsFunction · 0.85
decodemsrFunction · 0.85
diff_msrFunction · 0.85

Calls 2

fprintfFunction · 0.85
strcmpFunction · 0.50

Tested by

no test coverage detected