summaryrefslogtreecommitdiff
path: root/physmap.c
diff options
context:
space:
mode:
authorstepan <stepan@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2009-09-04 13:57:07 +0000
committerstepan <stepan@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2009-09-04 13:57:07 +0000
commitce954937c29af574d639f8f702bfc0192c88d36b (patch)
tree403b199fd7a5bbac14997a53e90973f39bd0162d /physmap.c
parentb4edee3fd06aa3aec8c5db694858d35aaf4702e6 (diff)
downloadflashrom-ce954937c29af574d639f8f702bfc0192c88d36b.tar.gz
fix for gcc 4.4 strict aliasing rules.
Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@714 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'physmap.c')
-rw-r--r--physmap.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/physmap.c b/physmap.c
index 778a783..3a003fe 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;
}