mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-08-18 07:58:52 +09:00
![Mike Frysinger](/assets/img/avatar_default.png)
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>
24 lines
501 B
C
24 lines
501 B
C
#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
|