[coreboot] New patch to review for coreboot: ad72d0a libpayload: Use the same type for 32 bit data in readl as in uint32_t.

Ronald G. Minnich (rminnich@gmail.com) gerrit at coreboot.org
Fri Feb 15 02:36:36 CET 2013

Ronald G. Minnich (rminnich at gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/2411


commit ad72d0aaac828c4306d8d94bea2770cdae06e19f
Author: Ronald G. Minnich <rminnich at gmail.com>
Date:   Thu Feb 14 17:35:49 2013 -0800

    libpayload: Use the same type for 32 bit data in readl as in uint32_t.
    The compiler gets mad when the types are equivalent size but not necessarily
    interchangeable because of strict aliasing checks. Since uint32_t is likely to
    be used when trying to read 32 bit data, it makes sense for them to be the
    Signed-off-by: Gabe Black <gabeblack at google.com>
    Change-Id: If73d794866055dc026fc06d6268e692adac0f835
    Signed-off-by: Ronald G. Minnich <rminnich at gmail.com>
 payloads/libpayload/include/armv7/arch/io.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/payloads/libpayload/include/armv7/arch/io.h b/payloads/libpayload/include/armv7/arch/io.h
index e71e1dd..807dc1d 100644
--- a/payloads/libpayload/include/armv7/arch/io.h
+++ b/payloads/libpayload/include/armv7/arch/io.h
@@ -33,10 +33,10 @@
 #define readb(_a) (*(volatile unsigned char *) (_a))
 #define readw(_a) (*(volatile unsigned short *) (_a))
-#define readl(_a) (*(volatile unsigned long *) (_a))
+#define readl(_a) (*(volatile unsigned int *) (_a))
 #define writeb(_v, _a) (*(volatile unsigned char *) (_a) = (_v))
 #define writew(_v, _a) (*(volatile unsigned short *) (_a) = (_v))
-#define writel(_v, _a) (*(volatile unsigned long *) (_a) = (_v))
+#define writel(_v, _a) (*(volatile unsigned int *) (_a) = (_v))

More information about the coreboot mailing list