From: Richard C. <rd_...@sb...> - 2003-11-23 19:33:36
|
I just solved the TMThread.cpp problem on xcode. :) Look for the definition of sTestAndSet #if ZCONFIG(Processor, PPC) #ifdef __GNUC__ bool sTestAndSet(register int32& ioInt32) { register bool result; asm { // Get the current value of theLong into r5, and reserve the address tryagain: lwarx r5, 0, r3 // ioInt32 is in r3 // Set bit 7 of r4 (so we have the same effect as 68K tas instruction) ori r4, r5, 0x80 // Stick the new value back into theLong. stwcx. r4, 0, r3 // ioInt32 // If the operation was interrupted between the lwarx and the stwcx, then // the eq bit will be set, so branch back and try again bne tryagain // If we get here then the bit has been set. Now check to see if it was set // before we started. andi. r5, r5, 0x80 bne wasSet li result, 0 // we could just shove the result in r0, but that would be obscure b done wasSet: li result, 1 done: } return result; } #else static asm bool sTestAndSet(register int32& ioInt32) { |