1 /*---------------------------------------------------------------------------*
2   Project:  TwlSDK - MI - include
3   File:     swap.h
4 
5   Copyright 2003-2008 Nintendo.  All rights reserved.
6 
7   These coded instructions, statements, and computer programs contain
8   proprietary information of Nintendo of America Inc. and/or Nintendo
9   Company Ltd., and are protected by Federal copyright law.  They may
10   not be disclosed to third parties or copied or duplicated in any form,
11   in whole or in part, without the prior written consent of Nintendo.
12 
13   $Date:: 2008-09-18#$
14   $Rev: 8573 $
15   $Author: okubata_ryoma $
16 
17  *---------------------------------------------------------------------------*/
18 
19 #ifndef NITRO_MI_SWAP_H_
20 #define NITRO_MI_SWAP_H_
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
26 #include <nitro/misc.h>
27 #include <nitro/types.h>
28 
29 /*---------------------------------------------------------------------------*
30   Name:         MI_SwapWord / MI_SwapByte
31 
32   Description:  swap data and memory
33 
34   Arguments:    setData      data to swap
35                 destp        memory address to swap
36 
37   Returns:      swapped memory data
38 
39   *Notice: Cannot access to main memory by byte unless cache.
40            Use MI_SwapWord() not MI_SwapByte basically.
41  *---------------------------------------------------------------------------*/
42 //---- by word
43 u32     MI_SwapWord(u32 setData, volatile u32 *destp);
44 
45 //---- by byte
46 u8      MI_SwapByte(u32 setData, volatile u8 *destp);
47 
48 
49 #ifdef __cplusplus
50 } /* extern "C" */
51 #endif
52 
53 /* NITRO_MI_SWAP_H_ */
54 #endif
55