1 /* SPDX-License-Identifier: GPL-2.0 */ 1 /* SPDX-License-Identifier: GPL-2.0 */ 2 #ifndef __VDSO_UNALIGNED_H 2 #ifndef __VDSO_UNALIGNED_H 3 #define __VDSO_UNALIGNED_H 3 #define __VDSO_UNALIGNED_H 4 4 5 #define __get_unaligned_t(type, ptr) ({ 5 #define __get_unaligned_t(type, ptr) ({ \ 6 const struct { type x; } __packed *__p 6 const struct { type x; } __packed *__pptr = (typeof(__pptr))(ptr); \ 7 __pptr->x; 7 __pptr->x; \ 8 }) 8 }) 9 9 10 #define __put_unaligned_t(type, val, ptr) do { 10 #define __put_unaligned_t(type, val, ptr) do { \ 11 struct { type x; } __packed *__pptr = 11 struct { type x; } __packed *__pptr = (typeof(__pptr))(ptr); \ 12 __pptr->x = (val); 12 __pptr->x = (val); \ 13 } while (0) 13 } while (0) 14 14 15 #endif /* __VDSO_UNALIGNED_H */ 15 #endif /* __VDSO_UNALIGNED_H */ 16 16
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.