xref: /openbmc/linux/arch/powerpc/include/asm/ppc_asm.h (revision 16c57b36)
1b8b572e1SStephen Rothwell /*
2b8b572e1SStephen Rothwell  * Copyright (C) 1995-1999 Gary Thomas, Paul Mackerras, Cort Dougan.
3b8b572e1SStephen Rothwell  */
4b8b572e1SStephen Rothwell #ifndef _ASM_POWERPC_PPC_ASM_H
5b8b572e1SStephen Rothwell #define _ASM_POWERPC_PPC_ASM_H
6b8b572e1SStephen Rothwell 
7b8b572e1SStephen Rothwell #include <linux/stringify.h>
8b8b572e1SStephen Rothwell #include <asm/asm-compat.h>
9b8b572e1SStephen Rothwell #include <asm/processor.h>
1016c57b36SKumar Gala #include <asm/ppc-opcode.h>
11b8b572e1SStephen Rothwell 
12b8b572e1SStephen Rothwell #ifndef __ASSEMBLY__
13b8b572e1SStephen Rothwell #error __FILE__ should only be used in assembler files
14b8b572e1SStephen Rothwell #else
15b8b572e1SStephen Rothwell 
16b8b572e1SStephen Rothwell #define SZL			(BITS_PER_LONG/8)
17b8b572e1SStephen Rothwell 
18b8b572e1SStephen Rothwell /*
19b8b572e1SStephen Rothwell  * Stuff for accurate CPU time accounting.
20b8b572e1SStephen Rothwell  * These macros handle transitions between user and system state
21b8b572e1SStephen Rothwell  * in exception entry and exit and accumulate time to the
22b8b572e1SStephen Rothwell  * user_time and system_time fields in the paca.
23b8b572e1SStephen Rothwell  */
24b8b572e1SStephen Rothwell 
25b8b572e1SStephen Rothwell #ifndef CONFIG_VIRT_CPU_ACCOUNTING
26b8b572e1SStephen Rothwell #define ACCOUNT_CPU_USER_ENTRY(ra, rb)
27b8b572e1SStephen Rothwell #define ACCOUNT_CPU_USER_EXIT(ra, rb)
28b8b572e1SStephen Rothwell #else
29b8b572e1SStephen Rothwell #define ACCOUNT_CPU_USER_ENTRY(ra, rb)					\
30b8b572e1SStephen Rothwell 	beq	2f;			/* if from kernel mode */	\
31b8b572e1SStephen Rothwell BEGIN_FTR_SECTION;							\
32b8b572e1SStephen Rothwell 	mfspr	ra,SPRN_PURR;		/* get processor util. reg */	\
33b8b572e1SStephen Rothwell END_FTR_SECTION_IFSET(CPU_FTR_PURR);					\
34b8b572e1SStephen Rothwell BEGIN_FTR_SECTION;							\
35b8b572e1SStephen Rothwell 	MFTB(ra);			/* or get TB if no PURR */	\
36b8b572e1SStephen Rothwell END_FTR_SECTION_IFCLR(CPU_FTR_PURR);					\
37b8b572e1SStephen Rothwell 	ld	rb,PACA_STARTPURR(r13);					\
38b8b572e1SStephen Rothwell 	std	ra,PACA_STARTPURR(r13);					\
39b8b572e1SStephen Rothwell 	subf	rb,rb,ra;		/* subtract start value */	\
40b8b572e1SStephen Rothwell 	ld	ra,PACA_USER_TIME(r13);					\
41b8b572e1SStephen Rothwell 	add	ra,ra,rb;		/* add on to user time */	\
42b8b572e1SStephen Rothwell 	std	ra,PACA_USER_TIME(r13);					\
43b8b572e1SStephen Rothwell 2:
44b8b572e1SStephen Rothwell 
45b8b572e1SStephen Rothwell #define ACCOUNT_CPU_USER_EXIT(ra, rb)					\
46b8b572e1SStephen Rothwell BEGIN_FTR_SECTION;							\
47b8b572e1SStephen Rothwell 	mfspr	ra,SPRN_PURR;		/* get processor util. reg */	\
48b8b572e1SStephen Rothwell END_FTR_SECTION_IFSET(CPU_FTR_PURR);					\
49b8b572e1SStephen Rothwell BEGIN_FTR_SECTION;							\
50b8b572e1SStephen Rothwell 	MFTB(ra);			/* or get TB if no PURR */	\
51b8b572e1SStephen Rothwell END_FTR_SECTION_IFCLR(CPU_FTR_PURR);					\
52b8b572e1SStephen Rothwell 	ld	rb,PACA_STARTPURR(r13);					\
53b8b572e1SStephen Rothwell 	std	ra,PACA_STARTPURR(r13);					\
54b8b572e1SStephen Rothwell 	subf	rb,rb,ra;		/* subtract start value */	\
55b8b572e1SStephen Rothwell 	ld	ra,PACA_SYSTEM_TIME(r13);				\
56b8b572e1SStephen Rothwell 	add	ra,ra,rb;		/* add on to user time */	\
57b8b572e1SStephen Rothwell 	std	ra,PACA_SYSTEM_TIME(r13);
58b8b572e1SStephen Rothwell #endif
59b8b572e1SStephen Rothwell 
60b8b572e1SStephen Rothwell /*
61b8b572e1SStephen Rothwell  * Macros for storing registers into and loading registers from
62b8b572e1SStephen Rothwell  * exception frames.
63b8b572e1SStephen Rothwell  */
64b8b572e1SStephen Rothwell #ifdef __powerpc64__
65b8b572e1SStephen Rothwell #define SAVE_GPR(n, base)	std	n,GPR0+8*(n)(base)
66b8b572e1SStephen Rothwell #define REST_GPR(n, base)	ld	n,GPR0+8*(n)(base)
67b8b572e1SStephen Rothwell #define SAVE_NVGPRS(base)	SAVE_8GPRS(14, base); SAVE_10GPRS(22, base)
68b8b572e1SStephen Rothwell #define REST_NVGPRS(base)	REST_8GPRS(14, base); REST_10GPRS(22, base)
69b8b572e1SStephen Rothwell #else
70b8b572e1SStephen Rothwell #define SAVE_GPR(n, base)	stw	n,GPR0+4*(n)(base)
71b8b572e1SStephen Rothwell #define REST_GPR(n, base)	lwz	n,GPR0+4*(n)(base)
72b8b572e1SStephen Rothwell #define SAVE_NVGPRS(base)	SAVE_GPR(13, base); SAVE_8GPRS(14, base); \
73b8b572e1SStephen Rothwell 				SAVE_10GPRS(22, base)
74b8b572e1SStephen Rothwell #define REST_NVGPRS(base)	REST_GPR(13, base); REST_8GPRS(14, base); \
75b8b572e1SStephen Rothwell 				REST_10GPRS(22, base)
76b8b572e1SStephen Rothwell #endif
77b8b572e1SStephen Rothwell 
78b8b572e1SStephen Rothwell /*
79b8b572e1SStephen Rothwell  * Define what the VSX XX1 form instructions will look like, then add
80b8b572e1SStephen Rothwell  * the 128 bit load store instructions based on that.
81b8b572e1SStephen Rothwell  */
82b8b572e1SStephen Rothwell #define VSX_XX1(xs, ra, rb)	(((xs) & 0x1f) << 21 | ((ra) << 16) |  \
83b8b572e1SStephen Rothwell 				 ((rb) << 11) | (((xs) >> 5)))
84b8b572e1SStephen Rothwell 
85b8b572e1SStephen Rothwell #define STXVD2X(xs, ra, rb)	.long (0x7c000798 | VSX_XX1((xs), (ra), (rb)))
86b8b572e1SStephen Rothwell #define LXVD2X(xs, ra, rb)	.long (0x7c000698 | VSX_XX1((xs), (ra), (rb)))
87b8b572e1SStephen Rothwell 
88b8b572e1SStephen Rothwell #define SAVE_2GPRS(n, base)	SAVE_GPR(n, base); SAVE_GPR(n+1, base)
89b8b572e1SStephen Rothwell #define SAVE_4GPRS(n, base)	SAVE_2GPRS(n, base); SAVE_2GPRS(n+2, base)
90b8b572e1SStephen Rothwell #define SAVE_8GPRS(n, base)	SAVE_4GPRS(n, base); SAVE_4GPRS(n+4, base)
91b8b572e1SStephen Rothwell #define SAVE_10GPRS(n, base)	SAVE_8GPRS(n, base); SAVE_2GPRS(n+8, base)
92b8b572e1SStephen Rothwell #define REST_2GPRS(n, base)	REST_GPR(n, base); REST_GPR(n+1, base)
93b8b572e1SStephen Rothwell #define REST_4GPRS(n, base)	REST_2GPRS(n, base); REST_2GPRS(n+2, base)
94b8b572e1SStephen Rothwell #define REST_8GPRS(n, base)	REST_4GPRS(n, base); REST_4GPRS(n+4, base)
95b8b572e1SStephen Rothwell #define REST_10GPRS(n, base)	REST_8GPRS(n, base); REST_2GPRS(n+8, base)
96b8b572e1SStephen Rothwell 
97b8b572e1SStephen Rothwell #define SAVE_FPR(n, base)	stfd	n,THREAD_FPR0+8*TS_FPRWIDTH*(n)(base)
98b8b572e1SStephen Rothwell #define SAVE_2FPRS(n, base)	SAVE_FPR(n, base); SAVE_FPR(n+1, base)
99b8b572e1SStephen Rothwell #define SAVE_4FPRS(n, base)	SAVE_2FPRS(n, base); SAVE_2FPRS(n+2, base)
100b8b572e1SStephen Rothwell #define SAVE_8FPRS(n, base)	SAVE_4FPRS(n, base); SAVE_4FPRS(n+4, base)
101b8b572e1SStephen Rothwell #define SAVE_16FPRS(n, base)	SAVE_8FPRS(n, base); SAVE_8FPRS(n+8, base)
102b8b572e1SStephen Rothwell #define SAVE_32FPRS(n, base)	SAVE_16FPRS(n, base); SAVE_16FPRS(n+16, base)
103b8b572e1SStephen Rothwell #define REST_FPR(n, base)	lfd	n,THREAD_FPR0+8*TS_FPRWIDTH*(n)(base)
104b8b572e1SStephen Rothwell #define REST_2FPRS(n, base)	REST_FPR(n, base); REST_FPR(n+1, base)
105b8b572e1SStephen Rothwell #define REST_4FPRS(n, base)	REST_2FPRS(n, base); REST_2FPRS(n+2, base)
106b8b572e1SStephen Rothwell #define REST_8FPRS(n, base)	REST_4FPRS(n, base); REST_4FPRS(n+4, base)
107b8b572e1SStephen Rothwell #define REST_16FPRS(n, base)	REST_8FPRS(n, base); REST_8FPRS(n+8, base)
108b8b572e1SStephen Rothwell #define REST_32FPRS(n, base)	REST_16FPRS(n, base); REST_16FPRS(n+16, base)
109b8b572e1SStephen Rothwell 
110b8b572e1SStephen Rothwell #define SAVE_VR(n,b,base)	li b,THREAD_VR0+(16*(n));  stvx n,b,base
111b8b572e1SStephen Rothwell #define SAVE_2VRS(n,b,base)	SAVE_VR(n,b,base); SAVE_VR(n+1,b,base)
112b8b572e1SStephen Rothwell #define SAVE_4VRS(n,b,base)	SAVE_2VRS(n,b,base); SAVE_2VRS(n+2,b,base)
113b8b572e1SStephen Rothwell #define SAVE_8VRS(n,b,base)	SAVE_4VRS(n,b,base); SAVE_4VRS(n+4,b,base)
114b8b572e1SStephen Rothwell #define SAVE_16VRS(n,b,base)	SAVE_8VRS(n,b,base); SAVE_8VRS(n+8,b,base)
115b8b572e1SStephen Rothwell #define SAVE_32VRS(n,b,base)	SAVE_16VRS(n,b,base); SAVE_16VRS(n+16,b,base)
116b8b572e1SStephen Rothwell #define REST_VR(n,b,base)	li b,THREAD_VR0+(16*(n)); lvx n,b,base
117b8b572e1SStephen Rothwell #define REST_2VRS(n,b,base)	REST_VR(n,b,base); REST_VR(n+1,b,base)
118b8b572e1SStephen Rothwell #define REST_4VRS(n,b,base)	REST_2VRS(n,b,base); REST_2VRS(n+2,b,base)
119b8b572e1SStephen Rothwell #define REST_8VRS(n,b,base)	REST_4VRS(n,b,base); REST_4VRS(n+4,b,base)
120b8b572e1SStephen Rothwell #define REST_16VRS(n,b,base)	REST_8VRS(n,b,base); REST_8VRS(n+8,b,base)
121b8b572e1SStephen Rothwell #define REST_32VRS(n,b,base)	REST_16VRS(n,b,base); REST_16VRS(n+16,b,base)
122b8b572e1SStephen Rothwell 
123b8b572e1SStephen Rothwell /* Save the lower 32 VSRs in the thread VSR region */
124b8b572e1SStephen Rothwell #define SAVE_VSR(n,b,base)	li b,THREAD_VSR0+(16*(n));  STXVD2X(n,b,base)
125b8b572e1SStephen Rothwell #define SAVE_2VSRS(n,b,base)	SAVE_VSR(n,b,base); SAVE_VSR(n+1,b,base)
126b8b572e1SStephen Rothwell #define SAVE_4VSRS(n,b,base)	SAVE_2VSRS(n,b,base); SAVE_2VSRS(n+2,b,base)
127b8b572e1SStephen Rothwell #define SAVE_8VSRS(n,b,base)	SAVE_4VSRS(n,b,base); SAVE_4VSRS(n+4,b,base)
128b8b572e1SStephen Rothwell #define SAVE_16VSRS(n,b,base)	SAVE_8VSRS(n,b,base); SAVE_8VSRS(n+8,b,base)
129b8b572e1SStephen Rothwell #define SAVE_32VSRS(n,b,base)	SAVE_16VSRS(n,b,base); SAVE_16VSRS(n+16,b,base)
130b8b572e1SStephen Rothwell #define REST_VSR(n,b,base)	li b,THREAD_VSR0+(16*(n)); LXVD2X(n,b,base)
131b8b572e1SStephen Rothwell #define REST_2VSRS(n,b,base)	REST_VSR(n,b,base); REST_VSR(n+1,b,base)
132b8b572e1SStephen Rothwell #define REST_4VSRS(n,b,base)	REST_2VSRS(n,b,base); REST_2VSRS(n+2,b,base)
133b8b572e1SStephen Rothwell #define REST_8VSRS(n,b,base)	REST_4VSRS(n,b,base); REST_4VSRS(n+4,b,base)
134b8b572e1SStephen Rothwell #define REST_16VSRS(n,b,base)	REST_8VSRS(n,b,base); REST_8VSRS(n+8,b,base)
135b8b572e1SStephen Rothwell #define REST_32VSRS(n,b,base)	REST_16VSRS(n,b,base); REST_16VSRS(n+16,b,base)
136b8b572e1SStephen Rothwell /* Save the upper 32 VSRs (32-63) in the thread VSX region (0-31) */
137b8b572e1SStephen Rothwell #define SAVE_VSRU(n,b,base)	li b,THREAD_VR0+(16*(n));  STXVD2X(n+32,b,base)
138b8b572e1SStephen Rothwell #define SAVE_2VSRSU(n,b,base)	SAVE_VSRU(n,b,base); SAVE_VSRU(n+1,b,base)
139b8b572e1SStephen Rothwell #define SAVE_4VSRSU(n,b,base)	SAVE_2VSRSU(n,b,base); SAVE_2VSRSU(n+2,b,base)
140b8b572e1SStephen Rothwell #define SAVE_8VSRSU(n,b,base)	SAVE_4VSRSU(n,b,base); SAVE_4VSRSU(n+4,b,base)
141b8b572e1SStephen Rothwell #define SAVE_16VSRSU(n,b,base)	SAVE_8VSRSU(n,b,base); SAVE_8VSRSU(n+8,b,base)
142b8b572e1SStephen Rothwell #define SAVE_32VSRSU(n,b,base)	SAVE_16VSRSU(n,b,base); SAVE_16VSRSU(n+16,b,base)
143b8b572e1SStephen Rothwell #define REST_VSRU(n,b,base)	li b,THREAD_VR0+(16*(n)); LXVD2X(n+32,b,base)
144b8b572e1SStephen Rothwell #define REST_2VSRSU(n,b,base)	REST_VSRU(n,b,base); REST_VSRU(n+1,b,base)
145b8b572e1SStephen Rothwell #define REST_4VSRSU(n,b,base)	REST_2VSRSU(n,b,base); REST_2VSRSU(n+2,b,base)
146b8b572e1SStephen Rothwell #define REST_8VSRSU(n,b,base)	REST_4VSRSU(n,b,base); REST_4VSRSU(n+4,b,base)
147b8b572e1SStephen Rothwell #define REST_16VSRSU(n,b,base)	REST_8VSRSU(n,b,base); REST_8VSRSU(n+8,b,base)
148b8b572e1SStephen Rothwell #define REST_32VSRSU(n,b,base)	REST_16VSRSU(n,b,base); REST_16VSRSU(n+16,b,base)
149b8b572e1SStephen Rothwell 
150b8b572e1SStephen Rothwell #define SAVE_EVR(n,s,base)	evmergehi s,s,n; stw s,THREAD_EVR0+4*(n)(base)
151b8b572e1SStephen Rothwell #define SAVE_2EVRS(n,s,base)	SAVE_EVR(n,s,base); SAVE_EVR(n+1,s,base)
152b8b572e1SStephen Rothwell #define SAVE_4EVRS(n,s,base)	SAVE_2EVRS(n,s,base); SAVE_2EVRS(n+2,s,base)
153b8b572e1SStephen Rothwell #define SAVE_8EVRS(n,s,base)	SAVE_4EVRS(n,s,base); SAVE_4EVRS(n+4,s,base)
154b8b572e1SStephen Rothwell #define SAVE_16EVRS(n,s,base)	SAVE_8EVRS(n,s,base); SAVE_8EVRS(n+8,s,base)
155b8b572e1SStephen Rothwell #define SAVE_32EVRS(n,s,base)	SAVE_16EVRS(n,s,base); SAVE_16EVRS(n+16,s,base)
156b8b572e1SStephen Rothwell #define REST_EVR(n,s,base)	lwz s,THREAD_EVR0+4*(n)(base); evmergelo n,s,n
157b8b572e1SStephen Rothwell #define REST_2EVRS(n,s,base)	REST_EVR(n,s,base); REST_EVR(n+1,s,base)
158b8b572e1SStephen Rothwell #define REST_4EVRS(n,s,base)	REST_2EVRS(n,s,base); REST_2EVRS(n+2,s,base)
159b8b572e1SStephen Rothwell #define REST_8EVRS(n,s,base)	REST_4EVRS(n,s,base); REST_4EVRS(n+4,s,base)
160b8b572e1SStephen Rothwell #define REST_16EVRS(n,s,base)	REST_8EVRS(n,s,base); REST_8EVRS(n+8,s,base)
161b8b572e1SStephen Rothwell #define REST_32EVRS(n,s,base)	REST_16EVRS(n,s,base); REST_16EVRS(n+16,s,base)
162b8b572e1SStephen Rothwell 
163b8b572e1SStephen Rothwell /* Macros to adjust thread priority for hardware multithreading */
164b8b572e1SStephen Rothwell #define HMT_VERY_LOW	or	31,31,31	# very low priority
165b8b572e1SStephen Rothwell #define HMT_LOW		or	1,1,1
166b8b572e1SStephen Rothwell #define HMT_MEDIUM_LOW  or	6,6,6		# medium low priority
167b8b572e1SStephen Rothwell #define HMT_MEDIUM	or	2,2,2
168b8b572e1SStephen Rothwell #define HMT_MEDIUM_HIGH or	5,5,5		# medium high priority
169b8b572e1SStephen Rothwell #define HMT_HIGH	or	3,3,3
170b8b572e1SStephen Rothwell 
171b8b572e1SStephen Rothwell #ifdef __KERNEL__
172b8b572e1SStephen Rothwell #ifdef CONFIG_PPC64
173b8b572e1SStephen Rothwell 
174b8b572e1SStephen Rothwell #define XGLUE(a,b) a##b
175b8b572e1SStephen Rothwell #define GLUE(a,b) XGLUE(a,b)
176b8b572e1SStephen Rothwell 
177b8b572e1SStephen Rothwell #define _GLOBAL(name) \
178b8b572e1SStephen Rothwell 	.section ".text"; \
179b8b572e1SStephen Rothwell 	.align 2 ; \
180b8b572e1SStephen Rothwell 	.globl name; \
181b8b572e1SStephen Rothwell 	.globl GLUE(.,name); \
182b8b572e1SStephen Rothwell 	.section ".opd","aw"; \
183b8b572e1SStephen Rothwell name: \
184b8b572e1SStephen Rothwell 	.quad GLUE(.,name); \
185b8b572e1SStephen Rothwell 	.quad .TOC.@tocbase; \
186b8b572e1SStephen Rothwell 	.quad 0; \
187b8b572e1SStephen Rothwell 	.previous; \
188b8b572e1SStephen Rothwell 	.type GLUE(.,name),@function; \
189b8b572e1SStephen Rothwell GLUE(.,name):
190b8b572e1SStephen Rothwell 
191b8b572e1SStephen Rothwell #define _INIT_GLOBAL(name) \
192b8b572e1SStephen Rothwell 	.section ".text.init.refok"; \
193b8b572e1SStephen Rothwell 	.align 2 ; \
194b8b572e1SStephen Rothwell 	.globl name; \
195b8b572e1SStephen Rothwell 	.globl GLUE(.,name); \
196b8b572e1SStephen Rothwell 	.section ".opd","aw"; \
197b8b572e1SStephen Rothwell name: \
198b8b572e1SStephen Rothwell 	.quad GLUE(.,name); \
199b8b572e1SStephen Rothwell 	.quad .TOC.@tocbase; \
200b8b572e1SStephen Rothwell 	.quad 0; \
201b8b572e1SStephen Rothwell 	.previous; \
202b8b572e1SStephen Rothwell 	.type GLUE(.,name),@function; \
203b8b572e1SStephen Rothwell GLUE(.,name):
204b8b572e1SStephen Rothwell 
205b8b572e1SStephen Rothwell #define _KPROBE(name) \
206b8b572e1SStephen Rothwell 	.section ".kprobes.text","a"; \
207b8b572e1SStephen Rothwell 	.align 2 ; \
208b8b572e1SStephen Rothwell 	.globl name; \
209b8b572e1SStephen Rothwell 	.globl GLUE(.,name); \
210b8b572e1SStephen Rothwell 	.section ".opd","aw"; \
211b8b572e1SStephen Rothwell name: \
212b8b572e1SStephen Rothwell 	.quad GLUE(.,name); \
213b8b572e1SStephen Rothwell 	.quad .TOC.@tocbase; \
214b8b572e1SStephen Rothwell 	.quad 0; \
215b8b572e1SStephen Rothwell 	.previous; \
216b8b572e1SStephen Rothwell 	.type GLUE(.,name),@function; \
217b8b572e1SStephen Rothwell GLUE(.,name):
218b8b572e1SStephen Rothwell 
219b8b572e1SStephen Rothwell #define _STATIC(name) \
220b8b572e1SStephen Rothwell 	.section ".text"; \
221b8b572e1SStephen Rothwell 	.align 2 ; \
222b8b572e1SStephen Rothwell 	.section ".opd","aw"; \
223b8b572e1SStephen Rothwell name: \
224b8b572e1SStephen Rothwell 	.quad GLUE(.,name); \
225b8b572e1SStephen Rothwell 	.quad .TOC.@tocbase; \
226b8b572e1SStephen Rothwell 	.quad 0; \
227b8b572e1SStephen Rothwell 	.previous; \
228b8b572e1SStephen Rothwell 	.type GLUE(.,name),@function; \
229b8b572e1SStephen Rothwell GLUE(.,name):
230b8b572e1SStephen Rothwell 
231b8b572e1SStephen Rothwell #define _INIT_STATIC(name) \
232b8b572e1SStephen Rothwell 	.section ".text.init.refok"; \
233b8b572e1SStephen Rothwell 	.align 2 ; \
234b8b572e1SStephen Rothwell 	.section ".opd","aw"; \
235b8b572e1SStephen Rothwell name: \
236b8b572e1SStephen Rothwell 	.quad GLUE(.,name); \
237b8b572e1SStephen Rothwell 	.quad .TOC.@tocbase; \
238b8b572e1SStephen Rothwell 	.quad 0; \
239b8b572e1SStephen Rothwell 	.previous; \
240b8b572e1SStephen Rothwell 	.type GLUE(.,name),@function; \
241b8b572e1SStephen Rothwell GLUE(.,name):
242b8b572e1SStephen Rothwell 
243b8b572e1SStephen Rothwell #else /* 32-bit */
244b8b572e1SStephen Rothwell 
245b8b572e1SStephen Rothwell #define _ENTRY(n)	\
246b8b572e1SStephen Rothwell 	.globl n;	\
247b8b572e1SStephen Rothwell n:
248b8b572e1SStephen Rothwell 
249b8b572e1SStephen Rothwell #define _GLOBAL(n)	\
250b8b572e1SStephen Rothwell 	.text;		\
251b8b572e1SStephen Rothwell 	.stabs __stringify(n:F-1),N_FUN,0,0,n;\
252b8b572e1SStephen Rothwell 	.globl n;	\
253b8b572e1SStephen Rothwell n:
254b8b572e1SStephen Rothwell 
255b8b572e1SStephen Rothwell #define _KPROBE(n)	\
256b8b572e1SStephen Rothwell 	.section ".kprobes.text","a";	\
257b8b572e1SStephen Rothwell 	.globl	n;	\
258b8b572e1SStephen Rothwell n:
259b8b572e1SStephen Rothwell 
260b8b572e1SStephen Rothwell #endif
261b8b572e1SStephen Rothwell 
262b8b572e1SStephen Rothwell /*
263b8b572e1SStephen Rothwell  * LOAD_REG_IMMEDIATE(rn, expr)
264b8b572e1SStephen Rothwell  *   Loads the value of the constant expression 'expr' into register 'rn'
265b8b572e1SStephen Rothwell  *   using immediate instructions only.  Use this when it's important not
266b8b572e1SStephen Rothwell  *   to reference other data (i.e. on ppc64 when the TOC pointer is not
267e31aa453SPaul Mackerras  *   valid) and when 'expr' is a constant or absolute address.
268b8b572e1SStephen Rothwell  *
269b8b572e1SStephen Rothwell  * LOAD_REG_ADDR(rn, name)
270b8b572e1SStephen Rothwell  *   Loads the address of label 'name' into register 'rn'.  Use this when
271b8b572e1SStephen Rothwell  *   you don't particularly need immediate instructions only, but you need
272b8b572e1SStephen Rothwell  *   the whole address in one register (e.g. it's a structure address and
273b8b572e1SStephen Rothwell  *   you want to access various offsets within it).  On ppc32 this is
274b8b572e1SStephen Rothwell  *   identical to LOAD_REG_IMMEDIATE.
275b8b572e1SStephen Rothwell  *
276b8b572e1SStephen Rothwell  * LOAD_REG_ADDRBASE(rn, name)
277b8b572e1SStephen Rothwell  * ADDROFF(name)
278b8b572e1SStephen Rothwell  *   LOAD_REG_ADDRBASE loads part of the address of label 'name' into
279b8b572e1SStephen Rothwell  *   register 'rn'.  ADDROFF(name) returns the remainder of the address as
280b8b572e1SStephen Rothwell  *   a constant expression.  ADDROFF(name) is a signed expression < 16 bits
281b8b572e1SStephen Rothwell  *   in size, so is suitable for use directly as an offset in load and store
282b8b572e1SStephen Rothwell  *   instructions.  Use this when loading/storing a single word or less as:
283b8b572e1SStephen Rothwell  *      LOAD_REG_ADDRBASE(rX, name)
284b8b572e1SStephen Rothwell  *      ld	rY,ADDROFF(name)(rX)
285b8b572e1SStephen Rothwell  */
286b8b572e1SStephen Rothwell #ifdef __powerpc64__
287b8b572e1SStephen Rothwell #define LOAD_REG_IMMEDIATE(reg,expr)		\
288b8b572e1SStephen Rothwell 	lis     (reg),(expr)@highest;		\
289b8b572e1SStephen Rothwell 	ori     (reg),(reg),(expr)@higher;	\
290b8b572e1SStephen Rothwell 	rldicr  (reg),(reg),32,31;		\
291b8b572e1SStephen Rothwell 	oris    (reg),(reg),(expr)@h;		\
292b8b572e1SStephen Rothwell 	ori     (reg),(reg),(expr)@l;
293b8b572e1SStephen Rothwell 
294b8b572e1SStephen Rothwell #define LOAD_REG_ADDR(reg,name)			\
295b8b572e1SStephen Rothwell 	ld	(reg),name@got(r2)
296b8b572e1SStephen Rothwell 
297b8b572e1SStephen Rothwell #define LOAD_REG_ADDRBASE(reg,name)	LOAD_REG_ADDR(reg,name)
298b8b572e1SStephen Rothwell #define ADDROFF(name)			0
299b8b572e1SStephen Rothwell 
300b8b572e1SStephen Rothwell /* offsets for stack frame layout */
301b8b572e1SStephen Rothwell #define LRSAVE	16
302b8b572e1SStephen Rothwell 
303b8b572e1SStephen Rothwell #else /* 32-bit */
304b8b572e1SStephen Rothwell 
305b8b572e1SStephen Rothwell #define LOAD_REG_IMMEDIATE(reg,expr)		\
306b8b572e1SStephen Rothwell 	lis	(reg),(expr)@ha;		\
307b8b572e1SStephen Rothwell 	addi	(reg),(reg),(expr)@l;
308b8b572e1SStephen Rothwell 
309b8b572e1SStephen Rothwell #define LOAD_REG_ADDR(reg,name)		LOAD_REG_IMMEDIATE(reg, name)
310b8b572e1SStephen Rothwell 
311b8b572e1SStephen Rothwell #define LOAD_REG_ADDRBASE(reg, name)	lis	(reg),name@ha
312b8b572e1SStephen Rothwell #define ADDROFF(name)			name@l
313b8b572e1SStephen Rothwell 
314b8b572e1SStephen Rothwell /* offsets for stack frame layout */
315b8b572e1SStephen Rothwell #define LRSAVE	4
316b8b572e1SStephen Rothwell 
317b8b572e1SStephen Rothwell #endif
318b8b572e1SStephen Rothwell 
319b8b572e1SStephen Rothwell /* various errata or part fixups */
320b8b572e1SStephen Rothwell #ifdef CONFIG_PPC601_SYNC_FIX
321b8b572e1SStephen Rothwell #define SYNC				\
322b8b572e1SStephen Rothwell BEGIN_FTR_SECTION			\
323b8b572e1SStephen Rothwell 	sync;				\
324b8b572e1SStephen Rothwell 	isync;				\
325b8b572e1SStephen Rothwell END_FTR_SECTION_IFSET(CPU_FTR_601)
326b8b572e1SStephen Rothwell #define SYNC_601			\
327b8b572e1SStephen Rothwell BEGIN_FTR_SECTION			\
328b8b572e1SStephen Rothwell 	sync;				\
329b8b572e1SStephen Rothwell END_FTR_SECTION_IFSET(CPU_FTR_601)
330b8b572e1SStephen Rothwell #define ISYNC_601			\
331b8b572e1SStephen Rothwell BEGIN_FTR_SECTION			\
332b8b572e1SStephen Rothwell 	isync;				\
333b8b572e1SStephen Rothwell END_FTR_SECTION_IFSET(CPU_FTR_601)
334b8b572e1SStephen Rothwell #else
335b8b572e1SStephen Rothwell #define	SYNC
336b8b572e1SStephen Rothwell #define SYNC_601
337b8b572e1SStephen Rothwell #define ISYNC_601
338b8b572e1SStephen Rothwell #endif
339b8b572e1SStephen Rothwell 
340b8b572e1SStephen Rothwell #ifdef CONFIG_PPC_CELL
341b8b572e1SStephen Rothwell #define MFTB(dest)			\
342b8b572e1SStephen Rothwell 90:	mftb  dest;			\
343b8b572e1SStephen Rothwell BEGIN_FTR_SECTION_NESTED(96);		\
344b8b572e1SStephen Rothwell 	cmpwi dest,0;			\
345b8b572e1SStephen Rothwell 	beq-  90b;			\
346b8b572e1SStephen Rothwell END_FTR_SECTION_NESTED(CPU_FTR_CELL_TB_BUG, CPU_FTR_CELL_TB_BUG, 96)
347b8b572e1SStephen Rothwell #else
348b8b572e1SStephen Rothwell #define MFTB(dest)			mftb dest
349b8b572e1SStephen Rothwell #endif
350b8b572e1SStephen Rothwell 
351b8b572e1SStephen Rothwell #ifndef CONFIG_SMP
352b8b572e1SStephen Rothwell #define TLBSYNC
353b8b572e1SStephen Rothwell #else /* CONFIG_SMP */
354b8b572e1SStephen Rothwell /* tlbsync is not implemented on 601 */
355b8b572e1SStephen Rothwell #define TLBSYNC				\
356b8b572e1SStephen Rothwell BEGIN_FTR_SECTION			\
357b8b572e1SStephen Rothwell 	tlbsync;			\
358b8b572e1SStephen Rothwell 	sync;				\
359b8b572e1SStephen Rothwell END_FTR_SECTION_IFCLR(CPU_FTR_601)
360b8b572e1SStephen Rothwell #endif
361b8b572e1SStephen Rothwell 
362b8b572e1SStephen Rothwell 
363b8b572e1SStephen Rothwell /*
364b8b572e1SStephen Rothwell  * This instruction is not implemented on the PPC 603 or 601; however, on
365b8b572e1SStephen Rothwell  * the 403GCX and 405GP tlbia IS defined and tlbie is not.
366b8b572e1SStephen Rothwell  * All of these instructions exist in the 8xx, they have magical powers,
367b8b572e1SStephen Rothwell  * and they must be used.
368b8b572e1SStephen Rothwell  */
369b8b572e1SStephen Rothwell 
370b8b572e1SStephen Rothwell #if !defined(CONFIG_4xx) && !defined(CONFIG_8xx)
371b8b572e1SStephen Rothwell #define tlbia					\
372b8b572e1SStephen Rothwell 	li	r4,1024;			\
373b8b572e1SStephen Rothwell 	mtctr	r4;				\
374b8b572e1SStephen Rothwell 	lis	r4,KERNELBASE@h;		\
375b8b572e1SStephen Rothwell 0:	tlbie	r4;				\
376b8b572e1SStephen Rothwell 	addi	r4,r4,0x1000;			\
377b8b572e1SStephen Rothwell 	bdnz	0b
378b8b572e1SStephen Rothwell #endif
379b8b572e1SStephen Rothwell 
380b8b572e1SStephen Rothwell 
381b8b572e1SStephen Rothwell #ifdef CONFIG_IBM440EP_ERR42
382b8b572e1SStephen Rothwell #define PPC440EP_ERR42 isync
383b8b572e1SStephen Rothwell #else
384b8b572e1SStephen Rothwell #define PPC440EP_ERR42
385b8b572e1SStephen Rothwell #endif
386b8b572e1SStephen Rothwell 
387b8b572e1SStephen Rothwell 
388b8b572e1SStephen Rothwell #if defined(CONFIG_BOOKE)
389b8b572e1SStephen Rothwell #define toreal(rd)
390b8b572e1SStephen Rothwell #define fromreal(rd)
391b8b572e1SStephen Rothwell 
392b8b572e1SStephen Rothwell /*
393b8b572e1SStephen Rothwell  * We use addis to ensure compatibility with the "classic" ppc versions of
394b8b572e1SStephen Rothwell  * these macros, which use rs = 0 to get the tophys offset in rd, rather than
395b8b572e1SStephen Rothwell  * converting the address in r0, and so this version has to do that too
396b8b572e1SStephen Rothwell  * (i.e. set register rd to 0 when rs == 0).
397b8b572e1SStephen Rothwell  */
398b8b572e1SStephen Rothwell #define tophys(rd,rs)				\
399b8b572e1SStephen Rothwell 	addis	rd,rs,0
400b8b572e1SStephen Rothwell 
401b8b572e1SStephen Rothwell #define tovirt(rd,rs)				\
402b8b572e1SStephen Rothwell 	addis	rd,rs,0
403b8b572e1SStephen Rothwell 
404b8b572e1SStephen Rothwell #elif defined(CONFIG_PPC64)
405b8b572e1SStephen Rothwell #define toreal(rd)		/* we can access c000... in real mode */
406b8b572e1SStephen Rothwell #define fromreal(rd)
407b8b572e1SStephen Rothwell 
408b8b572e1SStephen Rothwell #define tophys(rd,rs)                           \
409b8b572e1SStephen Rothwell 	clrldi	rd,rs,2
410b8b572e1SStephen Rothwell 
411b8b572e1SStephen Rothwell #define tovirt(rd,rs)                           \
412b8b572e1SStephen Rothwell 	rotldi	rd,rs,16;			\
413b8b572e1SStephen Rothwell 	ori	rd,rd,((KERNELBASE>>48)&0xFFFF);\
414b8b572e1SStephen Rothwell 	rotldi	rd,rd,48
415b8b572e1SStephen Rothwell #else
416b8b572e1SStephen Rothwell /*
417b8b572e1SStephen Rothwell  * On APUS (Amiga PowerPC cpu upgrade board), we don't know the
418b8b572e1SStephen Rothwell  * physical base address of RAM at compile time.
419b8b572e1SStephen Rothwell  */
420b8b572e1SStephen Rothwell #define toreal(rd)	tophys(rd,rd)
421b8b572e1SStephen Rothwell #define fromreal(rd)	tovirt(rd,rd)
422b8b572e1SStephen Rothwell 
423b8b572e1SStephen Rothwell #define tophys(rd,rs)				\
424ccdcef72SDale Farnsworth 0:	addis	rd,rs,-PAGE_OFFSET@h;		\
425b8b572e1SStephen Rothwell 	.section ".vtop_fixup","aw";		\
426b8b572e1SStephen Rothwell 	.align  1;				\
427b8b572e1SStephen Rothwell 	.long   0b;				\
428b8b572e1SStephen Rothwell 	.previous
429b8b572e1SStephen Rothwell 
430b8b572e1SStephen Rothwell #define tovirt(rd,rs)				\
431ccdcef72SDale Farnsworth 0:	addis	rd,rs,PAGE_OFFSET@h;		\
432b8b572e1SStephen Rothwell 	.section ".ptov_fixup","aw";		\
433b8b572e1SStephen Rothwell 	.align  1;				\
434b8b572e1SStephen Rothwell 	.long   0b;				\
435b8b572e1SStephen Rothwell 	.previous
436b8b572e1SStephen Rothwell #endif
437b8b572e1SStephen Rothwell 
438b8b572e1SStephen Rothwell #ifdef CONFIG_PPC64
439b8b572e1SStephen Rothwell #define RFI		rfid
440b8b572e1SStephen Rothwell #define MTMSRD(r)	mtmsrd	r
441b8b572e1SStephen Rothwell 
442b8b572e1SStephen Rothwell #else
443b8b572e1SStephen Rothwell #define FIX_SRR1(ra, rb)
444b8b572e1SStephen Rothwell #ifndef CONFIG_40x
445b8b572e1SStephen Rothwell #define	RFI		rfi
446b8b572e1SStephen Rothwell #else
447b8b572e1SStephen Rothwell #define RFI		rfi; b .	/* Prevent prefetch past rfi */
448b8b572e1SStephen Rothwell #endif
449b8b572e1SStephen Rothwell #define MTMSRD(r)	mtmsr	r
450b8b572e1SStephen Rothwell #define CLR_TOP32(r)
451b8b572e1SStephen Rothwell #endif
452b8b572e1SStephen Rothwell 
453b8b572e1SStephen Rothwell #endif /* __KERNEL__ */
454b8b572e1SStephen Rothwell 
455b8b572e1SStephen Rothwell /* The boring bits... */
456b8b572e1SStephen Rothwell 
457b8b572e1SStephen Rothwell /* Condition Register Bit Fields */
458b8b572e1SStephen Rothwell 
459b8b572e1SStephen Rothwell #define	cr0	0
460b8b572e1SStephen Rothwell #define	cr1	1
461b8b572e1SStephen Rothwell #define	cr2	2
462b8b572e1SStephen Rothwell #define	cr3	3
463b8b572e1SStephen Rothwell #define	cr4	4
464b8b572e1SStephen Rothwell #define	cr5	5
465b8b572e1SStephen Rothwell #define	cr6	6
466b8b572e1SStephen Rothwell #define	cr7	7
467b8b572e1SStephen Rothwell 
468b8b572e1SStephen Rothwell 
469b8b572e1SStephen Rothwell /* General Purpose Registers (GPRs) */
470b8b572e1SStephen Rothwell 
471b8b572e1SStephen Rothwell #define	r0	0
472b8b572e1SStephen Rothwell #define	r1	1
473b8b572e1SStephen Rothwell #define	r2	2
474b8b572e1SStephen Rothwell #define	r3	3
475b8b572e1SStephen Rothwell #define	r4	4
476b8b572e1SStephen Rothwell #define	r5	5
477b8b572e1SStephen Rothwell #define	r6	6
478b8b572e1SStephen Rothwell #define	r7	7
479b8b572e1SStephen Rothwell #define	r8	8
480b8b572e1SStephen Rothwell #define	r9	9
481b8b572e1SStephen Rothwell #define	r10	10
482b8b572e1SStephen Rothwell #define	r11	11
483b8b572e1SStephen Rothwell #define	r12	12
484b8b572e1SStephen Rothwell #define	r13	13
485b8b572e1SStephen Rothwell #define	r14	14
486b8b572e1SStephen Rothwell #define	r15	15
487b8b572e1SStephen Rothwell #define	r16	16
488b8b572e1SStephen Rothwell #define	r17	17
489b8b572e1SStephen Rothwell #define	r18	18
490b8b572e1SStephen Rothwell #define	r19	19
491b8b572e1SStephen Rothwell #define	r20	20
492b8b572e1SStephen Rothwell #define	r21	21
493b8b572e1SStephen Rothwell #define	r22	22
494b8b572e1SStephen Rothwell #define	r23	23
495b8b572e1SStephen Rothwell #define	r24	24
496b8b572e1SStephen Rothwell #define	r25	25
497b8b572e1SStephen Rothwell #define	r26	26
498b8b572e1SStephen Rothwell #define	r27	27
499b8b572e1SStephen Rothwell #define	r28	28
500b8b572e1SStephen Rothwell #define	r29	29
501b8b572e1SStephen Rothwell #define	r30	30
502b8b572e1SStephen Rothwell #define	r31	31
503b8b572e1SStephen Rothwell 
504b8b572e1SStephen Rothwell 
505b8b572e1SStephen Rothwell /* Floating Point Registers (FPRs) */
506b8b572e1SStephen Rothwell 
507b8b572e1SStephen Rothwell #define	fr0	0
508b8b572e1SStephen Rothwell #define	fr1	1
509b8b572e1SStephen Rothwell #define	fr2	2
510b8b572e1SStephen Rothwell #define	fr3	3
511b8b572e1SStephen Rothwell #define	fr4	4
512b8b572e1SStephen Rothwell #define	fr5	5
513b8b572e1SStephen Rothwell #define	fr6	6
514b8b572e1SStephen Rothwell #define	fr7	7
515b8b572e1SStephen Rothwell #define	fr8	8
516b8b572e1SStephen Rothwell #define	fr9	9
517b8b572e1SStephen Rothwell #define	fr10	10
518b8b572e1SStephen Rothwell #define	fr11	11
519b8b572e1SStephen Rothwell #define	fr12	12
520b8b572e1SStephen Rothwell #define	fr13	13
521b8b572e1SStephen Rothwell #define	fr14	14
522b8b572e1SStephen Rothwell #define	fr15	15
523b8b572e1SStephen Rothwell #define	fr16	16
524b8b572e1SStephen Rothwell #define	fr17	17
525b8b572e1SStephen Rothwell #define	fr18	18
526b8b572e1SStephen Rothwell #define	fr19	19
527b8b572e1SStephen Rothwell #define	fr20	20
528b8b572e1SStephen Rothwell #define	fr21	21
529b8b572e1SStephen Rothwell #define	fr22	22
530b8b572e1SStephen Rothwell #define	fr23	23
531b8b572e1SStephen Rothwell #define	fr24	24
532b8b572e1SStephen Rothwell #define	fr25	25
533b8b572e1SStephen Rothwell #define	fr26	26
534b8b572e1SStephen Rothwell #define	fr27	27
535b8b572e1SStephen Rothwell #define	fr28	28
536b8b572e1SStephen Rothwell #define	fr29	29
537b8b572e1SStephen Rothwell #define	fr30	30
538b8b572e1SStephen Rothwell #define	fr31	31
539b8b572e1SStephen Rothwell 
540b8b572e1SStephen Rothwell /* AltiVec Registers (VPRs) */
541b8b572e1SStephen Rothwell 
542b8b572e1SStephen Rothwell #define	vr0	0
543b8b572e1SStephen Rothwell #define	vr1	1
544b8b572e1SStephen Rothwell #define	vr2	2
545b8b572e1SStephen Rothwell #define	vr3	3
546b8b572e1SStephen Rothwell #define	vr4	4
547b8b572e1SStephen Rothwell #define	vr5	5
548b8b572e1SStephen Rothwell #define	vr6	6
549b8b572e1SStephen Rothwell #define	vr7	7
550b8b572e1SStephen Rothwell #define	vr8	8
551b8b572e1SStephen Rothwell #define	vr9	9
552b8b572e1SStephen Rothwell #define	vr10	10
553b8b572e1SStephen Rothwell #define	vr11	11
554b8b572e1SStephen Rothwell #define	vr12	12
555b8b572e1SStephen Rothwell #define	vr13	13
556b8b572e1SStephen Rothwell #define	vr14	14
557b8b572e1SStephen Rothwell #define	vr15	15
558b8b572e1SStephen Rothwell #define	vr16	16
559b8b572e1SStephen Rothwell #define	vr17	17
560b8b572e1SStephen Rothwell #define	vr18	18
561b8b572e1SStephen Rothwell #define	vr19	19
562b8b572e1SStephen Rothwell #define	vr20	20
563b8b572e1SStephen Rothwell #define	vr21	21
564b8b572e1SStephen Rothwell #define	vr22	22
565b8b572e1SStephen Rothwell #define	vr23	23
566b8b572e1SStephen Rothwell #define	vr24	24
567b8b572e1SStephen Rothwell #define	vr25	25
568b8b572e1SStephen Rothwell #define	vr26	26
569b8b572e1SStephen Rothwell #define	vr27	27
570b8b572e1SStephen Rothwell #define	vr28	28
571b8b572e1SStephen Rothwell #define	vr29	29
572b8b572e1SStephen Rothwell #define	vr30	30
573b8b572e1SStephen Rothwell #define	vr31	31
574b8b572e1SStephen Rothwell 
575b8b572e1SStephen Rothwell /* VSX Registers (VSRs) */
576b8b572e1SStephen Rothwell 
577b8b572e1SStephen Rothwell #define	vsr0	0
578b8b572e1SStephen Rothwell #define	vsr1	1
579b8b572e1SStephen Rothwell #define	vsr2	2
580b8b572e1SStephen Rothwell #define	vsr3	3
581b8b572e1SStephen Rothwell #define	vsr4	4
582b8b572e1SStephen Rothwell #define	vsr5	5
583b8b572e1SStephen Rothwell #define	vsr6	6
584b8b572e1SStephen Rothwell #define	vsr7	7
585b8b572e1SStephen Rothwell #define	vsr8	8
586b8b572e1SStephen Rothwell #define	vsr9	9
587b8b572e1SStephen Rothwell #define	vsr10	10
588b8b572e1SStephen Rothwell #define	vsr11	11
589b8b572e1SStephen Rothwell #define	vsr12	12
590b8b572e1SStephen Rothwell #define	vsr13	13
591b8b572e1SStephen Rothwell #define	vsr14	14
592b8b572e1SStephen Rothwell #define	vsr15	15
593b8b572e1SStephen Rothwell #define	vsr16	16
594b8b572e1SStephen Rothwell #define	vsr17	17
595b8b572e1SStephen Rothwell #define	vsr18	18
596b8b572e1SStephen Rothwell #define	vsr19	19
597b8b572e1SStephen Rothwell #define	vsr20	20
598b8b572e1SStephen Rothwell #define	vsr21	21
599b8b572e1SStephen Rothwell #define	vsr22	22
600b8b572e1SStephen Rothwell #define	vsr23	23
601b8b572e1SStephen Rothwell #define	vsr24	24
602b8b572e1SStephen Rothwell #define	vsr25	25
603b8b572e1SStephen Rothwell #define	vsr26	26
604b8b572e1SStephen Rothwell #define	vsr27	27
605b8b572e1SStephen Rothwell #define	vsr28	28
606b8b572e1SStephen Rothwell #define	vsr29	29
607b8b572e1SStephen Rothwell #define	vsr30	30
608b8b572e1SStephen Rothwell #define	vsr31	31
609b8b572e1SStephen Rothwell #define	vsr32	32
610b8b572e1SStephen Rothwell #define	vsr33	33
611b8b572e1SStephen Rothwell #define	vsr34	34
612b8b572e1SStephen Rothwell #define	vsr35	35
613b8b572e1SStephen Rothwell #define	vsr36	36
614b8b572e1SStephen Rothwell #define	vsr37	37
615b8b572e1SStephen Rothwell #define	vsr38	38
616b8b572e1SStephen Rothwell #define	vsr39	39
617b8b572e1SStephen Rothwell #define	vsr40	40
618b8b572e1SStephen Rothwell #define	vsr41	41
619b8b572e1SStephen Rothwell #define	vsr42	42
620b8b572e1SStephen Rothwell #define	vsr43	43
621b8b572e1SStephen Rothwell #define	vsr44	44
622b8b572e1SStephen Rothwell #define	vsr45	45
623b8b572e1SStephen Rothwell #define	vsr46	46
624b8b572e1SStephen Rothwell #define	vsr47	47
625b8b572e1SStephen Rothwell #define	vsr48	48
626b8b572e1SStephen Rothwell #define	vsr49	49
627b8b572e1SStephen Rothwell #define	vsr50	50
628b8b572e1SStephen Rothwell #define	vsr51	51
629b8b572e1SStephen Rothwell #define	vsr52	52
630b8b572e1SStephen Rothwell #define	vsr53	53
631b8b572e1SStephen Rothwell #define	vsr54	54
632b8b572e1SStephen Rothwell #define	vsr55	55
633b8b572e1SStephen Rothwell #define	vsr56	56
634b8b572e1SStephen Rothwell #define	vsr57	57
635b8b572e1SStephen Rothwell #define	vsr58	58
636b8b572e1SStephen Rothwell #define	vsr59	59
637b8b572e1SStephen Rothwell #define	vsr60	60
638b8b572e1SStephen Rothwell #define	vsr61	61
639b8b572e1SStephen Rothwell #define	vsr62	62
640b8b572e1SStephen Rothwell #define	vsr63	63
641b8b572e1SStephen Rothwell 
642b8b572e1SStephen Rothwell /* SPE Registers (EVPRs) */
643b8b572e1SStephen Rothwell 
644b8b572e1SStephen Rothwell #define	evr0	0
645b8b572e1SStephen Rothwell #define	evr1	1
646b8b572e1SStephen Rothwell #define	evr2	2
647b8b572e1SStephen Rothwell #define	evr3	3
648b8b572e1SStephen Rothwell #define	evr4	4
649b8b572e1SStephen Rothwell #define	evr5	5
650b8b572e1SStephen Rothwell #define	evr6	6
651b8b572e1SStephen Rothwell #define	evr7	7
652b8b572e1SStephen Rothwell #define	evr8	8
653b8b572e1SStephen Rothwell #define	evr9	9
654b8b572e1SStephen Rothwell #define	evr10	10
655b8b572e1SStephen Rothwell #define	evr11	11
656b8b572e1SStephen Rothwell #define	evr12	12
657b8b572e1SStephen Rothwell #define	evr13	13
658b8b572e1SStephen Rothwell #define	evr14	14
659b8b572e1SStephen Rothwell #define	evr15	15
660b8b572e1SStephen Rothwell #define	evr16	16
661b8b572e1SStephen Rothwell #define	evr17	17
662b8b572e1SStephen Rothwell #define	evr18	18
663b8b572e1SStephen Rothwell #define	evr19	19
664b8b572e1SStephen Rothwell #define	evr20	20
665b8b572e1SStephen Rothwell #define	evr21	21
666b8b572e1SStephen Rothwell #define	evr22	22
667b8b572e1SStephen Rothwell #define	evr23	23
668b8b572e1SStephen Rothwell #define	evr24	24
669b8b572e1SStephen Rothwell #define	evr25	25
670b8b572e1SStephen Rothwell #define	evr26	26
671b8b572e1SStephen Rothwell #define	evr27	27
672b8b572e1SStephen Rothwell #define	evr28	28
673b8b572e1SStephen Rothwell #define	evr29	29
674b8b572e1SStephen Rothwell #define	evr30	30
675b8b572e1SStephen Rothwell #define	evr31	31
676b8b572e1SStephen Rothwell 
677b8b572e1SStephen Rothwell /* some stab codes */
678b8b572e1SStephen Rothwell #define N_FUN	36
679b8b572e1SStephen Rothwell #define N_RSYM	64
680b8b572e1SStephen Rothwell #define N_SLINE	68
681b8b572e1SStephen Rothwell #define N_SO	100
682b8b572e1SStephen Rothwell 
683b8b572e1SStephen Rothwell #endif /*  __ASSEMBLY__ */
684b8b572e1SStephen Rothwell 
685b8b572e1SStephen Rothwell #endif /* _ASM_POWERPC_PPC_ASM_H */
686