summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm/paca.h
diff options
context:
space:
mode:
authorAnton Blanchard <anton@samba.org>2013-08-06 18:01:51 +0200
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2013-08-14 07:33:40 +0200
commit54bb7f4bda0ee49f39dc593c2d73fe6053a99dbb (patch)
tree80a86974e8e89de50ec9eaacf3366a2f44c82986 /arch/powerpc/include/asm/paca.h
parentpowerpc: Fix little endian coredumps (diff)
downloadlinux-54bb7f4bda0ee49f39dc593c2d73fe6053a99dbb.tar.xz
linux-54bb7f4bda0ee49f39dc593c2d73fe6053a99dbb.zip
powerpc: Make rwlocks endian safe
Our ppc64 spinlocks and rwlocks use a trick where a lock token and the paca index are placed in the lock with a single store. Since we are using two u16s they need adjusting for little endian. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/include/asm/paca.h')
-rw-r--r--arch/powerpc/include/asm/paca.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/paca.h b/arch/powerpc/include/asm/paca.h
index 17d40a2a00c4..a5954cebbc55 100644
--- a/arch/powerpc/include/asm/paca.h
+++ b/arch/powerpc/include/asm/paca.h
@@ -68,8 +68,13 @@ struct paca_struct {
* instruction. They must travel together and be properly
* aligned.
*/
+#ifdef __BIG_ENDIAN__
u16 lock_token; /* Constant 0x8000, used in locks */
u16 paca_index; /* Logical processor number */
+#else
+ u16 paca_index; /* Logical processor number */
+ u16 lock_token; /* Constant 0x8000, used in locks */
+#endif
u64 kernel_toc; /* Kernel TOC address */
u64 kernelbase; /* Base address of kernel */