Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e122eaf69422e5d9ce93fc9786099098e3b9e1c4
Commit:     e122eaf69422e5d9ce93fc9786099098e3b9e1c4
Parent:     a8e93ed8cb3d9aa22d192033009357526548c825
Author:     Haavard Skinnemoen <[EMAIL PROTECTED]>
AuthorDate: Wed Jun 20 15:29:15 2007 +0200
Committer:  Haavard Skinnemoen <[EMAIL PROTECTED]>
CommitDate: Wed Jul 18 20:45:51 2007 +0200

    [AVR32] Remove optimization of unaligned word loads
    
    If we let unaligned word loads bypass the generic unaligned handling,
    gcc may combine it with a swap.b instruction and turn it into a ldwsp
    instruction, which does not work with unaligned addresses.
    
    Revert the optimization to prevent the RNDIS driver from crashing.
    Hopefully we'll figure something out later (it may be better to do the
    optimization in gcc.)
    
    Signed-off-by: Haavard Skinnemoen <[EMAIL PROTECTED]>
---
 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 7913617..36f5fd4 100644
--- a/include/asm-avr32/unaligned.h
+++ b/include/asm-avr32/unaligned.h
@@ -6,31 +6,11 @@
  * implementation.  The AVR32 AP implementation can handle unaligned
  * words, but halfwords must be halfword-aligned, and doublewords must
  * be word-aligned.
+ *
+ * However, swapped word loads must be word-aligned so we can't
+ * optimize word loads in general.
  */
 
 #include <asm-generic/unaligned.h>
 
-#ifdef CONFIG_CPU_AT32AP7000
-
-/* REVISIT calling memmove() may be smaller for 64-bit values ... */
-
-#undef get_unaligned
-#define get_unaligned(ptr) \
-       ___get_unaligned(ptr, sizeof((*ptr)))
-#define ___get_unaligned(ptr, size) \
-       ((size == 4) ? *(ptr) : __get_unaligned(ptr, size))
-
-#undef put_unaligned
-#define put_unaligned(val, ptr) \
-       ___put_unaligned((__u64)(val), ptr, sizeof((*ptr)))
-#define ___put_unaligned(val, ptr, size)               \
-do {                                                   \
-       if (size == 4)                                  \
-               *(ptr) = (val);                         \
-       else                                            \
-               __put_unaligned(val, ptr, size);        \
-} while (0)
-
-#endif
-
 #endif /* __ASM_AVR32_UNALIGNED_H */
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to