| 7 | #include "msrtool.h" |
| 8 | |
| 9 | static 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 | |
| 26 | static void print_bitval(FILE *f, const struct msrbits *mb, const struct msr val) { |
| 27 | uint8_t i; |
no test coverage detected