1 /* Copyright (c) 2013 Corinna Vinschen <corinna@vinschen.de> */
2 #ifndef _MB_ENDIAN_H
3 #define _MB_ENDIAN_H
4 
5 /* Convenience macros for loading and store 4 bytes in a byte invariant way with
6  * a singe instruction. Endianess affects this and we rely on MicroBlaze
7  * load/store reverse instructions to do the trick on little-endian systems.
8  */
9 #ifdef __LITTLE_ENDIAN__
10 #define LOAD4BYTES(rD,rA,rB)   "\tlwr\t" rD ", " rA ", " rB "\n"
11 #define STORE4BYTES(rD,rA,rB)  "\tswr\t" rD ", " rA ", " rB "\n"
12 #else
13 #define LOAD4BYTES(rD,rA,rB)   "\tlw\t" rD ", " rA ", " rB "\n"
14 #define STORE4BYTES(rD,rA,rB)  "\tsw\t" rD ", " rA ", " rB "\n"
15 #endif
16 #endif
17