[FIX] Re: [RFC] Upgradeable read locks for USB (Try #2)

Inaky Perez Gonzalez (inaky@peloncho.fis.ucm.es)
Mon, 19 Jan 1998 17:57:37 +0100


>> After my novice-typical screw up with the upgradeable read locks,
>> I've come with another implementation. Following Linus' guides and
>> some thinking :) I've come with this implementation:

>> + asm volatile ( \
>> + "\n1: lock; incl %0" \
>> + "\n jc 3f" \

Gabriel> Wrong: the incl instruction does not affect the carry flag !

Thanks! first typo on the ground, patch goes:

--- linux/include/asm-i386/spinlock.h~ Mon Jan 19 14:36:04 1998
+++ linux/include/asm-i386/spinlock.h Mon Jan 19 17:52:59 1998
@@ -222,7 +222,7 @@
#define read_lock(rw) \
asm volatile ( \
"\n1: lock; incl %0" \
- "\n jc 3f" \
+ "\n js 3f" \
"\n2:" \
"\n.section .text.lock,\"ax\"" \
"\n3: testl $0x7fffffe,%0" \

Linux USB! -- http://peloncho.fis.ucm.es/~inaky/USB.html -
-
Inaky Perez Gonzalez -- PGP pubkey fingerprint -
inaky@peloncho.fis.ucm.es -- 8E 34 3A 62 64 99 E2 44 -
http://peloncho.fis.ucm.es/~inaky -- AD 7B 30 D9 DD FF 3E 4C -
-----------------------------------------------------------------
The loneliness of the long distance runner .....