[coreboot] New patch to review for coreboot: 044489f xchg is atomic with side-effects

Patrick Georgi (patrick@georgi-clan.de) gerrit at coreboot.org
Sun Mar 11 20:48:56 CET 2012

Patrick Georgi (patrick at georgi-clan.de) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/783


commit 044489fc6f8e15eaafa4172186ec6a6fb79b4f90
Author: Patrick Georgi <patrick at georgi-clan.de>
Date:   Sun Mar 11 19:42:33 2012 +0100

    xchg is atomic with side-effects
    clang doesn't know about the side effect, so we have to tell it
    that it's okay not to care about the result.
    Change-Id: Ib11890bff6779e36cf09c178d224695ea16a8ae8
    Signed-off-by: Patrick Georgi <patrick at georgi-clan.de>
 src/include/cpu/x86/lapic.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/include/cpu/x86/lapic.h b/src/include/cpu/x86/lapic.h
index 8b44a6c..68608ed 100644
--- a/src/include/cpu/x86/lapic.h
+++ b/src/include/cpu/x86/lapic.h
@@ -108,7 +108,7 @@ static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int siz
 static inline void lapic_write_atomic(unsigned long reg, unsigned long v)
-	xchg((volatile unsigned long *)(LAPIC_DEFAULT_BASE+reg), v);
+	(void)xchg((volatile unsigned long *)(LAPIC_DEFAULT_BASE+reg), v);

More information about the coreboot mailing list