]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - include/libfdt_env.h
libfdt: Import libfdt source (1 of 2)
[karo-tx-uboot.git] / include / libfdt_env.h
1 #ifndef _LIBFDT_ENV_H
2 #define _LIBFDT_ENV_H
3
4 #include <stddef.h>
5 #include <stdint.h>
6 #include <string.h>
7 #include <endian.h>
8 #include <byteswap.h>
9
10 #if __BYTE_ORDER == __BIG_ENDIAN
11 #define fdt32_to_cpu(x)         (x)
12 #define cpu_to_fdt32(x)         (x)
13 #define fdt64_to_cpu(x)         (x)
14 #define cpu_to_fdt64(x)         (x)
15 #else
16 #define fdt32_to_cpu(x)         (bswap_32((x)))
17 #define cpu_to_fdt32(x)         (bswap_32((x)))
18 #define fdt64_to_cpu(x)         (bswap_64((x)))
19 #define cpu_to_fdt64(x)         (bswap_64((x)))
20 #endif
21
22 #endif /* _LIBFDT_ENV_H */