aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--physmap.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/physmap.c b/physmap.c
index 778a783d..3a003fee 100644
--- a/physmap.c
+++ b/physmap.c
@@ -133,7 +133,7 @@ static int fd_msr = -1;
msr_t rdmsr(int addr)
{
- uint8_t buf[8];
+ uint32_t buf[2];
msr_t msr = { 0xffffffff, 0xffffffff };
if (lseek(fd_msr, (off_t) addr, SEEK_SET) == -1) {
@@ -143,8 +143,8 @@ msr_t rdmsr(int addr)
}
if (read(fd_msr, buf, 8) == 8) {
- msr.lo = *(uint32_t *)buf;
- msr.hi = *(uint32_t *)(buf + 4);
+ msr.lo = buf[0];
+ msr.hi = buf[1];
return msr;
}