162306a36Sopenharmony_ci/*
262306a36Sopenharmony_ci * This file is subject to the terms and conditions of the GNU General Public
362306a36Sopenharmony_ci * License.  See the file "COPYING" in the main directory of this archive
462306a36Sopenharmony_ci * for more details.
562306a36Sopenharmony_ci *
662306a36Sopenharmony_ci * Copyright (C) 2003, 2004 Ralf Baechle
762306a36Sopenharmony_ci */
862306a36Sopenharmony_ci#ifndef __ASM_MACH_GENERIC_MANGLE_PORT_H
962306a36Sopenharmony_ci#define __ASM_MACH_GENERIC_MANGLE_PORT_H
1062306a36Sopenharmony_ci
1162306a36Sopenharmony_ci#define __swizzle_addr_b(port)	(port)
1262306a36Sopenharmony_ci#define __swizzle_addr_w(port)	(port)
1362306a36Sopenharmony_ci#define __swizzle_addr_l(port)	(port)
1462306a36Sopenharmony_ci#define __swizzle_addr_q(port)	(port)
1562306a36Sopenharmony_ci
1662306a36Sopenharmony_ci/*
1762306a36Sopenharmony_ci * Sane hardware offers swapping of PCI/ISA I/O space accesses in hardware;
1862306a36Sopenharmony_ci * less sane hardware forces software to fiddle with this...
1962306a36Sopenharmony_ci *
2062306a36Sopenharmony_ci * Regardless, if the host bus endianness mismatches that of PCI/ISA, then
2162306a36Sopenharmony_ci * you can't have the numerical value of data and byte addresses within
2262306a36Sopenharmony_ci * multibyte quantities both preserved at the same time.  Hence two
2362306a36Sopenharmony_ci * variations of functions: non-prefixed ones that preserve the value
2462306a36Sopenharmony_ci * and prefixed ones that preserve byte addresses.  The latters are
2562306a36Sopenharmony_ci * typically used for moving raw data between a peripheral and memory (cf.
2662306a36Sopenharmony_ci * string I/O functions), hence the "__mem_" prefix.
2762306a36Sopenharmony_ci */
2862306a36Sopenharmony_ci#if defined(CONFIG_SWAP_IO_SPACE)
2962306a36Sopenharmony_ci
3062306a36Sopenharmony_ci# define ioswabb(a, x)		(x)
3162306a36Sopenharmony_ci# define __mem_ioswabb(a, x)	(x)
3262306a36Sopenharmony_ci# define ioswabw(a, x)		le16_to_cpu((__force __le16)(x))
3362306a36Sopenharmony_ci# define __mem_ioswabw(a, x)	(x)
3462306a36Sopenharmony_ci# define ioswabl(a, x)		le32_to_cpu((__force __le32)(x))
3562306a36Sopenharmony_ci# define __mem_ioswabl(a, x)	(x)
3662306a36Sopenharmony_ci# define ioswabq(a, x)		le64_to_cpu((__force __le64)(x))
3762306a36Sopenharmony_ci# define __mem_ioswabq(a, x)	(x)
3862306a36Sopenharmony_ci
3962306a36Sopenharmony_ci#else
4062306a36Sopenharmony_ci
4162306a36Sopenharmony_ci# define ioswabb(a, x)		(x)
4262306a36Sopenharmony_ci# define __mem_ioswabb(a, x)	(x)
4362306a36Sopenharmony_ci# define ioswabw(a, x)		(x)
4462306a36Sopenharmony_ci# define __mem_ioswabw(a, x)	((__force u16)cpu_to_le16(x))
4562306a36Sopenharmony_ci# define ioswabl(a, x)		(x)
4662306a36Sopenharmony_ci# define __mem_ioswabl(a, x)	((__force u32)cpu_to_le32(x))
4762306a36Sopenharmony_ci# define ioswabq(a, x)		(x)
4862306a36Sopenharmony_ci# define __mem_ioswabq(a, x)	((__force u64)cpu_to_le64(x))
4962306a36Sopenharmony_ci
5062306a36Sopenharmony_ci#endif
5162306a36Sopenharmony_ci
5262306a36Sopenharmony_ci#endif /* __ASM_MACH_GENERIC_MANGLE_PORT_H */
53