mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 12:43:29 +02:00
asm/unaligned.h is always an include of asm-generic/unaligned.h; might as well move that thing to linux/unaligned.h and include that - there's nothing arch-specific in that header. auto-generated by the following: for i in `git grep -l -w asm/unaligned.h`; do sed -i -e "s/asm\/unaligned.h/linux\/unaligned.h/" $i done for i in `git grep -l -w asm-generic/unaligned.h`; do sed -i -e "s/asm-generic\/unaligned.h/linux\/unaligned.h/" $i done git mv include/asm-generic/unaligned.h include/linux/unaligned.h git mv tools/include/asm-generic/unaligned.h tools/include/linux/unaligned.h sed -i -e "/unaligned.h/d" include/asm-generic/Kbuild sed -i -e "s/__ASM_GENERIC/__LINUX/" include/linux/unaligned.h tools/include/linux/unaligned.h
24 lines
701 B
C
24 lines
701 B
C
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
/*
|
|
* Copied from the kernel sources to tools/perf/:
|
|
*/
|
|
|
|
#ifndef __TOOLS_LINUX_ASM_GENERIC_UNALIGNED_H
|
|
#define __TOOLS_LINUX_ASM_GENERIC_UNALIGNED_H
|
|
|
|
#define __get_unaligned_t(type, ptr) ({ \
|
|
const struct { type x; } __packed *__pptr = (typeof(__pptr))(ptr); \
|
|
__pptr->x; \
|
|
})
|
|
|
|
#define __put_unaligned_t(type, val, ptr) do { \
|
|
struct { type x; } __packed *__pptr = (typeof(__pptr))(ptr); \
|
|
__pptr->x = (val); \
|
|
} while (0)
|
|
|
|
#define get_unaligned(ptr) __get_unaligned_t(typeof(*(ptr)), (ptr))
|
|
#define put_unaligned(val, ptr) __put_unaligned_t(typeof(*(ptr)), (val), (ptr))
|
|
|
|
#endif /* __TOOLS_LINUX_ASM_GENERIC_UNALIGNED_H */
|
|
|