blob: 90d7f3b162ccea53958aa1a6d05049c9f53ac56f [file] [log] [blame]
aurel32f652e6a2008-12-16 10:43:48 +00001/*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License, version 2, as
4 * published by the Free Software Foundation.
5 *
6 * This program is distributed in the hope that it will be useful,
7 * but WITHOUT ANY WARRANTY; without even the implied warranty of
8 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 * GNU General Public License for more details.
10 *
11 * You should have received a copy of the GNU General Public License
Blue Swirl8167ee82009-07-16 20:47:01 +000012 * along with this program; if not, see <http://www.gnu.org/licenses/>.
aurel32f652e6a2008-12-16 10:43:48 +000013 *
14 * Copyright IBM Corp. 2008
15 * Authors: Hollis Blanchard <hollisb@us.ibm.com>
16 *
17 */
18
19#ifndef _LIBFDT_ENV_H
20#define _LIBFDT_ENV_H
21
Andreas Färberd3922ab2011-05-28 15:45:18 +020022#include "bswap.h"
aurel32f652e6a2008-12-16 10:43:48 +000023
Andreas Färberd3922ab2011-05-28 15:45:18 +020024#ifdef HOST_WORDS_BIGENDIAN
aurel32f652e6a2008-12-16 10:43:48 +000025#define fdt32_to_cpu(x) (x)
26#define cpu_to_fdt32(x) (x)
27#define fdt64_to_cpu(x) (x)
28#define cpu_to_fdt64(x) (x)
29#else
30#define fdt32_to_cpu(x) (bswap_32((x)))
31#define cpu_to_fdt32(x) (bswap_32((x)))
32#define fdt64_to_cpu(x) (bswap_64((x)))
33#define cpu_to_fdt64(x) (bswap_64((x)))
34#endif
35
36#endif /* _LIBFDT_ENV_H */