summaryrefslogtreecommitdiff
path: root/core/minute-ia/atomic.h
diff options
context:
space:
mode:
authorJett Rink <jettrink@chromium.org>2019-01-08 10:22:09 -0700
committerchrome-bot <chrome-bot@chromium.org>2019-01-08 14:33:35 -0800
commit7ced9b2e02cdb49b78384ecb93978c1bab5cd015 (patch)
tree3e15d11209f38bf203063bbce00717777dca29bc /core/minute-ia/atomic.h
parent9e4474e561ec165cf24e8aa249c2aeeed8e7f1ef (diff)
downloadchrome-ec-7ced9b2e02cdb49b78384ecb93978c1bab5cd015.tar.gz
ish: remove lock; prefix from inline ASM
Since all instances of minute-ia core are a single core, the lock; prefix on statements does not have any meaningful affect other than a potential performance hit. We still want to mark inline asm where it would matter, so we introduce a new define that evaluates to empty today. BRANCH=atlas_ish BUG=none TEST=builds Change-Id: I47506951dfdabfdbd16ae825fe742b01b44205d1 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1401014 Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'core/minute-ia/atomic.h')
-rw-r--r--core/minute-ia/atomic.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/minute-ia/atomic.h b/core/minute-ia/atomic.h
index 08f0888cdf..00dce90607 100644
--- a/core/minute-ia/atomic.h
+++ b/core/minute-ia/atomic.h
@@ -13,7 +13,7 @@
#define ATOMIC_OP(asm_op, a, v) do { \
__asm__ __volatile__ ( \
- "lock;" #asm_op " %1, %0\n" \
+ ASM_LOCK_PREFIX #asm_op " %1, %0\n" \
: "+m" (*a) \
: "ir" (v) \
: "memory"); \
@@ -24,7 +24,7 @@ static inline int bool_compare_and_swap_u32(uint32_t *var, uint32_t old_value,
{
uint32_t _old_value = old_value;
- __asm__ __volatile__("lock; cmpxchgl %2, %1"
+ __asm__ __volatile__(ASM_LOCK_PREFIX "cmpxchgl %2, %1"
: "=a" (old_value), "+m" (*var)
: "r" (new_value), "0" (old_value)
: "memory");
@@ -74,7 +74,7 @@ static inline uint32_t atomic_read_clear(uint32_t volatile *addr)
if (*addr == 0)
return 0;
- asm volatile("lock; xchgl %0, %1\n"
+ asm volatile(ASM_LOCK_PREFIX "xchgl %0, %1\n"
: "+r" (ret), "+m" (*addr)
: : "memory", "cc");