Skip to contentSkip to conversation

testandset and cpu_interrupt

Qemu-devel Piotr Krysik 2 participants 2 messages Jun 1, 2004 – Jun 2, 2004

lore
Share & tools
lore
#0 lore raw

Hello,

Function testandset is referenced by cpu_interrupt, spin_lock and spin_trylock (spin_lock and spin_trylock

for CONFIG_USER_ONLY). All these invocations assume that testandset should return zero when lock is successfully acquired.

I noticed that implementation of testandset for x86 does opposite, i.e. returns NON-zero when lock is successfully acquired.

Before fixing the problem, it would be useful to check

implementation of testandset for other architectures, which I'm unable to do.

I'm very impressed with QEMU. Thanks for excellent work,

Piotrek

__________________________________
Do you Yahoo!?
Friends. Fun. Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/

#1 lore raw
Quoted 5 lines · Piotr Krysik

Hello,

Function testandset is referenced by cpu_interrupt, spin_lock and spin_trylock (spin_lock and spin_trylock

Quoted 7 lines

for CONFIG_USER_ONLY). All these invocations assume that testandset should return zero when lock is successfully acquired.

I noticed that implementation of testandset for x86 does opposite, i.e. returns NON-zero when lock is successfully acquired.

seems like m68k does the same.

Richard