unaligned.h 427 B

123456789101112131415
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __VDSO_UNALIGNED_H
  3. #define __VDSO_UNALIGNED_H
  4. #define __get_unaligned_t(type, ptr) ({ \
  5. const struct { type x; } __packed *__pptr = (typeof(__pptr))(ptr); \
  6. __pptr->x; \
  7. })
  8. #define __put_unaligned_t(type, val, ptr) do { \
  9. struct { type x; } __packed *__pptr = (typeof(__pptr))(ptr); \
  10. __pptr->x = (val); \
  11. } while (0)
  12. #endif /* __VDSO_UNALIGNED_H */