diff options
| -rw-r--r-- | include/asm-avr32/unaligned.h | 26 |
1 files changed, 3 insertions, 23 deletions
diff --git a/include/asm-avr32/unaligned.h b/include/asm-avr32/unaligned.h index 791361786fcc..36f5fd430543 100644 --- a/include/asm-avr32/unaligned.h +++ b/include/asm-avr32/unaligned.h | |||
| @@ -6,31 +6,11 @@ | |||
| 6 | * implementation. The AVR32 AP implementation can handle unaligned | 6 | * implementation. The AVR32 AP implementation can handle unaligned |
| 7 | * words, but halfwords must be halfword-aligned, and doublewords must | 7 | * words, but halfwords must be halfword-aligned, and doublewords must |
| 8 | * be word-aligned. | 8 | * be word-aligned. |
| 9 | * | ||
| 10 | * However, swapped word loads must be word-aligned so we can't | ||
| 11 | * optimize word loads in general. | ||
| 9 | */ | 12 | */ |
| 10 | 13 | ||
| 11 | #include <asm-generic/unaligned.h> | 14 | #include <asm-generic/unaligned.h> |
| 12 | 15 | ||
| 13 | #ifdef CONFIG_CPU_AT32AP7000 | ||
| 14 | |||
| 15 | /* REVISIT calling memmove() may be smaller for 64-bit values ... */ | ||
| 16 | |||
| 17 | #undef get_unaligned | ||
| 18 | #define get_unaligned(ptr) \ | ||
| 19 | ___get_unaligned(ptr, sizeof((*ptr))) | ||
| 20 | #define ___get_unaligned(ptr, size) \ | ||
| 21 | ((size == 4) ? *(ptr) : __get_unaligned(ptr, size)) | ||
| 22 | |||
| 23 | #undef put_unaligned | ||
| 24 | #define put_unaligned(val, ptr) \ | ||
| 25 | ___put_unaligned((__u64)(val), ptr, sizeof((*ptr))) | ||
| 26 | #define ___put_unaligned(val, ptr, size) \ | ||
| 27 | do { \ | ||
| 28 | if (size == 4) \ | ||
| 29 | *(ptr) = (val); \ | ||
| 30 | else \ | ||
| 31 | __put_unaligned(val, ptr, size); \ | ||
| 32 | } while (0) | ||
| 33 | |||
| 34 | #endif | ||
| 35 | |||
| 36 | #endif /* __ASM_AVR32_UNALIGNED_H */ | 16 | #endif /* __ASM_AVR32_UNALIGNED_H */ |
