Hello Thomas,
I have build an implementation for the routine
futex_atomic_cmpxchg_inatomic() to make PTHREAD_PRIO_INHERIT mutex
work on ARM.
Compared to other architectures where CPU specific assembler is used,
it is probably not the most optimal implementation possible, but I
tested it successfully on a Atmel AT91RM9200 core, and it could work
on other (UP) architectures as well.
What do you think of it?
Or do you know a better solution?
Kind Regards,
Remy
patch format problem: never diff the asm/ files, diff the asm-arm/ files.
Yeah, of course, I know, I believe I made a real mess of this one ...
is it safe to do a get_user() with irqs off?
rhetorical question ;-))
I was wondering, Is it safe to use a normal spinlock here, like this?
------- 8-< -------------
spin_lock(&futex_lock);
err = get_user(uval, uaddr);
if ((!err) && (uval == oldval))
err = put_user(newval, uaddr);
spin_unlock(&futex_lock);
------- 8-< -------------
is this method of atomic ops SMP-safe?
another rhetorical question ;-))
Nope, I already knew that, that why I mentioned that it probably only
worked on UP...
Remy
Hello Thomas,
I have build an implementation for the routine
futex_atomic_cmpxchg_inatomic() to make PTHREAD_PRIO_INHERIT mutex
work on ARM.
Compared to other architectures where CPU specific assembler is used,
it is probably not the most optimal implementation possible, but I
tested it successfully on a Atmel AT91RM9200 core, and it could work
on other (UP) architectures as well.
What do you think of it?
Or do you know a better solution?
May be you could have a look at __kuser_cmpxchg (arch/arm/kernel/entry-armv.S).
There stuff for smp for armv6 and newer.
For armv5 and older, maybe masking interrupt is the best solution.
But I believe you should CC arm linux mailling list. You should find more arm
expert :)
Matthieu