Statistics
| Branch: | Revision:

root / libfdt_env.h @ d3922ab5

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 d3922ab5 Andreas Färber
#include "bswap.h"
23 f652e6af aurel32
24 d3922ab5 Andreas Färber
#ifdef HOST_WORDS_BIGENDIAN
25 f652e6af aurel32
#define fdt32_to_cpu(x)                (x)
26 f652e6af aurel32
#define cpu_to_fdt32(x)                (x)
27 f652e6af aurel32
#define fdt64_to_cpu(x)                (x)
28 f652e6af aurel32
#define cpu_to_fdt64(x)                (x)
29 f652e6af aurel32
#else
30 f652e6af aurel32
#define fdt32_to_cpu(x)                (bswap_32((x)))
31 f652e6af aurel32
#define cpu_to_fdt32(x)                (bswap_32((x)))
32 f652e6af aurel32
#define fdt64_to_cpu(x)                (bswap_64((x)))
33 f652e6af aurel32
#define cpu_to_fdt64(x)                (bswap_64((x)))
34 f652e6af aurel32
#endif
35 f652e6af aurel32
36 f652e6af aurel32
#endif /* _LIBFDT_ENV_H */