Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Dec 2018 19:14:51 +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: r342094 - head/sys/mips/include
Message-ID:  <201812141914.wBEJEp3W044240@repo.freebsd.org>

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

Log:
  atomic_fcmpset* return int, not the type of *.
  
  fcmpset returns true/false as a int, so make the return types and
  variables match the int to be consistent with other arch.
  
  Reviewed by: cognet@
  Differential Revision: https://reviews.freebsd.org/D18557

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

Modified: head/sys/mips/include/atomic.h
==============================================================================
--- head/sys/mips/include/atomic.h	Fri Dec 14 18:50:32 2018	(r342093)
+++ head/sys/mips/include/atomic.h	Fri Dec 14 19:14:51 2018	(r342094)
@@ -392,10 +392,10 @@ atomic_cmpset_rel_32(__volatile uint32_t *p, uint32_t 
 	return (atomic_cmpset_32(p, cmpval, newval));
 }
 
-static __inline uint32_t
+static __inline int
 atomic_fcmpset_32(__volatile uint32_t *p, uint32_t *cmpval, uint32_t newval)
 {
-	uint32_t ret;
+	int ret;
 
 	__asm __volatile (
 		"1:\n\t"
@@ -415,7 +415,7 @@ atomic_fcmpset_32(__volatile uint32_t *p, uint32_t *cm
 	return ret;
 }
 
-static __inline uint32_t
+static __inline int
 atomic_fcmpset_acq_32(__volatile uint32_t *p, uint32_t *cmpval, uint32_t newval)
 {
 	int retval;
@@ -425,7 +425,7 @@ atomic_fcmpset_acq_32(__volatile uint32_t *p, uint32_t
 	return (retval);
 }
 
-static __inline uint32_t
+static __inline int
 atomic_fcmpset_rel_32(__volatile uint32_t *p, uint32_t *cmpval, uint32_t newval)
 {
 	mips_sync();
@@ -502,10 +502,10 @@ atomic_cmpset_rel_64(__volatile uint64_t *p, uint64_t 
 	return (atomic_cmpset_64(p, cmpval, newval));
 }
 
-static __inline uint32_t
+static __inline int
 atomic_fcmpset_64(__volatile uint64_t *p, uint64_t *cmpval, uint64_t newval)
 {
-        uint32_t ret;
+        int ret;
 
         __asm __volatile (
                 "1:\n\t"
@@ -526,7 +526,7 @@ atomic_fcmpset_64(__volatile uint64_t *p, uint64_t *cm
 	return ret;
 }
 
-static __inline uint64_t
+static __inline int
 atomic_fcmpset_acq_64(__volatile uint64_t *p, uint64_t *cmpval, uint64_t newval)
 {
 	int retval;
@@ -536,7 +536,7 @@ atomic_fcmpset_acq_64(__volatile uint64_t *p, uint64_t
 	return (retval);
 }
 
-static __inline uint64_t
+static __inline int
 atomic_fcmpset_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?201812141914.wBEJEp3W044240>