of: MSI: Simplify irqdomain lookup
[linux/fpc-iii.git] / arch / nios2 / include / uapi / asm / swab.h
blobb4e22ebaeb1792c2a703ebb235c5448f054685aa
1 /*
2 * Copyright (C) 2012 Tobias Klauser <tklauser@distanz.ch>
3 * Copyright (C) 2011 Pyramid Technical Consultants, Inc.
5 * This file is subject to the terms and conditions of the GNU General
6 * Public License. See the file COPYING in the main directory of this
7 * archive for more details.
8 */
10 #ifndef _ASM_NIOS2_SWAB_H
11 #define _ASM_NIOS2_SWAB_H
13 #include <linux/types.h>
14 #include <asm-generic/swab.h>
16 #ifdef CONFIG_NIOS2_CI_SWAB_SUPPORT
17 #ifdef __GNUC__
19 #define __nios2_swab(x) \
20 __builtin_custom_ini(CONFIG_NIOS2_CI_SWAB_NO, (x))
22 static inline __attribute__((const)) __u16 __arch_swab16(__u16 x)
24 return (__u16) __nios2_swab(((__u32) x) << 16);
26 #define __arch_swab16 __arch_swab16
28 static inline __attribute__((const)) __u32 __arch_swab32(__u32 x)
30 return (__u32) __nios2_swab(x);
32 #define __arch_swab32 __arch_swab32
34 #endif /* __GNUC__ */
35 #endif /* CONFIG_NIOS2_CI_SWAB_SUPPORT */
37 #endif /* _ASM_NIOS2_SWAB_H */