blob: 8f0426f973c946ea50c9052ee9436f2bd1aca3df [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
Linus Torvalds1da177e2005-04-16 15:20:36 -07002 * Copyright (C) 1995-1999 Gary Thomas, Paul Mackerras, Cort Dougan.
Linus Torvalds1da177e2005-04-16 15:20:36 -07003 */
Kumar Gala5f7c6902005-09-09 15:02:25 -05004#ifndef _ASM_POWERPC_PPC_ASM_H
5#define _ASM_POWERPC_PPC_ASM_H
6
Paul Mackerras40ef8cb2005-10-10 22:50:37 +10007#include <linux/stringify.h>
David Gibson3ddfbcf2005-11-10 12:56:55 +11008#include <asm/asm-compat.h>
Michael Neuling9c75a312008-06-26 17:07:48 +10009#include <asm/processor.h>
Paul Mackerras40ef8cb2005-10-10 22:50:37 +100010
David Gibson3ddfbcf2005-11-10 12:56:55 +110011#ifndef __ASSEMBLY__
12#error __FILE__ should only be used in assembler files
13#else
14
15#define SZL (BITS_PER_LONG/8)
Linus Torvalds1da177e2005-04-16 15:20:36 -070016
17/*
Paul Mackerrasc6622f62006-02-24 10:06:59 +110018 * Stuff for accurate CPU time accounting.
19 * These macros handle transitions between user and system state
20 * in exception entry and exit and accumulate time to the
21 * user_time and system_time fields in the paca.
22 */
23
24#ifndef CONFIG_VIRT_CPU_ACCOUNTING
25#define ACCOUNT_CPU_USER_ENTRY(ra, rb)
26#define ACCOUNT_CPU_USER_EXIT(ra, rb)
27#else
28#define ACCOUNT_CPU_USER_ENTRY(ra, rb) \
29 beq 2f; /* if from kernel mode */ \
30BEGIN_FTR_SECTION; \
31 mfspr ra,SPRN_PURR; /* get processor util. reg */ \
32END_FTR_SECTION_IFSET(CPU_FTR_PURR); \
33BEGIN_FTR_SECTION; \
Benjamin Herrenschmidt859deea2006-10-20 14:37:05 +100034 MFTB(ra); /* or get TB if no PURR */ \
Paul Mackerrasc6622f62006-02-24 10:06:59 +110035END_FTR_SECTION_IFCLR(CPU_FTR_PURR); \
Benjamin Herrenschmidt859deea2006-10-20 14:37:05 +100036 ld rb,PACA_STARTPURR(r13); \
Paul Mackerrasc6622f62006-02-24 10:06:59 +110037 std ra,PACA_STARTPURR(r13); \
38 subf rb,rb,ra; /* subtract start value */ \
39 ld ra,PACA_USER_TIME(r13); \
40 add ra,ra,rb; /* add on to user time */ \
41 std ra,PACA_USER_TIME(r13); \
422:
43
44#define ACCOUNT_CPU_USER_EXIT(ra, rb) \
45BEGIN_FTR_SECTION; \
46 mfspr ra,SPRN_PURR; /* get processor util. reg */ \
47END_FTR_SECTION_IFSET(CPU_FTR_PURR); \
48BEGIN_FTR_SECTION; \
Benjamin Herrenschmidt859deea2006-10-20 14:37:05 +100049 MFTB(ra); /* or get TB if no PURR */ \
Paul Mackerrasc6622f62006-02-24 10:06:59 +110050END_FTR_SECTION_IFCLR(CPU_FTR_PURR); \
Benjamin Herrenschmidt859deea2006-10-20 14:37:05 +100051 ld rb,PACA_STARTPURR(r13); \
Paul Mackerrasc6622f62006-02-24 10:06:59 +110052 std ra,PACA_STARTPURR(r13); \
53 subf rb,rb,ra; /* subtract start value */ \
54 ld ra,PACA_SYSTEM_TIME(r13); \
55 add ra,ra,rb; /* add on to user time */ \
56 std ra,PACA_SYSTEM_TIME(r13);
57#endif
58
59/*
Linus Torvalds1da177e2005-04-16 15:20:36 -070060 * Macros for storing registers into and loading registers from
61 * exception frames.
62 */
Kumar Gala5f7c6902005-09-09 15:02:25 -050063#ifdef __powerpc64__
64#define SAVE_GPR(n, base) std n,GPR0+8*(n)(base)
65#define REST_GPR(n, base) ld n,GPR0+8*(n)(base)
66#define SAVE_NVGPRS(base) SAVE_8GPRS(14, base); SAVE_10GPRS(22, base)
67#define REST_NVGPRS(base) REST_8GPRS(14, base); REST_10GPRS(22, base)
68#else
Linus Torvalds1da177e2005-04-16 15:20:36 -070069#define SAVE_GPR(n, base) stw n,GPR0+4*(n)(base)
Linus Torvalds1da177e2005-04-16 15:20:36 -070070#define REST_GPR(n, base) lwz n,GPR0+4*(n)(base)
Linus Torvalds1da177e2005-04-16 15:20:36 -070071#define SAVE_NVGPRS(base) SAVE_GPR(13, base); SAVE_8GPRS(14, base); \
72 SAVE_10GPRS(22, base)
73#define REST_NVGPRS(base) REST_GPR(13, base); REST_8GPRS(14, base); \
74 REST_10GPRS(22, base)
Kumar Gala5f7c6902005-09-09 15:02:25 -050075#endif
76
77
78#define SAVE_2GPRS(n, base) SAVE_GPR(n, base); SAVE_GPR(n+1, base)
79#define SAVE_4GPRS(n, base) SAVE_2GPRS(n, base); SAVE_2GPRS(n+2, base)
80#define SAVE_8GPRS(n, base) SAVE_4GPRS(n, base); SAVE_4GPRS(n+4, base)
81#define SAVE_10GPRS(n, base) SAVE_8GPRS(n, base); SAVE_2GPRS(n+8, base)
82#define REST_2GPRS(n, base) REST_GPR(n, base); REST_GPR(n+1, base)
83#define REST_4GPRS(n, base) REST_2GPRS(n, base); REST_2GPRS(n+2, base)
84#define REST_8GPRS(n, base) REST_4GPRS(n, base); REST_4GPRS(n+4, base)
85#define REST_10GPRS(n, base) REST_8GPRS(n, base); REST_2GPRS(n+8, base)
Linus Torvalds1da177e2005-04-16 15:20:36 -070086
Michael Neuling9c75a312008-06-26 17:07:48 +100087#define SAVE_FPR(n, base) stfd n,THREAD_FPR0+8*TS_FPRWIDTH*(n)(base)
Linus Torvalds1da177e2005-04-16 15:20:36 -070088#define SAVE_2FPRS(n, base) SAVE_FPR(n, base); SAVE_FPR(n+1, base)
89#define SAVE_4FPRS(n, base) SAVE_2FPRS(n, base); SAVE_2FPRS(n+2, base)
90#define SAVE_8FPRS(n, base) SAVE_4FPRS(n, base); SAVE_4FPRS(n+4, base)
91#define SAVE_16FPRS(n, base) SAVE_8FPRS(n, base); SAVE_8FPRS(n+8, base)
92#define SAVE_32FPRS(n, base) SAVE_16FPRS(n, base); SAVE_16FPRS(n+16, base)
Michael Neuling9c75a312008-06-26 17:07:48 +100093#define REST_FPR(n, base) lfd n,THREAD_FPR0+8*TS_FPRWIDTH*(n)(base)
Linus Torvalds1da177e2005-04-16 15:20:36 -070094#define REST_2FPRS(n, base) REST_FPR(n, base); REST_FPR(n+1, base)
95#define REST_4FPRS(n, base) REST_2FPRS(n, base); REST_2FPRS(n+2, base)
96#define REST_8FPRS(n, base) REST_4FPRS(n, base); REST_4FPRS(n+4, base)
97#define REST_16FPRS(n, base) REST_8FPRS(n, base); REST_8FPRS(n+8, base)
98#define REST_32FPRS(n, base) REST_16FPRS(n, base); REST_16FPRS(n+16, base)
99
100#define SAVE_VR(n,b,base) li b,THREAD_VR0+(16*(n)); stvx n,b,base
Kumar Gala5f7c6902005-09-09 15:02:25 -0500101#define SAVE_2VRS(n,b,base) SAVE_VR(n,b,base); SAVE_VR(n+1,b,base)
102#define SAVE_4VRS(n,b,base) SAVE_2VRS(n,b,base); SAVE_2VRS(n+2,b,base)
103#define SAVE_8VRS(n,b,base) SAVE_4VRS(n,b,base); SAVE_4VRS(n+4,b,base)
104#define SAVE_16VRS(n,b,base) SAVE_8VRS(n,b,base); SAVE_8VRS(n+8,b,base)
105#define SAVE_32VRS(n,b,base) SAVE_16VRS(n,b,base); SAVE_16VRS(n+16,b,base)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700106#define REST_VR(n,b,base) li b,THREAD_VR0+(16*(n)); lvx n,b,base
Kumar Gala5f7c6902005-09-09 15:02:25 -0500107#define REST_2VRS(n,b,base) REST_VR(n,b,base); REST_VR(n+1,b,base)
108#define REST_4VRS(n,b,base) REST_2VRS(n,b,base); REST_2VRS(n+2,b,base)
109#define REST_8VRS(n,b,base) REST_4VRS(n,b,base); REST_4VRS(n+4,b,base)
110#define REST_16VRS(n,b,base) REST_8VRS(n,b,base); REST_8VRS(n+8,b,base)
111#define REST_32VRS(n,b,base) REST_16VRS(n,b,base); REST_16VRS(n+16,b,base)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700112
113#define SAVE_EVR(n,s,base) evmergehi s,s,n; stw s,THREAD_EVR0+4*(n)(base)
Kumar Gala5f7c6902005-09-09 15:02:25 -0500114#define SAVE_2EVRS(n,s,base) SAVE_EVR(n,s,base); SAVE_EVR(n+1,s,base)
115#define SAVE_4EVRS(n,s,base) SAVE_2EVRS(n,s,base); SAVE_2EVRS(n+2,s,base)
116#define SAVE_8EVRS(n,s,base) SAVE_4EVRS(n,s,base); SAVE_4EVRS(n+4,s,base)
117#define SAVE_16EVRS(n,s,base) SAVE_8EVRS(n,s,base); SAVE_8EVRS(n+8,s,base)
118#define SAVE_32EVRS(n,s,base) SAVE_16EVRS(n,s,base); SAVE_16EVRS(n+16,s,base)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700119#define REST_EVR(n,s,base) lwz s,THREAD_EVR0+4*(n)(base); evmergelo n,s,n
Kumar Gala5f7c6902005-09-09 15:02:25 -0500120#define REST_2EVRS(n,s,base) REST_EVR(n,s,base); REST_EVR(n+1,s,base)
121#define REST_4EVRS(n,s,base) REST_2EVRS(n,s,base); REST_2EVRS(n+2,s,base)
122#define REST_8EVRS(n,s,base) REST_4EVRS(n,s,base); REST_4EVRS(n+4,s,base)
123#define REST_16EVRS(n,s,base) REST_8EVRS(n,s,base); REST_8EVRS(n+8,s,base)
124#define REST_32EVRS(n,s,base) REST_16EVRS(n,s,base); REST_16EVRS(n+16,s,base)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700125
Michael Ellerman8c716322005-10-24 15:07:27 +1000126/* Macros to adjust thread priority for hardware multithreading */
127#define HMT_VERY_LOW or 31,31,31 # very low priority
128#define HMT_LOW or 1,1,1
129#define HMT_MEDIUM_LOW or 6,6,6 # medium low priority
130#define HMT_MEDIUM or 2,2,2
131#define HMT_MEDIUM_HIGH or 5,5,5 # medium high priority
132#define HMT_HIGH or 3,3,3
Kumar Gala5f7c6902005-09-09 15:02:25 -0500133
134/* handle instructions that older assemblers may not know */
135#define RFCI .long 0x4c000066 /* rfci instruction */
136#define RFDI .long 0x4c00004e /* rfdi instruction */
137#define RFMCI .long 0x4c00004c /* rfmci instruction */
138
Arnd Bergmann88ced032005-12-16 22:43:46 +0100139#ifdef __KERNEL__
Paul Mackerras40ef8cb2005-10-10 22:50:37 +1000140#ifdef CONFIG_PPC64
141
142#define XGLUE(a,b) a##b
143#define GLUE(a,b) XGLUE(a,b)
144
145#define _GLOBAL(name) \
146 .section ".text"; \
147 .align 2 ; \
148 .globl name; \
149 .globl GLUE(.,name); \
150 .section ".opd","aw"; \
151name: \
152 .quad GLUE(.,name); \
153 .quad .TOC.@tocbase; \
154 .quad 0; \
155 .previous; \
156 .type GLUE(.,name),@function; \
157GLUE(.,name):
158
Stephen Rothwellfc68e862007-08-22 13:44:58 +1000159#define _INIT_GLOBAL(name) \
160 .section ".text.init.refok"; \
161 .align 2 ; \
162 .globl name; \
163 .globl GLUE(.,name); \
164 .section ".opd","aw"; \
165name: \
166 .quad GLUE(.,name); \
167 .quad .TOC.@tocbase; \
168 .quad 0; \
169 .previous; \
170 .type GLUE(.,name),@function; \
171GLUE(.,name):
172
Paul Mackerras40ef8cb2005-10-10 22:50:37 +1000173#define _KPROBE(name) \
174 .section ".kprobes.text","a"; \
175 .align 2 ; \
176 .globl name; \
177 .globl GLUE(.,name); \
178 .section ".opd","aw"; \
179name: \
180 .quad GLUE(.,name); \
181 .quad .TOC.@tocbase; \
182 .quad 0; \
183 .previous; \
184 .type GLUE(.,name),@function; \
185GLUE(.,name):
186
187#define _STATIC(name) \
188 .section ".text"; \
189 .align 2 ; \
190 .section ".opd","aw"; \
191name: \
192 .quad GLUE(.,name); \
193 .quad .TOC.@tocbase; \
194 .quad 0; \
195 .previous; \
196 .type GLUE(.,name),@function; \
197GLUE(.,name):
198
Stephen Rothwellc40b91b2007-07-25 09:27:35 +1000199#define _INIT_STATIC(name) \
200 .section ".text.init.refok"; \
201 .align 2 ; \
202 .section ".opd","aw"; \
203name: \
204 .quad GLUE(.,name); \
205 .quad .TOC.@tocbase; \
206 .quad 0; \
207 .previous; \
208 .type GLUE(.,name),@function; \
209GLUE(.,name):
210
Paul Mackerras40ef8cb2005-10-10 22:50:37 +1000211#else /* 32-bit */
212
Kumar Gala748a7682007-09-13 15:42:35 -0500213#define _ENTRY(n) \
214 .globl n; \
215n:
216
Paul Mackerras40ef8cb2005-10-10 22:50:37 +1000217#define _GLOBAL(n) \
218 .text; \
219 .stabs __stringify(n:F-1),N_FUN,0,0,n;\
220 .globl n; \
221n:
222
223#define _KPROBE(n) \
224 .section ".kprobes.text","a"; \
225 .globl n; \
226n:
227
228#endif
229
Kumar Gala5f7c6902005-09-09 15:02:25 -0500230/*
David Gibsone58c3492006-01-13 14:56:25 +1100231 * LOAD_REG_IMMEDIATE(rn, expr)
232 * Loads the value of the constant expression 'expr' into register 'rn'
233 * using immediate instructions only. Use this when it's important not
234 * to reference other data (i.e. on ppc64 when the TOC pointer is not
235 * valid).
Kumar Gala5f7c6902005-09-09 15:02:25 -0500236 *
David Gibsone58c3492006-01-13 14:56:25 +1100237 * LOAD_REG_ADDR(rn, name)
238 * Loads the address of label 'name' into register 'rn'. Use this when
239 * you don't particularly need immediate instructions only, but you need
240 * the whole address in one register (e.g. it's a structure address and
241 * you want to access various offsets within it). On ppc32 this is
242 * identical to LOAD_REG_IMMEDIATE.
243 *
244 * LOAD_REG_ADDRBASE(rn, name)
245 * ADDROFF(name)
246 * LOAD_REG_ADDRBASE loads part of the address of label 'name' into
247 * register 'rn'. ADDROFF(name) returns the remainder of the address as
248 * a constant expression. ADDROFF(name) is a signed expression < 16 bits
249 * in size, so is suitable for use directly as an offset in load and store
250 * instructions. Use this when loading/storing a single word or less as:
251 * LOAD_REG_ADDRBASE(rX, name)
252 * ld rY,ADDROFF(name)(rX)
Kumar Gala5f7c6902005-09-09 15:02:25 -0500253 */
254#ifdef __powerpc64__
David Gibsone58c3492006-01-13 14:56:25 +1100255#define LOAD_REG_IMMEDIATE(reg,expr) \
256 lis (reg),(expr)@highest; \
257 ori (reg),(reg),(expr)@higher; \
258 rldicr (reg),(reg),32,31; \
259 oris (reg),(reg),(expr)@h; \
260 ori (reg),(reg),(expr)@l;
Kumar Gala5f7c6902005-09-09 15:02:25 -0500261
David Gibsone58c3492006-01-13 14:56:25 +1100262#define LOAD_REG_ADDR(reg,name) \
263 ld (reg),name@got(r2)
Kumar Gala5f7c6902005-09-09 15:02:25 -0500264
David Gibsone58c3492006-01-13 14:56:25 +1100265#define LOAD_REG_ADDRBASE(reg,name) LOAD_REG_ADDR(reg,name)
266#define ADDROFF(name) 0
Paul Mackerrasb85a0462005-10-06 10:59:19 +1000267
Paul Mackerrasf78541d2005-10-28 22:53:37 +1000268/* offsets for stack frame layout */
269#define LRSAVE 16
Paul Mackerrasb85a0462005-10-06 10:59:19 +1000270
271#else /* 32-bit */
Stephen Rothwell70620182005-10-12 17:44:55 +1000272
David Gibsone58c3492006-01-13 14:56:25 +1100273#define LOAD_REG_IMMEDIATE(reg,expr) \
274 lis (reg),(expr)@ha; \
275 addi (reg),(reg),(expr)@l;
Paul Mackerrasb85a0462005-10-06 10:59:19 +1000276
David Gibsone58c3492006-01-13 14:56:25 +1100277#define LOAD_REG_ADDR(reg,name) LOAD_REG_IMMEDIATE(reg, name)
278
279#define LOAD_REG_ADDRBASE(reg, name) lis (reg),name@ha
280#define ADDROFF(name) name@l
Paul Mackerrasb85a0462005-10-06 10:59:19 +1000281
Paul Mackerrasf78541d2005-10-28 22:53:37 +1000282/* offsets for stack frame layout */
283#define LRSAVE 4
Paul Mackerrasb85a0462005-10-06 10:59:19 +1000284
Kumar Gala5f7c6902005-09-09 15:02:25 -0500285#endif
286
287/* various errata or part fixups */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700288#ifdef CONFIG_PPC601_SYNC_FIX
289#define SYNC \
290BEGIN_FTR_SECTION \
291 sync; \
292 isync; \
293END_FTR_SECTION_IFSET(CPU_FTR_601)
294#define SYNC_601 \
295BEGIN_FTR_SECTION \
296 sync; \
297END_FTR_SECTION_IFSET(CPU_FTR_601)
298#define ISYNC_601 \
299BEGIN_FTR_SECTION \
300 isync; \
301END_FTR_SECTION_IFSET(CPU_FTR_601)
302#else
303#define SYNC
304#define SYNC_601
305#define ISYNC_601
306#endif
307
Benjamin Herrenschmidt859deea2006-10-20 14:37:05 +1000308#ifdef CONFIG_PPC_CELL
309#define MFTB(dest) \
31090: mftb dest; \
311BEGIN_FTR_SECTION_NESTED(96); \
312 cmpwi dest,0; \
313 beq- 90b; \
314END_FTR_SECTION_NESTED(CPU_FTR_CELL_TB_BUG, CPU_FTR_CELL_TB_BUG, 96)
315#else
316#define MFTB(dest) mftb dest
317#endif
Kumar Gala5f7c6902005-09-09 15:02:25 -0500318
Linus Torvalds1da177e2005-04-16 15:20:36 -0700319#ifndef CONFIG_SMP
320#define TLBSYNC
321#else /* CONFIG_SMP */
322/* tlbsync is not implemented on 601 */
323#define TLBSYNC \
324BEGIN_FTR_SECTION \
325 tlbsync; \
326 sync; \
327END_FTR_SECTION_IFCLR(CPU_FTR_601)
328#endif
329
Kumar Gala5f7c6902005-09-09 15:02:25 -0500330
Linus Torvalds1da177e2005-04-16 15:20:36 -0700331/*
332 * This instruction is not implemented on the PPC 603 or 601; however, on
333 * the 403GCX and 405GP tlbia IS defined and tlbie is not.
334 * All of these instructions exist in the 8xx, they have magical powers,
335 * and they must be used.
336 */
337
338#if !defined(CONFIG_4xx) && !defined(CONFIG_8xx)
339#define tlbia \
340 li r4,1024; \
341 mtctr r4; \
342 lis r4,KERNELBASE@h; \
3430: tlbie r4; \
344 addi r4,r4,0x1000; \
345 bdnz 0b
346#endif
347
Kumar Gala5f7c6902005-09-09 15:02:25 -0500348
Kumar Gala5f7c6902005-09-09 15:02:25 -0500349#ifdef CONFIG_IBM440EP_ERR42
350#define PPC440EP_ERR42 isync
351#else
352#define PPC440EP_ERR42
353#endif
354
355
356#if defined(CONFIG_BOOKE)
Paul Mackerras63162222005-10-27 22:44:39 +1000357#define toreal(rd)
358#define fromreal(rd)
359
Roland McGrath2ca76332008-05-11 10:40:47 +1000360/*
361 * We use addis to ensure compatibility with the "classic" ppc versions of
362 * these macros, which use rs = 0 to get the tophys offset in rd, rather than
363 * converting the address in r0, and so this version has to do that too
364 * (i.e. set register rd to 0 when rs == 0).
365 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700366#define tophys(rd,rs) \
367 addis rd,rs,0
368
369#define tovirt(rd,rs) \
370 addis rd,rs,0
371
Kumar Gala5f7c6902005-09-09 15:02:25 -0500372#elif defined(CONFIG_PPC64)
Paul Mackerras63162222005-10-27 22:44:39 +1000373#define toreal(rd) /* we can access c000... in real mode */
374#define fromreal(rd)
375
Kumar Gala5f7c6902005-09-09 15:02:25 -0500376#define tophys(rd,rs) \
Paul Mackerras63162222005-10-27 22:44:39 +1000377 clrldi rd,rs,2
Kumar Gala5f7c6902005-09-09 15:02:25 -0500378
379#define tovirt(rd,rs) \
Paul Mackerras63162222005-10-27 22:44:39 +1000380 rotldi rd,rs,16; \
381 ori rd,rd,((KERNELBASE>>48)&0xFFFF);\
382 rotldi rd,rd,48
Kumar Gala5f7c6902005-09-09 15:02:25 -0500383#else
Linus Torvalds1da177e2005-04-16 15:20:36 -0700384/*
385 * On APUS (Amiga PowerPC cpu upgrade board), we don't know the
386 * physical base address of RAM at compile time.
387 */
Paul Mackerras63162222005-10-27 22:44:39 +1000388#define toreal(rd) tophys(rd,rd)
389#define fromreal(rd) tovirt(rd,rd)
390
Linus Torvalds1da177e2005-04-16 15:20:36 -0700391#define tophys(rd,rs) \
3920: addis rd,rs,-KERNELBASE@h; \
393 .section ".vtop_fixup","aw"; \
394 .align 1; \
395 .long 0b; \
396 .previous
397
398#define tovirt(rd,rs) \
3990: addis rd,rs,KERNELBASE@h; \
400 .section ".ptov_fixup","aw"; \
401 .align 1; \
402 .long 0b; \
403 .previous
Kumar Gala5f7c6902005-09-09 15:02:25 -0500404#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700405
Paul Mackerras40ef8cb2005-10-10 22:50:37 +1000406#ifdef CONFIG_PPC64
407#define RFI rfid
408#define MTMSRD(r) mtmsrd r
Linus Torvalds1da177e2005-04-16 15:20:36 -0700409
410#else
411#define FIX_SRR1(ra, rb)
412#ifndef CONFIG_40x
413#define RFI rfi
414#else
415#define RFI rfi; b . /* Prevent prefetch past rfi */
416#endif
417#define MTMSRD(r) mtmsr r
418#define CLR_TOP32(r)
Matt Porterc9cf73a2005-07-31 22:34:52 -0700419#endif
420
Arnd Bergmann88ced032005-12-16 22:43:46 +0100421#endif /* __KERNEL__ */
422
Linus Torvalds1da177e2005-04-16 15:20:36 -0700423/* The boring bits... */
424
425/* Condition Register Bit Fields */
426
427#define cr0 0
428#define cr1 1
429#define cr2 2
430#define cr3 3
431#define cr4 4
432#define cr5 5
433#define cr6 6
434#define cr7 7
435
436
437/* General Purpose Registers (GPRs) */
438
439#define r0 0
440#define r1 1
441#define r2 2
442#define r3 3
443#define r4 4
444#define r5 5
445#define r6 6
446#define r7 7
447#define r8 8
448#define r9 9
449#define r10 10
450#define r11 11
451#define r12 12
452#define r13 13
453#define r14 14
454#define r15 15
455#define r16 16
456#define r17 17
457#define r18 18
458#define r19 19
459#define r20 20
460#define r21 21
461#define r22 22
462#define r23 23
463#define r24 24
464#define r25 25
465#define r26 26
466#define r27 27
467#define r28 28
468#define r29 29
469#define r30 30
470#define r31 31
471
472
473/* Floating Point Registers (FPRs) */
474
475#define fr0 0
476#define fr1 1
477#define fr2 2
478#define fr3 3
479#define fr4 4
480#define fr5 5
481#define fr6 6
482#define fr7 7
483#define fr8 8
484#define fr9 9
485#define fr10 10
486#define fr11 11
487#define fr12 12
488#define fr13 13
489#define fr14 14
490#define fr15 15
491#define fr16 16
492#define fr17 17
493#define fr18 18
494#define fr19 19
495#define fr20 20
496#define fr21 21
497#define fr22 22
498#define fr23 23
499#define fr24 24
500#define fr25 25
501#define fr26 26
502#define fr27 27
503#define fr28 28
504#define fr29 29
505#define fr30 30
506#define fr31 31
507
Kumar Gala5f7c6902005-09-09 15:02:25 -0500508/* AltiVec Registers (VPRs) */
509
Linus Torvalds1da177e2005-04-16 15:20:36 -0700510#define vr0 0
511#define vr1 1
512#define vr2 2
513#define vr3 3
514#define vr4 4
515#define vr5 5
516#define vr6 6
517#define vr7 7
518#define vr8 8
519#define vr9 9
520#define vr10 10
521#define vr11 11
522#define vr12 12
523#define vr13 13
524#define vr14 14
525#define vr15 15
526#define vr16 16
527#define vr17 17
528#define vr18 18
529#define vr19 19
530#define vr20 20
531#define vr21 21
532#define vr22 22
533#define vr23 23
534#define vr24 24
535#define vr25 25
536#define vr26 26
537#define vr27 27
538#define vr28 28
539#define vr29 29
540#define vr30 30
541#define vr31 31
542
Kumar Gala5f7c6902005-09-09 15:02:25 -0500543/* SPE Registers (EVPRs) */
544
Linus Torvalds1da177e2005-04-16 15:20:36 -0700545#define evr0 0
546#define evr1 1
547#define evr2 2
548#define evr3 3
549#define evr4 4
550#define evr5 5
551#define evr6 6
552#define evr7 7
553#define evr8 8
554#define evr9 9
555#define evr10 10
556#define evr11 11
557#define evr12 12
558#define evr13 13
559#define evr14 14
560#define evr15 15
561#define evr16 16
562#define evr17 17
563#define evr18 18
564#define evr19 19
565#define evr20 20
566#define evr21 21
567#define evr22 22
568#define evr23 23
569#define evr24 24
570#define evr25 25
571#define evr26 26
572#define evr27 27
573#define evr28 28
574#define evr29 29
575#define evr30 30
576#define evr31 31
577
578/* some stab codes */
579#define N_FUN 36
580#define N_RSYM 64
581#define N_SLINE 68
582#define N_SO 100
Kumar Gala5f7c6902005-09-09 15:02:25 -0500583
Kumar Gala5f7c6902005-09-09 15:02:25 -0500584#endif /* __ASSEMBLY__ */
585
586#endif /* _ASM_POWERPC_PPC_ASM_H */