Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: Atomic Operations w/ARM

2004-05-06 by bobbruce000

--- 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.

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.