mirror of
https://github.com/qemu/qemu.git
synced 2024-12-27 22:23:33 +08:00
fedb88bd32
Fixes the libfdt enabled build for hosts that have <machine/bswap.h>. The code at the beginning of qemu/bswap.h is attempting to standardize on bswapN. In the case of CONFIG_MACHINE_BSWAP_H, this is all we get. In the case of CONFIG_BYTESWAP_H, we get bswap_N from the system header and then wrap these with inline functions to get bswapN. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
37 lines
1.0 KiB
C
37 lines
1.0 KiB
C
/*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License, version 2, as
|
|
* published by the Free Software Foundation.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
|
*
|
|
* Copyright IBM Corp. 2008
|
|
* Authors: Hollis Blanchard <hollisb@us.ibm.com>
|
|
*
|
|
*/
|
|
|
|
#ifndef _LIBFDT_ENV_H
|
|
#define _LIBFDT_ENV_H
|
|
|
|
#include "qemu/bswap.h"
|
|
|
|
#ifdef HOST_WORDS_BIGENDIAN
|
|
#define fdt32_to_cpu(x) (x)
|
|
#define cpu_to_fdt32(x) (x)
|
|
#define fdt64_to_cpu(x) (x)
|
|
#define cpu_to_fdt64(x) (x)
|
|
#else
|
|
#define fdt32_to_cpu(x) bswap32(x)
|
|
#define cpu_to_fdt32(x) bswap32(x)
|
|
#define fdt64_to_cpu(x) bswap64(x)
|
|
#define cpu_to_fdt64(x) bswap64(x)
|
|
#endif
|
|
|
|
#endif /* _LIBFDT_ENV_H */
|