#include <nitro/mi.h>
u32 MI_SwapWord(
u32 setData,
volatile u32* destp );
u8 MI_SwapByte(
u32 setData,
volatile u8* destp );
This function swaps setData and the
data stored at *destp. This function implements spinlock to exclusively control resources that are shared between processors or modules.
MI_SwapByte() swaps byte data. MI_SwapWord() swaps word data.
Note that byte access to the main memory is possible only via cache in the TEG environment.
Therefore,MI_SwapWord() should be used for main memory.
This swaps using the ARM instructions swp or swpb.
setData |
The data that is set |
destp |
Pointer to the swap destination |
Value stored in the swap destination immediately prior to the swap.
None.
10/18/2004 Corrected the description of byte access.
02/10/2004 Initial version.