[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen master] x86: drop unused barrier parameter from build_{read, write}_atomic()
commit 8fd2fe0bbfcccae53c813b08911b48fd89ebc104 Author: Jan Beulich <jbeulich@xxxxxxxx> AuthorDate: Mon Jun 12 09:31:34 2017 +0200 Commit: Jan Beulich <jbeulich@xxxxxxxx> CommitDate: Mon Jun 12 09:31:34 2017 +0200 x86: drop unused barrier parameter from build_{read,write}_atomic() Also take the opportunity and make an attempt at making the macro definitions readable. Drop pointless casts while doing so. Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx> Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx> --- xen/include/asm-x86/atomic.h | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/xen/include/asm-x86/atomic.h b/xen/include/asm-x86/atomic.h index b997a17..682bcf9 100644 --- a/xen/include/asm-x86/atomic.h +++ b/xen/include/asm-x86/atomic.h @@ -4,15 +4,19 @@ #include <xen/atomic.h> #include <asm/system.h> -#define build_read_atomic(name, size, type, reg, barrier) \ +#define build_read_atomic(name, size, type, reg) \ static inline type name(const volatile type *addr) \ -{ type ret; asm volatile("mov" size " %1,%0":reg (ret) \ -:"m" (*(volatile type *)addr) barrier); return ret; } +{ \ + type ret; \ + asm volatile ( "mov" size " %1,%0" : reg (ret) : "m" (*addr) ); \ + return ret; \ +} -#define build_write_atomic(name, size, type, reg, barrier) \ +#define build_write_atomic(name, size, type, reg) \ static inline void name(volatile type *addr, type val) \ -{ asm volatile("mov" size " %1,%0": "=m" (*(volatile type *)addr) \ -:reg (val) barrier); } +{ \ + asm volatile ( "mov" size " %1,%0" : "=m" (*addr) : reg (val) ); \ +} #define build_add_sized(name, size, type, reg) \ static inline void name(volatile type *addr, type val) \ @@ -22,15 +26,15 @@ static inline void name(volatile type *addr, type val) \ : reg (val)); \ } -build_read_atomic(read_u8_atomic, "b", uint8_t, "=q", ) -build_read_atomic(read_u16_atomic, "w", uint16_t, "=r", ) -build_read_atomic(read_u32_atomic, "l", uint32_t, "=r", ) -build_read_atomic(read_u64_atomic, "q", uint64_t, "=r", ) +build_read_atomic(read_u8_atomic, "b", uint8_t, "=q") +build_read_atomic(read_u16_atomic, "w", uint16_t, "=r") +build_read_atomic(read_u32_atomic, "l", uint32_t, "=r") +build_read_atomic(read_u64_atomic, "q", uint64_t, "=r") -build_write_atomic(write_u8_atomic, "b", uint8_t, "q", ) -build_write_atomic(write_u16_atomic, "w", uint16_t, "r", ) -build_write_atomic(write_u32_atomic, "l", uint32_t, "r", ) -build_write_atomic(write_u64_atomic, "q", uint64_t, "r", ) +build_write_atomic(write_u8_atomic, "b", uint8_t, "q") +build_write_atomic(write_u16_atomic, "w", uint16_t, "r") +build_write_atomic(write_u32_atomic, "l", uint32_t, "r") +build_write_atomic(write_u64_atomic, "q", uint64_t, "r") build_add_sized(add_u8_sized, "b", uint8_t, "qi") build_add_sized(add_u16_sized, "w", uint16_t, "ri") -- generated by git-patchbot for /home/xen/git/xen.git#master _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxx https://lists.xenproject.org/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |