1 #ifndef _GENERIC_UNALIGNED_H 2 #define _GENERIC_UNALIGNED_H 3 4 #include <asm/byteorder.h> 5 6 #include <linux/unaligned/le_byteshift.h> 7 #include <linux/unaligned/be_byteshift.h> 8 #include <linux/unaligned/generic.h> 9 10 /* 11 * Select endianness 12 */ 13 #if defined(__LITTLE_ENDIAN) 14 #define get_unaligned __get_unaligned_le 15 #define put_unaligned __put_unaligned_le 16 #elif defined(__BIG_ENDIAN) 17 #define get_unaligned __get_unaligned_be 18 #define put_unaligned __put_unaligned_be 19 #else 20 #error invalid endian 21 #endif 22 23 /* Allow unaligned memory access */ 24 void allow_unaligned(void); 25 26 #endif 27