xref: /openbmc/linux/include/uapi/asm-generic/swab.h (revision 6f52b16c)
16f52b16cSGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
28a1ab315SDavid Howells #ifndef _ASM_GENERIC_SWAB_H
38a1ab315SDavid Howells #define _ASM_GENERIC_SWAB_H
48a1ab315SDavid Howells 
58a1ab315SDavid Howells #include <asm/bitsperlong.h>
68a1ab315SDavid Howells 
78a1ab315SDavid Howells /*
88a1ab315SDavid Howells  * 32 bit architectures typically (but not always) want to
98a1ab315SDavid Howells  * set __SWAB_64_THRU_32__. In user space, this is only
108a1ab315SDavid Howells  * valid if the compiler supports 64 bit data types.
118a1ab315SDavid Howells  */
128a1ab315SDavid Howells 
138a1ab315SDavid Howells #if __BITS_PER_LONG == 32
148a1ab315SDavid Howells #if defined(__GNUC__) && !defined(__STRICT_ANSI__) || defined(__KERNEL__)
158a1ab315SDavid Howells #define __SWAB_64_THRU_32__
168a1ab315SDavid Howells #endif
178a1ab315SDavid Howells #endif
188a1ab315SDavid Howells 
198a1ab315SDavid Howells #endif /* _ASM_GENERIC_SWAB_H */
20