On 09/14/2016 09:03 AM, Alex Bennée wrote:
>> > -/* Load/Store exclusive instructions are implemented by remembering
>> > -   the value/address loaded, and seeing if these are the same
>> > -   when the store is performed. This should be sufficient to implement
>> > -   the architecturally mandated semantics, and avoids having to monitor
>> > -   regular stores.
>> > -
>> > -   In system emulation mode only one CPU will be running at once, so
>> > -   this sequence is effectively atomic.  In user emulation mode we
>> > -   throw an exception and handle the atomic operation elsewhere.  */
> At least half of this comment is still relevant although it could be
> tweaked to mention that we use an atomic cmpxchg for the store that will
> fail if exlusive_val doesn't match the current state.
> 

Added back

/* Load/Store exclusive instructions are implemented by remembering
   the value/address loaded, and seeing if these are the same
   when the store is performed.  This should be sufficient to implement
   the architecturally mandated semantics, and avoids having to monitor
   regular stores.  The compare vs the remembered value is done during
   the cmpxchg operation, but we must compare the addresses manually.  */


r~

Reply via email to