Skip to content

Commit

Permalink
arm64: Fix the endianness of arch_spinlock_t
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Catalin Marinas committed Oct 25, 2013
1 parent 710be9a commit 4a12cae
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions arch/arm64/include/asm/spinlock_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,13 @@
#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 }
Expand Down

0 comments on commit 4a12cae

Please sign in to comment.