Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F171264928
D21836.id62735.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D21836.id62735.diff
View Options
Index: sys/mips/include/atomic.h
===================================================================
--- sys/mips/include/atomic.h
+++ sys/mips/include/atomic.h
@@ -398,17 +398,16 @@
int ret;
__asm __volatile (
- "1:\n\t"
"ll %0, %1\n\t" /* load old value */
- "bne %0, %4, 2f\n\t" /* compare */
+ "bne %0, %4, 1f\n\t" /* compare */
"move %0, %3\n\t" /* value to store */
"sc %0, %1\n\t" /* attempt to store */
- "beqz %0, 1b\n\t" /* if it failed, spin */
- "j 3f\n\t"
- "2:\n\t"
+ "j 2f\n\t" /* exit on failure */
+ "nop\n\t" /* avoid delay slot accident */
+ "1:\n\t"
"sw %0, %2\n\t" /* save old value */
"li %0, 0\n\t"
- "3:\n"
+ "2:\n"
: "=&r" (ret), "+m" (*p), "=m" (*cmpval)
: "r" (newval), "r" (*cmpval)
: "memory");
@@ -508,17 +507,16 @@
int ret;
__asm __volatile (
- "1:\n\t"
"lld %0, %1\n\t" /* load old value */
- "bne %0, %4, 2f\n\t" /* compare */
+ "bne %0, %4, 1f\n\t" /* compare */
"move %0, %3\n\t" /* value to store */
"scd %0, %1\n\t" /* attempt to store */
- "beqz %0, 1b\n\t" /* if it failed, spin */
- "j 3f\n\t"
- "2:\n\t"
+ "j 2f\n\t" /* exit on failure */
+ "nop\n\t" /* avoid delay slot accident */
+ "1:\n\t"
"sd %0, %2\n\t" /* save old value */
"li %0, 0\n\t"
- "3:\n"
+ "2:\n"
: "=&r" (ret), "+m" (*p), "=m" (*cmpval)
: "r" (newval), "r" (*cmpval)
: "memory");
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Sep 10, 11:26 PM (8 h, 38 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38672810
Default Alt Text
D21836.id62735.diff (1 KB)
Attached To
Mode
D21836: mips: fcmpset: do not spin on sc failure
Attached
Detach File
Event Timeline
Log In to Comment