arm64: Fix the endianness of arch_spinlock_t
authorCatalin Marinas <catalin.marinas@arm.com>
Fri, 25 Oct 2013 14:48:33 +0000 (15:48 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Fri, 25 Oct 2013 15:10:22 +0000 (16:10 +0100)
The owner and next members of the arch_spinlock_t structure need to be
swapped when compiling for big endian.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Reported-by: Matthew Leach <matthew.leach@arm.com>
Acked-by: Will Deacon <will.deacon@arm.com>
arch/arm64/include/asm/spinlock_types.h

index 8769275..b8d3836 100644 (file)
 #define TICKET_SHIFT   16
 
 typedef struct {
+#ifdef __AARCH64EB__
+       u16 next;
+       u16 owner;
+#else
        u16 owner;
        u16 next;
+#endif
 } __aligned(4) arch_spinlock_t;
 
 #define __ARCH_SPIN_LOCK_UNLOCKED      { 0 , 0 }