28 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
29 |
* |
* |
30 |
* |
* |
31 |
* $Id: misc.h,v 1.241 2006/06/16 18:31:26 debug Exp $ |
* $Id: misc.h,v 1.242 2006/07/25 21:03:25 debug Exp $ |
32 |
* |
* |
33 |
* Misc. definitions for gxemul. |
* Misc. definitions for gxemul. |
34 |
*/ |
*/ |
112 |
#define EMUL_BIG_ENDIAN 1 |
#define EMUL_BIG_ENDIAN 1 |
113 |
|
|
114 |
#ifdef HOST_LITTLE_ENDIAN |
#ifdef HOST_LITTLE_ENDIAN |
115 |
|
#define LE16_TO_HOST(x) (x) |
116 |
|
#define BE16_TO_HOST(x) ((((x) & 0xff00) >> 8) | (((x)&0xff) << 8)) |
117 |
|
#else |
118 |
|
#define LE16_TO_HOST(x) ((((x) & 0xff00) >> 8) | (((x)&0xff) << 8)) |
119 |
|
#define BE16_TO_HOST(x) (x) |
120 |
|
#endif |
121 |
|
|
122 |
|
#ifdef HOST_LITTLE_ENDIAN |
123 |
#define LE32_TO_HOST(x) (x) |
#define LE32_TO_HOST(x) (x) |
124 |
#define BE32_TO_HOST(x) ((((x) & 0xff000000) >> 24) | ((x) << 24) | \ |
#define BE32_TO_HOST(x) ((((x) & 0xff000000) >> 24) | (((x)&0xff) << 24) | \ |
125 |
(((x) & 0xff0000) >> 8) | (((x) & 0xff00) << 8)) |
(((x) & 0xff0000) >> 8) | (((x) & 0xff00) << 8)) |
126 |
#else |
#else |
127 |
#define LE32_TO_HOST(x) ((((x) & 0xff000000) >> 24) | ((x) << 24) | \ |
#define LE32_TO_HOST(x) ((((x) & 0xff000000) >> 24) | (((x)&0xff) << 24) | \ |
128 |
(((x) & 0xff0000) >> 8) | (((x) & 0xff00) << 8)) |
(((x) & 0xff0000) >> 8) | (((x) & 0xff00) << 8)) |
129 |
#define BE32_TO_HOST(x) (x) |
#define BE32_TO_HOST(x) (x) |
130 |
#endif |
#endif |
131 |
|
|
132 |
|
|
133 |
/* Debug stuff: */ |
/* Debug stuff: */ |
134 |
#define DEBUG_BUFSIZE 1024 |
#define DEBUG_BUFSIZE 1024 |
135 |
#define DEBUG_INDENTATION 4 |
#define DEBUG_INDENTATION 4 |