Path: blob/master/arch/sh/include/mach-common/mach/mangle-port.h
26495 views
/* SPDX-License-Identifier: GPL-2.01*2* SH version cribbed from the MIPS copy:3*4* Copyright (C) 2003, 2004 Ralf Baechle5*/6#ifndef __MACH_COMMON_MANGLE_PORT_H7#define __MACH_COMMON_MANGLE_PORT_H89/*10* Sane hardware offers swapping of PCI/ISA I/O space accesses in hardware;11* less sane hardware forces software to fiddle with this...12*13* Regardless, if the host bus endianness mismatches that of PCI/ISA, then14* you can't have the numerical value of data and byte addresses within15* multibyte quantities both preserved at the same time. Hence two16* variations of functions: non-prefixed ones that preserve the value17* and prefixed ones that preserve byte addresses. The latters are18* typically used for moving raw data between a peripheral and memory (cf.19* string I/O functions), hence the "__mem_" prefix.20*/21#if defined(CONFIG_SWAP_IO_SPACE)2223# define ioswabb(x) (x)24# define __mem_ioswabb(x) (x)25# define ioswabw(x) le16_to_cpu(x)26# define __mem_ioswabw(x) (x)27# define ioswabl(x) le32_to_cpu(x)28# define __mem_ioswabl(x) (x)29# define ioswabq(x) le64_to_cpu(x)30# define __mem_ioswabq(x) (x)3132#else3334# define ioswabb(x) (x)35# define __mem_ioswabb(x) (x)36# define ioswabw(x) (x)37# define __mem_ioswabw(x) cpu_to_le16(x)38# define ioswabl(x) (x)39# define __mem_ioswabl(x) cpu_to_le32(x)40# define ioswabq(x) (x)41# define __mem_ioswabq(x) cpu_to_le32(x)4243#endif4445#endif /* __MACH_COMMON_MANGLE_PORT_H */464748