[processor-sdk/open-amp.git] / obsolete / system / generic / machine / zynq7 / linux-firmware / src / libfdt / types.h
1 #ifndef _LINUX_TYPES_H
2 #define _LINUX_TYPES_H
4 #include <stddef.h>
5 #include <stdlib.h>
6 #include <string.h>
8 #define cpu_to_be32(x) \
9 ((((x) & 0xff000000) >> 24) | \
10 (((x) & 0x00ff0000) >> 8) | \
11 (((x) & 0x0000ff00) << 8) | \
12 (((x) & 0x000000ff) << 24))
14 #define be32_to_cpu(x) \
15 ((((x) & 0xff000000) >> 24) | \
16 (((x) & 0x00ff0000) >> 8) | \
17 (((x) & 0x0000ff00) << 8) | \
18 (((x) & 0x000000ff) << 24))
20 #define cpu_to_be64(x) \
21 ((((x) & 0xff00000000000000ull) >> 56) | \
22 (((x) & 0x00ff000000000000ull) >> 40) | \
23 (((x) & 0x0000ff0000000000ull) >> 24) | \
24 (((x) & 0x000000ff00000000ull) >> 8) | \
25 (((x) & 0x00000000ff000000ull) << 8) | \
26 (((x) & 0x0000000000ff0000ull) << 24) | \
27 (((x) & 0x000000000000ff00ull) << 40) | \
28 (((x) & 0x00000000000000ffull) << 56))
30 #define be64_to_cpu(x) \
31 ((((x) & 0xff00000000000000ull) >> 56) | \
32 (((x) & 0x00ff000000000000ull) >> 40) | \
33 (((x) & 0x0000ff0000000000ull) >> 24) | \
34 (((x) & 0x000000ff00000000ull) >> 8) | \
35 (((x) & 0x00000000ff000000ull) << 8) | \
36 (((x) & 0x0000000000ff0000ull) << 24) | \
37 (((x) & 0x000000000000ff00ull) << 40) | \
38 (((x) & 0x00000000000000ffull) << 56))
40 #ifndef _STDINT_H
42 typedef unsigned char u_int8_t;
43 typedef char int8_t;
44 typedef unsigned short u_int16_t;
45 typedef short int16_t;
46 typedef unsigned int u_int32_t;
47 typedef int int32_t;
48 typedef unsigned char uint8_t;
49 typedef unsigned short uint16_t;
50 typedef unsigned int uint32_t;
51 typedef unsigned long long uint64_t;
52 typedef unsigned long long u_int64_t;
53 typedef long long int64_t;
55 typedef long intptr_t;
56 typedef unsigned long uintptr_t;
57 typedef unsigned int size_t;
59 #endif
61 typedef unsigned short fdt16_t;
62 typedef unsigned int fdt32_t;
63 typedef unsigned long long fdt64_t;
65 #define fdt32_to_cpu(x) be32_to_cpu(x)
66 #define cpu_to_fdt32(x) cpu_to_be32(x)
67 #define fdt64_to_cpu(x) be64_to_cpu(x)
68 #define cpu_to_fdt64(x) cpu_to_be64(x)
70 #endif /* _LINUX_TYPES_H */