summaryrefslogtreecommitdiffstats
path: root/physmap.c
diff options
context:
space:
mode:
authorStefan Reinauer <stepan@coresystems.de>2009-09-04 13:57:07 +0000
committerStefan Reinauer <stefan.reinauer@coreboot.org>2009-09-04 13:57:07 +0000
commit95e892b9d35c82ad372af4e9fab22f1c395ebc2d (patch)
tree403b199fd7a5bbac14997a53e90973f39bd0162d /physmap.c
parent34eae34922b1ffe2f9cac7a0cc3b68681c14a951 (diff)
downloadast2050-flashrom-95e892b9d35c82ad372af4e9fab22f1c395ebc2d.zip
ast2050-flashrom-95e892b9d35c82ad372af4e9fab22f1c395ebc2d.tar.gz
Fix for gcc 4.4 strict aliasing rules
Corresponding to flashrom svn r714. Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
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;
}
OpenPOWER on IntegriCloud