Go to the documentation of this file.
7 #ifndef _ASM_POWERPC_SWAB_H
8 #define _ASM_POWERPC_SWAB_H
10 #include <uapi/asm/swab.h>
20 __asm__ __volatile__ (
"lhbrx %0,0,%1" :
"=r" (val) :
"r" (addr),
"m" (*addr));
23 #define __arch_swab16p ld_le16
27 __asm__ __volatile__ (
"sthbrx %1,0,%2" :
"=m" (*addr) :
"r" (val),
"r" (addr));
30 static inline void __arch_swab16s(
__u16 *addr)
34 #define __arch_swab16s __arch_swab16s
40 __asm__ __volatile__ (
"lwbrx %0,0,%1" :
"=r" (val) :
"r" (addr),
"m" (*addr));
43 #define __arch_swab32p ld_le32
47 __asm__ __volatile__ (
"stwbrx %1,0,%2" :
"=m" (*addr) :
"r" (val),
"r" (addr));
50 static inline void __arch_swab32s(
__u32 *addr)
54 #define __arch_swab32s __arch_swab32s
62 :
"r" (value),
"0" (value >> 8));
65 #define __arch_swab16 __arch_swab16
71 __asm__(
"rlwimi %0,%1,24,16,23\n\t"
72 "rlwimi %0,%1,8,8,15\n\t"
75 :
"r" (value),
"0" (value >> 24));
78 #define __arch_swab32 __arch_swab32