XenevaOS
Loading...
Searching...
No Matches
unaligned.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef __VDSO_UNALIGNED_H
3#define __VDSO_UNALIGNED_H
4
6
20#define __get_unaligned_t(type, ptr) ({ \
21 type *__get_unaligned_ctrl_type __always_unused = NULL; \
22 __unqual_scalar_typeof(*__get_unaligned_ctrl_type) __get_unaligned_val; \
23 __builtin_memcpy(&__get_unaligned_val, (void *)(ptr), \
24 sizeof(__get_unaligned_val)); \
25 __get_unaligned_val; \
26})
27
38#define __put_unaligned_t(type, val, ptr) do { \
39 type __put_unaligned_val = (val); \
40 __builtin_memcpy((void *)(ptr), &__put_unaligned_val, \
41 sizeof(__put_unaligned_val)); \
42} while (0)
43
44#endif /* __VDSO_UNALIGNED_H */