aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm/ppc-opcode.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/include/asm/ppc-opcode.h')
-rw-r--r--arch/powerpc/include/asm/ppc-opcode.h25
1 files changed, 21 insertions, 4 deletions
diff --git a/arch/powerpc/include/asm/ppc-opcode.h b/arch/powerpc/include/asm/ppc-opcode.h
index 640ccbbc0977..b74f16d45cb4 100644
--- a/arch/powerpc/include/asm/ppc-opcode.h
+++ b/arch/powerpc/include/asm/ppc-opcode.h
@@ -25,6 +25,7 @@
25#define PPC_INST_LSWI 0x7c0004aa 25#define PPC_INST_LSWI 0x7c0004aa
26#define PPC_INST_LSWX 0x7c00042a 26#define PPC_INST_LSWX 0x7c00042a
27#define PPC_INST_LWSYNC 0x7c2004ac 27#define PPC_INST_LWSYNC 0x7c2004ac
28#define PPC_INST_LXVD2X 0x7c000698
28#define PPC_INST_MCRXR 0x7c000400 29#define PPC_INST_MCRXR 0x7c000400
29#define PPC_INST_MCRXR_MASK 0xfc0007fe 30#define PPC_INST_MCRXR_MASK 0xfc0007fe
30#define PPC_INST_MFSPR_PVR 0x7c1f42a6 31#define PPC_INST_MFSPR_PVR 0x7c1f42a6
@@ -43,14 +44,18 @@
43 44
44#define PPC_INST_STSWI 0x7c0005aa 45#define PPC_INST_STSWI 0x7c0005aa
45#define PPC_INST_STSWX 0x7c00052a 46#define PPC_INST_STSWX 0x7c00052a
47#define PPC_INST_STXVD2X 0x7c000798
48#define PPC_INST_TLBIE 0x7c000264
46#define PPC_INST_TLBILX 0x7c000024 49#define PPC_INST_TLBILX 0x7c000024
47#define PPC_INST_WAIT 0x7c00007c 50#define PPC_INST_WAIT 0x7c00007c
48 51
49/* macros to insert fields into opcodes */ 52/* macros to insert fields into opcodes */
50#define __PPC_RA(a) ((a & 0x1f) << 16) 53#define __PPC_RA(a) (((a) & 0x1f) << 16)
51#define __PPC_RB(b) ((b & 0x1f) << 11) 54#define __PPC_RB(b) (((b) & 0x1f) << 11)
52#define __PPC_T_TLB(t) ((t & 0x3) << 21) 55#define __PPC_RS(s) (((s) & 0x1f) << 21)
53#define __PPC_WC(w) ((w & 0x3) << 21) 56#define __PPC_XS(s) ((((s) & 0x1f) << 21) | (((s) & 0x20) >> 5))
57#define __PPC_T_TLB(t) (((t) & 0x3) << 21)
58#define __PPC_WC(w) (((w) & 0x3) << 21)
54 59
55/* Deal with instructions that older assemblers aren't aware of */ 60/* Deal with instructions that older assemblers aren't aware of */
56#define PPC_DCBAL(a, b) stringify_in_c(.long PPC_INST_DCBAL | \ 61#define PPC_DCBAL(a, b) stringify_in_c(.long PPC_INST_DCBAL | \
@@ -69,5 +74,17 @@
69#define PPC_TLBILX_VA(a, b) PPC_TLBILX(3, a, b) 74#define PPC_TLBILX_VA(a, b) PPC_TLBILX(3, a, b)
70#define PPC_WAIT(w) stringify_in_c(.long PPC_INST_WAIT | \ 75#define PPC_WAIT(w) stringify_in_c(.long PPC_INST_WAIT | \
71 __PPC_WC(w)) 76 __PPC_WC(w))
77#define PPC_TLBIE(lp,a) stringify_in_c(.long PPC_INST_TLBIE | \
78 __PPC_RB(a) | __PPC_RS(lp))
79
80/*
81 * Define what the VSX XX1 form instructions will look like, then add
82 * the 128 bit load store instructions based on that.
83 */
84#define VSX_XX1(s, a, b) (__PPC_XS(s) | __PPC_RA(a) | __PPC_RB(b))
85#define STXVD2X(s, a, b) stringify_in_c(.long PPC_INST_STXVD2X | \
86 VSX_XX1((s), (a), (b)))
87#define LXVD2X(s, a, b) stringify_in_c(.long PPC_INST_LXVD2X | \
88 VSX_XX1((s), (a), (b)))
72 89
73#endif /* _ASM_POWERPC_PPC_OPCODE_H */ 90#endif /* _ASM_POWERPC_PPC_OPCODE_H */