tech-kern archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: drop volatile from __cpu_simplelock_t typedef
On 26/06/15 14:51, Matt Thomas wrote:
__cpu_simpe_lock_unlock concerns me without volatile.
Why? Something to do with barriers?
Also, many have loops that count on the variable changing.
Without volatile those will become infinite loops.
Such as? I can only think of the "C debugging version" of simple_lock ;)
Can't those be fixed by making them call __SIMPLELOCK_LOCKED_P()? They
arguably should have been doing that in the first place anyway. Or are
you worried that we won't be able to catch all of them?
For RISC-V, I used the builtin C11-ish gcc atomics to implement
the __cpu_simple_lock_t operations. I just moved it to
<sys/common_lock.h> so other ports could use it.
More MI code is always nice, but what's the relevance to this
discussion? <sys/common_lock.h> should work the same with or without
volatile because the volatileness comes from atomic_store/exchange, no?
Anyway, I interpreted your reply as "sounds like a good idea, but there
may be some problems". If that's completely wrong, please be more explicit.
Home |
Main Index |
Thread Index |
Old Index