#include <nitro/mi.h>
u32 MI_SwapWord( u32 setData, volatile u32* destp );
u8 MI_SwapByte( u32 setData, volatile u8* destp );
setData | The data that is set |
destp | Pointer to the swap destination |
Value stored in the swap destination immediately prior to the swap.
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
.
None.
2004/10/18 Corrected the description of byte access.
2004/02/10 Initial version.
CONFIDENTIAL