| 40 | #endif |
| 41 | |
| 42 | int msr_bootguard(uint64_t *msr) |
| 43 | { |
| 44 | |
| 45 | #ifndef __DARWIN__ |
| 46 | fd_msr = open("/dev/cpu/0/msr", O_RDONLY); |
| 47 | if (fd_msr < 0) { |
| 48 | perror("Error while opening /dev/cpu/0/msr"); |
| 49 | printf("Did you run 'modprobe msr'?\n"); |
| 50 | return -1; |
| 51 | } |
| 52 | |
| 53 | if (rdmsr(MSR_BOOTGUARD, msr) < 0) |
| 54 | return -1; |
| 55 | #endif |
| 56 | |
| 57 | return 0; |
| 58 | } |
no test coverage detected