Skip to contentSkip to conversation

__up_read and gcc-3.0

PATCH Petr Vandrovec 1 participant 1 message May 11, 2001

lore
Share & tools
lore
#0 lore raw
Quoted 11 lines · Tom Leete
Quoted 6 lines
        __asm__ __volatile__(
                "# beginning __up_read\n\t"
+               "  movl      %2,%%edx\n\t"
 LOCK_PREFIX    "  xadd      %%edx,(%%eax)\n\t" /* subtracts 1, returns the old value */
                "  js        2f\n\t" /* jump if the lock is being waited upon */
                "1:\n\t"

My solution to this was to relax +d(tmp) to +m(tmp). Posted a few days ago. I have larger problems with 2.4.5-pre1 and have not gone back to check what comes out. Being a product of pure reason (and not much of that), mine deserves suspicion.

Changing +d => +m could generate 'xadd (%%xyz),(%%eax)' which does not exist. Maybe +r, but in this case do not forget to add push/pop %%edx around call to rwsem_wake. Otherwise you can have some corruption if gcc decides to use %edx for some local variable around __up_read.
Best regards,
Petr Vandrovec [email protected]