diff --git a/arch/parisc/include/uapi/asm/byteorder.h b/arch/parisc/include/uapi/asm/byteorder.h index a59d9b7e35a8..dcf103b5bd4b 100644 --- a/arch/parisc/include/uapi/asm/byteorder.h +++ b/arch/parisc/include/uapi/asm/byteorder.h @@ -2,6 +2,8 @@ #ifndef _PARISC_BYTEORDER_H #define _PARISC_BYTEORDER_H +#define ARCH_FORCE_BYTE_ACCESSES(ptr) __asm__ ("" : "+r" (ptr)) + #include #endif /* _PARISC_BYTEORDER_H */ diff --git a/include/asm-generic/unaligned.h b/include/asm-generic/unaligned.h index 1c4242416c9f..cf8c9460e575 100644 --- a/include/asm-generic/unaligned.h +++ b/include/asm-generic/unaligned.h @@ -9,13 +9,19 @@ #include #include +#ifndef ARCH_FORCE_BYTE_ACCESSES +#define ARCH_FORCE_BYTE_ACCESSES(ptr) do { } while (0) +#endif + #define __get_unaligned_t(type, ptr) ({ \ const struct { type x; } __packed *__pptr = (typeof(__pptr))(ptr); \ + ARCH_FORCE_BYTE_ACCESSES(__pptr); \ __pptr->x; \ }) #define __put_unaligned_t(type, val, ptr) do { \ struct { type x; } __packed *__pptr = (typeof(__pptr))(ptr); \ + ARCH_FORCE_BYTE_ACCESSES(__pptr); \ __pptr->x = (val); \ } while (0)