2007-09-17 07:42:36 +02:00
|
|
|
#include <endian.h>
|
|
|
|
|
|
|
|
#if __BYTE_ORDER == __BIG_ENDIAN
|
|
|
|
#define cell_to_fdt(x) (x)
|
|
|
|
#else
|
|
|
|
/* We do this as a big hairy expression instead of using bswap_32()
|
|
|
|
* because we need it to work in asm as well as C. */
|
|
|
|
#define cell_to_fdt(x) ((((x) >> 24) & 0xff) | (((x) >> 8) & 0xff00) \
|
|
|
|
| (((x) << 8) & 0xff0000) | (((x) << 24) & 0xff000000))
|
|
|
|
#endif
|
|
|
|
|
2007-10-10 09:12:12 +02:00
|
|
|
#ifdef __ASSEMBLY__
|
|
|
|
#define ASM_CONST_LL(x) (x)
|
|
|
|
#else
|
|
|
|
#define ASM_CONST_LL(x) (x##ULL)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define TEST_ADDR_1 ASM_CONST_LL(0xdeadbeef00000000)
|
|
|
|
#define TEST_SIZE_1 ASM_CONST_LL(0x100000)
|
2007-11-07 00:58:22 +01:00
|
|
|
#define TEST_ADDR_2 ASM_CONST_LL(123456789)
|
|
|
|
#define TEST_SIZE_2 ASM_CONST_LL(010000)
|
2007-10-10 09:12:12 +02:00
|
|
|
|
2007-09-17 07:42:36 +02:00
|
|
|
#define TEST_VALUE_1 cell_to_fdt(0xdeadbeef)
|
2007-11-07 00:58:22 +01:00
|
|
|
#define TEST_VALUE_2 cell_to_fdt(123456789)
|
2006-11-27 06:21:28 +01:00
|
|
|
|
|
|
|
#define TEST_STRING_1 "hello world"
|
2007-10-17 04:39:10 +02:00
|
|
|
#define TEST_STRING_2 "nastystring: \a\b\t\n\v\f\r\\\""
|
|
|
|
#define TEST_STRING_3 "\xde\xad\xbe\xef"
|
2006-11-27 06:21:28 +01:00
|
|
|
|
|
|
|
#ifndef __ASSEMBLY__
|
|
|
|
extern struct fdt_header _test_tree1;
|
2006-12-14 05:29:25 +01:00
|
|
|
extern struct fdt_header _truncated_property;
|
2006-11-27 06:21:28 +01:00
|
|
|
#endif /* ! __ASSEMBLY */
|