Statistics
| Branch: | Revision:

root / libfdt_env.h @ a74cdab4

History | View | Annotate | Download (1.1 kB)

1 f652e6af aurel32
/*
2 f652e6af aurel32
 * This program is free software; you can redistribute it and/or modify
3 f652e6af aurel32
 * it under the terms of the GNU General Public License, version 2, as
4 f652e6af aurel32
 * published by the Free Software Foundation.
5 f652e6af aurel32
 *
6 f652e6af aurel32
 * This program is distributed in the hope that it will be useful,
7 f652e6af aurel32
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
8 f652e6af aurel32
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
9 f652e6af aurel32
 * GNU General Public License for more details.
10 f652e6af aurel32
 *
11 f652e6af aurel32
 * You should have received a copy of the GNU General Public License
12 8167ee88 Blue Swirl
 * along with this program; if not, see <http://www.gnu.org/licenses/>.
13 f652e6af aurel32
 *
14 f652e6af aurel32
 * Copyright IBM Corp. 2008
15 f652e6af aurel32
 * Authors: Hollis Blanchard <hollisb@us.ibm.com>
16 f652e6af aurel32
 *
17 f652e6af aurel32
 */
18 f652e6af aurel32
19 f652e6af aurel32
#ifndef _LIBFDT_ENV_H
20 f652e6af aurel32
#define _LIBFDT_ENV_H
21 f652e6af aurel32
22 f652e6af aurel32
#include <stddef.h>
23 f652e6af aurel32
#include <stdint.h>
24 f652e6af aurel32
#include <string.h>
25 f652e6af aurel32
#include <endian.h>
26 f652e6af aurel32
#include <byteswap.h>
27 f652e6af aurel32
28 f652e6af aurel32
#if __BYTE_ORDER == __BIG_ENDIAN
29 f652e6af aurel32
#define fdt32_to_cpu(x)                (x)
30 f652e6af aurel32
#define cpu_to_fdt32(x)                (x)
31 f652e6af aurel32
#define fdt64_to_cpu(x)                (x)
32 f652e6af aurel32
#define cpu_to_fdt64(x)                (x)
33 f652e6af aurel32
#else
34 f652e6af aurel32
#define fdt32_to_cpu(x)                (bswap_32((x)))
35 f652e6af aurel32
#define cpu_to_fdt32(x)                (bswap_32((x)))
36 f652e6af aurel32
#define fdt64_to_cpu(x)                (bswap_64((x)))
37 f652e6af aurel32
#define cpu_to_fdt64(x)                (bswap_64((x)))
38 f652e6af aurel32
#endif
39 f652e6af aurel32
40 f652e6af aurel32
#endif /* _LIBFDT_ENV_H */