[coreboot-gerrit] New patch to review for coreboot: 3ded1e9 libpayload: x86: correct types used for writel/readl

Aaron Durbin (adurbin@chromium.org) gerrit at coreboot.org
Tue May 12 23:51:37 CEST 2015


Aaron Durbin (adurbin at chromium.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/10186

-gerrit

commit 3ded1e93d41b10d812e9da327f201910d5f6e777
Author: Aaron Durbin <adurbin at chromium.org>
Date:   Tue May 12 16:46:27 2015 -0500

    libpayload: x86: correct types used for writel/readl
    
    libpayload on x86 defines u32 and uint32_t as typedefs of
    unsigned int. However, the readl/writel routines use long.
    With alias checking this throws type punning errors. Align
    the readl/writel types with the 32-bit fixed width ones that
    are exposed.
    
    Change-Id: Ie51cff8af4596948f6132e3cb743f1bc4ea8f204
    Signed-off-by: Aaron Durbin <adurbin at chromium.org>
---
 payloads/libpayload/include/x86/arch/io.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/payloads/libpayload/include/x86/arch/io.h b/payloads/libpayload/include/x86/arch/io.h
index 0cb610f..de53c15 100644
--- a/payloads/libpayload/include/x86/arch/io.h
+++ b/payloads/libpayload/include/x86/arch/io.h
@@ -33,11 +33,11 @@
 
 #define readb(_a) (*(volatile const unsigned char *) (_a))
 #define readw(_a) (*(volatile const unsigned short *) (_a))
-#define readl(_a) (*(volatile const unsigned long *) (_a))
+#define readl(_a) (*(volatile const 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))
 
 static inline unsigned long inl(int port)
 {



More information about the coreboot-gerrit mailing list