| 97 | } |
| 98 | |
| 99 | void strprint(FILE *f, const struct msr val, const uint8_t bits) { |
| 100 | if (bits > 56) |
| 101 | fputc(val.hi, f); |
| 102 | if (bits > 48) |
| 103 | fputc(val.hi >> 8, f); |
| 104 | if (bits > 40) |
| 105 | fputc(val.hi >> 16, f); |
| 106 | if (bits > 32) |
| 107 | fputc(val.hi >> 24, f); |
| 108 | if (bits > 24) |
| 109 | fputc(val.lo, f); |
| 110 | if (bits > 16) |
| 111 | fputc(val.lo >> 8, f); |
| 112 | if (bits > 8) |
| 113 | fputc(val.lo >> 16, f); |
| 114 | if (bits > 0) |
| 115 | fputc(val.lo >> 24, f); |
| 116 | } |
| 117 | |
| 118 | int msr_eq(const struct msr a, const struct msr b) { |
| 119 | return a.hi == b.hi && a.lo == b.lo; |