diff options
author | Nicholas Piggin <npiggin@gmail.com> | 2017-11-29 15:36:56 +1000 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2017-12-03 22:08:53 -0600 |
commit | 1486a08de557b8f237a066a57cc2c74961ba36e0 (patch) | |
tree | 493986a01191b9d5449fb43dc421a8ea7a1e1dc5 /include/processor.h | |
parent | 1e85912b921028bafa3a68fa286682a5d21a1223 (diff) | |
download | skiboot-1486a08de557b8f237a066a57cc2c74961ba36e0.zip skiboot-1486a08de557b8f237a066a57cc2c74961ba36e0.tar.gz skiboot-1486a08de557b8f237a066a57cc2c74961ba36e0.tar.bz2 |
core/lock: Introduce atomic cmpxchg and implement try_lock with it
cmpxchg will be used in a subsequent change, and this reduces the
amount of asm code.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
[stewart: fix some ifdef __TEST__ foo to ensure unittests work]
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'include/processor.h')
-rw-r--r-- | include/processor.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/processor.h b/include/processor.h index 77110d0..69c5d4a 100644 --- a/include/processor.h +++ b/include/processor.h @@ -233,6 +233,8 @@ static inline bool is_power9n(uint32_t version) return true; } +#ifndef __TEST__ + /* * SMT priority */ @@ -370,6 +372,8 @@ static inline void st_le32(uint32_t *addr, uint32_t val) asm volatile("stwbrx %0,0,%1" : : "r"(val), "r"(addr), "m"(*addr)); } +#endif /* __TEST__ */ + #endif /* __ASSEMBLY__ */ #endif /* __PROCESSOR_H */ |