Skip to contentSkip to conversation

bug in asm/rwlock.h?

DISCUSSION duane voth 1 participant 1 message Jul 17, 2001

lore
Share & tools
lore

duane voth

author
#0 lore raw

I was looking at the symetry in rwlock.h and noticed this:

	#define __build_read_lock_ptr(rw, helper)   \
		asm volatile(LOCK "subl $1,(%0)\n\t" \
		....

	#define __build_read_lock_const(rw, helper)   \
		asm volatile(LOCK "subl $1,%0\n\t" \
		....

	#define __build_write_lock_ptr(rw, helper) \
		asm volatile(LOCK "subl $" RW_LOCK_BIAS_STR ",(%0)\n\t" \
		....

	#define __build_write_lock_const(rw, helper) \
		asm volatile(LOCK "subl $" RW_LOCK_BIAS_STR ",(%0)\n\t" \
		....

Why is %0 used indirectly in __build_write_lock_const? Shouldn't it be

		asm volatile(LOCK "subl $" RW_LOCK_BIAS_STR ",%0\n\t" \

like in __build_read_lock_const?

It doesn't look like many people use __build_write_lock_const.

duane