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