Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Dec 2018 19:48:42 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r342095 - head/sys/mips/include
Message-ID:  <201812141948.wBEJmg4K060300@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: imp
Date: Fri Dec 14 19:48:42 2018
New Revision: 342095
URL: https://svnweb.freebsd.org/changeset/base/342095

Log:
  atomic_cmpset return value is also an int.

Modified:
  head/sys/mips/include/atomic.h

Modified: head/sys/mips/include/atomic.h
==============================================================================
--- head/sys/mips/include/atomic.h	Fri Dec 14 19:14:51 2018	(r342094)
+++ head/sys/mips/include/atomic.h	Fri Dec 14 19:48:42 2018	(r342095)
@@ -348,10 +348,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 */
@@ -375,7 +375,7 @@ atomic_cmpset_32(__volatile uint32_t *p, uint32_t cmpv
  * 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;
@@ -385,7 +385,7 @@ atomic_cmpset_acq_32(__volatile uint32_t *p, uint32_t 
 	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();
@@ -457,10 +457,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"
@@ -485,7 +485,7 @@ atomic_cmpset_64(__volatile uint64_t *p, uint64_t cmpv
  * 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;
@@ -495,7 +495,7 @@ atomic_cmpset_acq_64(__volatile uint64_t *p, uint64_t 
 	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();



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201812141948.wBEJmg4K060300>