blob: 3d33a5a063e8fa676039f567fb3a1f4b77e66f25 [file] [log] [blame]
Mike Frysinger3adc1fd2010-01-21 05:01:14 -05001#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
Heinrich Schuchardtc3b11de2018-04-03 21:59:32 +020023/* Allow unaligned memory access */
24void allow_unaligned(void);
25
Mike Frysinger3adc1fd2010-01-21 05:01:14 -050026#endif