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

Function msr_bootguard

util/intelmetool/src/msr.c:42–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40#endif
41
42int 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}

Callers 1

dump_bootguard_infoFunction · 0.85

Calls 3

perrorFunction · 0.85
printfFunction · 0.85
rdmsrFunction · 0.70

Tested by

no test coverage detected