USB: serial: option: reimplement interface masking
[linux/fpc-iii.git] / arch / nios2 / include / uapi / asm / swab.h
blob9750547a5f8289f8d038ab81a2e464854f19f749
1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2 /*
3 * Copyright (C) 2012 Tobias Klauser <tklauser@distanz.ch>
4 * Copyright (C) 2011 Pyramid Technical Consultants, Inc.
6 * This file is subject to the terms and conditions of the GNU General
7 * Public License. See the file COPYING in the main directory of this
8 * archive for more details.
9 */
11 #ifndef _ASM_NIOS2_SWAB_H
12 #define _ASM_NIOS2_SWAB_H
14 #include <linux/types.h>
15 #include <asm-generic/swab.h>
17 #ifdef CONFIG_NIOS2_CI_SWAB_SUPPORT
18 #ifdef __GNUC__
20 #define __nios2_swab(x) \
21 __builtin_custom_ini(CONFIG_NIOS2_CI_SWAB_NO, (x))
23 static inline __attribute__((const)) __u16 __arch_swab16(__u16 x)
25 return (__u16) __nios2_swab(((__u32) x) << 16);
27 #define __arch_swab16 __arch_swab16
29 static inline __attribute__((const)) __u32 __arch_swab32(__u32 x)
31 return (__u32) __nios2_swab(x);
33 #define __arch_swab32 __arch_swab32
35 #endif /* __GNUC__ */
36 #endif /* CONFIG_NIOS2_CI_SWAB_SUPPORT */
38 #endif /* _ASM_NIOS2_SWAB_H */