git: 141443a6dd4a - stable/12 - atomic_cmpset return value is also an int.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 06 Oct 2021 19:46:51 UTC
The branch stable/12 has been updated by kevans:
URL: https://cgit.FreeBSD.org/src/commit/?id=141443a6dd4afc5139e5955efc9d27a61326646f
commit 141443a6dd4afc5139e5955efc9d27a61326646f
Author: Warner Losh <imp@FreeBSD.org>
AuthorDate: 2018-12-14 19:48:42 +0000
Commit: Kyle Evans <kevans@FreeBSD.org>
CommitDate: 2021-10-06 19:46:03 +0000
atomic_cmpset return value is also an int.
(cherry picked from commit 3d060215a5013c72b968aa5163833fa31fc92913)
---
sys/mips/include/atomic.h | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/sys/mips/include/atomic.h b/sys/mips/include/atomic.h
index 0e014cd57ac4..9fe1439b721f 100644
--- a/sys/mips/include/atomic.h
+++ b/sys/mips/include/atomic.h
@@ -362,10 +362,10 @@ ATOMIC_STORE_LOAD(64)
* two values are equal, update the value of *p with newval. Returns
* zero if the compare failed, nonzero otherwise.
*/
-static __inline uint32_t
+static __inline int
atomic_cmpset_32(__volatile uint32_t *p, uint32_t cmpval, uint32_t newval)
{
- uint32_t ret;
+ int ret;
__asm __volatile (
"1:\tll %0, %4\n\t" /* load old value */
@@ -389,7 +389,7 @@ atomic_cmpset_32(__volatile uint32_t *p, uint32_t cmpval, uint32_t newval)
* two values are equal, update the value of *p with newval. Returns
* zero if the compare failed, nonzero otherwise.
*/
-static __inline uint32_t
+static __inline int
atomic_cmpset_acq_32(__volatile uint32_t *p, uint32_t cmpval, uint32_t newval)
{
int retval;
@@ -399,7 +399,7 @@ atomic_cmpset_acq_32(__volatile uint32_t *p, uint32_t cmpval, uint32_t newval)
return (retval);
}
-static __inline uint32_t
+static __inline int
atomic_cmpset_rel_32(__volatile uint32_t *p, uint32_t cmpval, uint32_t newval)
{
mips_sync();
@@ -471,10 +471,10 @@ atomic_fetchadd_32(__volatile uint32_t *p, uint32_t v)
* two values are equal, update the value of *p with newval. Returns
* zero if the compare failed, nonzero otherwise.
*/
-static __inline uint64_t
+static __inline int
atomic_cmpset_64(__volatile uint64_t *p, uint64_t cmpval, uint64_t newval)
{
- uint64_t ret;
+ int ret;
__asm __volatile (
"1:\n\t"
@@ -499,7 +499,7 @@ atomic_cmpset_64(__volatile uint64_t *p, uint64_t cmpval, uint64_t newval)
* two values are equal, update the value of *p with newval. Returns
* zero if the compare failed, nonzero otherwise.
*/
-static __inline uint64_t
+static __inline int
atomic_cmpset_acq_64(__volatile uint64_t *p, uint64_t cmpval, uint64_t newval)
{
int retval;
@@ -509,7 +509,7 @@ atomic_cmpset_acq_64(__volatile uint64_t *p, uint64_t cmpval, uint64_t newval)
return (retval);
}
-static __inline uint64_t
+static __inline int
atomic_cmpset_rel_64(__volatile uint64_t *p, uint64_t cmpval, uint64_t newval)
{
mips_sync();