etrax: Update ethernet mgm-ctrl reg on writes
[qemu/agraf.git] / libfdt_env.h
blobee0419f7ce90b21bcb710e835820edd68cde5b32
1 /*
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.
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.
11 * You should have received a copy of the GNU General Public License
12 * along with this program; if not, see <http://www.gnu.org/licenses/>.
14 * Copyright IBM Corp. 2008
15 * Authors: Hollis Blanchard <hollisb@us.ibm.com>
19 #ifndef _LIBFDT_ENV_H
20 #define _LIBFDT_ENV_H
22 #include <stddef.h>
23 #include <stdint.h>
24 #include <string.h>
25 #include <endian.h>
26 #include <byteswap.h>
28 #if __BYTE_ORDER == __BIG_ENDIAN
29 #define fdt32_to_cpu(x) (x)
30 #define cpu_to_fdt32(x) (x)
31 #define fdt64_to_cpu(x) (x)
32 #define cpu_to_fdt64(x) (x)
33 #else
34 #define fdt32_to_cpu(x) (bswap_32((x)))
35 #define cpu_to_fdt32(x) (bswap_32((x)))
36 #define fdt64_to_cpu(x) (bswap_64((x)))
37 #define cpu_to_fdt64(x) (bswap_64((x)))
38 #endif
40 #endif /* _LIBFDT_ENV_H */