diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-10 11:12:03 +0900 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-10 11:12:03 +0900 |
commit | 23d5385f382a7c7d8b6bf19b0c2cfb3acbb12d31 (patch) | |
tree | b0e2fbbdd8a9b86e0074affd58e35bea9c22e175 /arch/sparc/include/uapi/asm/swab.h | |
parent | b7e97d22113bcaafff93774e3085f5b567eaba9c (diff) | |
parent | 9836d3458cde82626f2828ca6bd44c4a02b56e63 (diff) | |
download | blackbird-op-linux-23d5385f382a7c7d8b6bf19b0c2cfb3acbb12d31.tar.gz blackbird-op-linux-23d5385f382a7c7d8b6bf19b0c2cfb3acbb12d31.zip |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc
Pull sparc update from David Miller:
"This is just the UAPI commits for sparc via David Howells."
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc:
UAPI: (Scripted) Disintegrate arch/sparc/include/asm
Diffstat (limited to 'arch/sparc/include/uapi/asm/swab.h')
-rw-r--r-- | arch/sparc/include/uapi/asm/swab.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/arch/sparc/include/uapi/asm/swab.h b/arch/sparc/include/uapi/asm/swab.h new file mode 100644 index 000000000000..a34ad079487e --- /dev/null +++ b/arch/sparc/include/uapi/asm/swab.h @@ -0,0 +1,45 @@ +#ifndef _SPARC_SWAB_H +#define _SPARC_SWAB_H + +#include <linux/types.h> +#include <asm/asi.h> + +#if defined(__sparc__) && defined(__arch64__) +static inline __u16 __arch_swab16p(const __u16 *addr) +{ + __u16 ret; + + __asm__ __volatile__ ("lduha [%1] %2, %0" + : "=r" (ret) + : "r" (addr), "i" (ASI_PL)); + return ret; +} +#define __arch_swab16p __arch_swab16p + +static inline __u32 __arch_swab32p(const __u32 *addr) +{ + __u32 ret; + + __asm__ __volatile__ ("lduwa [%1] %2, %0" + : "=r" (ret) + : "r" (addr), "i" (ASI_PL)); + return ret; +} +#define __arch_swab32p __arch_swab32p + +static inline __u64 __arch_swab64p(const __u64 *addr) +{ + __u64 ret; + + __asm__ __volatile__ ("ldxa [%1] %2, %0" + : "=r" (ret) + : "r" (addr), "i" (ASI_PL)); + return ret; +} +#define __arch_swab64p __arch_swab64p + +#else +#define __SWAB_64_THRU_32__ +#endif /* defined(__sparc__) && defined(__arch64__) */ + +#endif /* _SPARC_SWAB_H */ |