__up_read and gcc-3.0
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]