Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 25 Jan 2003 19:22:01 -0800 (PST)
From:      Juli Mallett <jmallett@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 24202 for review
Message-ID:  <200301260322.h0Q3M1jc023195@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=24202

Change 24202 by jmallett@jmallett_dalek on 2003/01/25 19:21:55

	Loop.

Affected files ...

.. //depot/projects/mips/sys/mips/include/atomic.h#4 edit

Differences ...

==== //depot/projects/mips/sys/mips/include/atomic.h#4 (text+ko) ====

@@ -27,38 +27,38 @@
 #ifndef	_MACHINE_ATOMIC_H_
 #define	_MACHINE_ATOMIC_H_
 
-static __inline int
+static __inline void
 atomic_set_int(int *p, int val)
 {
 	int temp;
 
 	__asm __volatile (
+	"1:\n\t"
 	"ll	%[temp], %[p]\n\t"
 	"or	%[temp], %[temp], %[val]\n\t"
 	"sc	%[temp], %[p]\n\t"
+	"beqz	%[temp], 1b\n\t"
 	: [val] "=r"(val)
 	: [temp] "r"(temp), [p] "r"(p)
 	: "memory"
 	);
-
-	return (temp);
 }
 
-static __inline long
+static __inline void
 atomic_set_long(long *p, long val)
 {
 	long temp;
 
 	__asm __volatile (
+	"1:\n\t"
 	"lld	%[temp], %[p]\n\t"
 	"or	%[temp], %[temp], %[val]\n\t"
 	"scd	%[temp], %[p]\n\t"
+	"beqz	%[temp], 1b\n\t"
 	: [val] "=r"(val)
 	: [temp] "r"(temp), [p] "r"(p)
 	: "memory"
 	);
-
-	return (temp);
 }
 
 #endif /* !_MACHINE_ATOMIC_H_ */

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe p4-projects" in the body of the message




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