mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 23:24:38 +00:00
asm-generic/unaligned.h: dynamic default unaligned accesses
This is based on the asm-arm/unaligned.h, but made generic so all arches that cannot do unaligned accesses can utilize it. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
This commit is contained in:
parent
93910edb59
commit
3adc1fda38
1 changed files with 23 additions and 0 deletions
23
include/asm-generic/unaligned.h
Normal file
23
include/asm-generic/unaligned.h
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
#ifndef _GENERIC_UNALIGNED_H
|
||||||
|
#define _GENERIC_UNALIGNED_H
|
||||||
|
|
||||||
|
#include <asm/byteorder.h>
|
||||||
|
|
||||||
|
#include <linux/unaligned/le_byteshift.h>
|
||||||
|
#include <linux/unaligned/be_byteshift.h>
|
||||||
|
#include <linux/unaligned/generic.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Select endianness
|
||||||
|
*/
|
||||||
|
#if defined(__LITTLE_ENDIAN)
|
||||||
|
#define get_unaligned __get_unaligned_le
|
||||||
|
#define put_unaligned __put_unaligned_le
|
||||||
|
#elif defined(__BIG_ENDIAN)
|
||||||
|
#define get_unaligned __get_unaligned_be
|
||||||
|
#define put_unaligned __put_unaligned_be
|
||||||
|
#else
|
||||||
|
#error invalid endian
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
Loading…
Reference in a new issue