source: trunk/libs/newlib/src/newlib/libc/machine/microblaze/mb_endian.h @ 444

Last change on this file since 444 was 444, checked in by satin@…, 6 years ago

add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc

File size: 581 bytes
Line 
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
Note: See TracBrowser for help on using the repository browser.