Author: stepan Date: 2009-09-04 15:57:07 +0200 (Fri, 04 Sep 2009) New Revision: 714
Modified: trunk/physmap.c Log: 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
Modified: trunk/physmap.c =================================================================== --- trunk/physmap.c 2009-09-02 23:27:45 UTC (rev 713) +++ trunk/physmap.c 2009-09-04 13:57:07 UTC (rev 714) @@ -133,7 +133,7 @@
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 @@ }
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; }