Statistics
| Branch: | Revision:

root / libfdt_env.h @ 79d342dc

History | View | Annotate | Download (1.2 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 f652e6af aurel32
 * along with this program; if not, write to the Free Software
13 f652e6af aurel32
 * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
14 f652e6af aurel32
 *
15 f652e6af aurel32
 * Copyright IBM Corp. 2008
16 f652e6af aurel32
 * Authors: Hollis Blanchard <hollisb@us.ibm.com>
17 f652e6af aurel32
 *
18 f652e6af aurel32
 */
19 f652e6af aurel32
20 f652e6af aurel32
#ifndef _LIBFDT_ENV_H
21 f652e6af aurel32
#define _LIBFDT_ENV_H
22 f652e6af aurel32
23 f652e6af aurel32
#include <stddef.h>
24 f652e6af aurel32
#include <stdint.h>
25 f652e6af aurel32
#include <string.h>
26 f652e6af aurel32
#include <endian.h>
27 f652e6af aurel32
#include <byteswap.h>
28 f652e6af aurel32
29 f652e6af aurel32
#if __BYTE_ORDER == __BIG_ENDIAN
30 f652e6af aurel32
#define fdt32_to_cpu(x)                (x)
31 f652e6af aurel32
#define cpu_to_fdt32(x)                (x)
32 f652e6af aurel32
#define fdt64_to_cpu(x)                (x)
33 f652e6af aurel32
#define cpu_to_fdt64(x)                (x)
34 f652e6af aurel32
#else
35 f652e6af aurel32
#define fdt32_to_cpu(x)                (bswap_32((x)))
36 f652e6af aurel32
#define cpu_to_fdt32(x)                (bswap_32((x)))
37 f652e6af aurel32
#define fdt64_to_cpu(x)                (bswap_64((x)))
38 f652e6af aurel32
#define cpu_to_fdt64(x)                (bswap_64((x)))
39 f652e6af aurel32
#endif
40 f652e6af aurel32
41 f652e6af aurel32
#endif /* _LIBFDT_ENV_H */