1 /* SPDX-License-Identifier: GPL-2.0 */ 1 2 #ifndef _PPC_BOOT_SWAB_H_ 3 #define _PPC_BOOT_SWAB_H_ 4 5 static inline u16 swab16(u16 x) 6 { 7 return ((x & (u16)0x00ffU) << 8) | 8 ((x & (u16)0xff00U) >> 8); 9 } 10 11 static inline u32 swab32(u32 x) 12 { 13 return ((x & (u32)0x000000ffUL) << 24 14 ((x & (u32)0x0000ff00UL) << 8 15 ((x & (u32)0x00ff0000UL) >> 8 16 ((x & (u32)0xff000000UL) >> 24 17 } 18 19 static inline u64 swab64(u64 x) 20 { 21 return (u64)((x & (u64)0x000000000000 22 (u64)((x & (u64)0x000000000000 23 (u64)((x & (u64)0x0000000000ff 24 (u64)((x & (u64)0x00000000ff00 25 (u64)((x & (u64)0x000000ff0000 26 (u64)((x & (u64)0x0000ff000000 27 (u64)((x & (u64)0x00ff00000000 28 (u64)((x & (u64)0xff0000000000 29 } 30 #endif /* _PPC_BOOT_SWAB_H_ */ 31
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.