--- In lpc2000@yahoogroups.com, "James Dabbs" <jdabbs@t...> wrote:
> Thanks for the insight on disabling/enabling interrupts.
>
> Along these lines, are there ways ("tricks") of doing atomic memory
> operations with ARM without disabling interrupts? Like test/set,
atomic
> increment, atomic decrement, or other interrupt/thread safe
operations?
You can use the SWP and SWPB instructions to atomicly swap a
register with memory. SWP swaps 32 bits, SWPB swaps 8 bits.
You can use these instructions to implement semaphores without
using interrupts. See page A9-11 of the ARM Architectural
Reference Manual for an example implementation.Message
Re: Atomic Operations w/ARM
2004-05-06 by bobbruce000
Attachments
- No local attachments were found for this message.