00001 /* 00002 * This program is free software; you can redistribute it and/or modify 00003 * it under the terms of the GNU General Public License, version 2, as 00004 * published by the Free Software Foundation. 00005 * 00006 * This program is distributed in the hope that it will be useful, 00007 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00008 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00009 * GNU General Public License for more details. 00010 * 00011 * You should have received a copy of the GNU General Public License 00012 * along with this program; if not, write to the Free Software 00013 * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00014 * 00015 * Copyright IBM Corp. 2008 00016 * Authors: Hollis Blanchard <hollisb@us.ibm.com> 00017 * 00018 */ 00019 00020 #ifndef _LIBFDT_ENV_H 00021 #define _LIBFDT_ENV_H 00022 00023 #include <stddef.h> 00024 #include <sst_stdint.h> 00025 #include <string.h> 00026 #include <endian.h> 00027 #include <byteswap.h> 00028 00029 #if __BYTE_ORDER == __BIG_ENDIAN 00030 #define fdt32_to_cpu(x) (x) 00031 #define cpu_to_fdt32(x) (x) 00032 #define fdt64_to_cpu(x) (x) 00033 #define cpu_to_fdt64(x) (x) 00034 #else 00035 #define fdt32_to_cpu(x) (bswap_32((x))) 00036 #define cpu_to_fdt32(x) (bswap_32((x))) 00037 #define fdt64_to_cpu(x) (bswap_64((x))) 00038 #define cpu_to_fdt64(x) (bswap_64((x))) 00039 #endif 00040 00041 #endif /* _LIBFDT_ENV_H */