2 * Copyright (C) 1995-1999 Gary Thomas, Paul Mackerras, Cort Dougan.
4 #ifndef _ASM_POWERPC_PPC_ASM_H
5 #define _ASM_POWERPC_PPC_ASM_H
7 #include <linux/stringify.h>
8 #include <asm/asm-compat.h>
9 #include <asm/processor.h>
10 #include <asm/ppc-opcode.h>
11 #include <asm/firmware.h>
12 #include <asm/feature-fixups.h>
16 #define SZL (BITS_PER_LONG/8)
19 * Stuff for accurate CPU time accounting.
20 * These macros handle transitions between user and system state
21 * in exception entry and exit and accumulate time to the
22 * user_time and system_time fields in the paca.
25 #ifndef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE
26 #define ACCOUNT_CPU_USER_ENTRY(ptr, ra, rb)
27 #define ACCOUNT_CPU_USER_EXIT(ptr, ra, rb)
28 #define ACCOUNT_STOLEN_TIME
30 #define ACCOUNT_CPU_USER_ENTRY(ptr, ra, rb) \
31 MFTB(ra); /* get timebase */ \
32 PPC_LL rb, ACCOUNT_STARTTIME_USER(ptr); \
33 PPC_STL ra, ACCOUNT_STARTTIME(ptr); \
34 subf rb,rb,ra; /* subtract start value */ \
35 PPC_LL ra, ACCOUNT_USER_TIME(ptr); \
36 add ra,ra,rb; /* add on to user time */ \
37 PPC_STL ra, ACCOUNT_USER_TIME(ptr); \
39 #define ACCOUNT_CPU_USER_EXIT(ptr, ra, rb) \
40 MFTB(ra); /* get timebase */ \
41 PPC_LL rb, ACCOUNT_STARTTIME(ptr); \
42 PPC_STL ra, ACCOUNT_STARTTIME_USER(ptr); \
43 subf rb,rb,ra; /* subtract start value */ \
44 PPC_LL ra, ACCOUNT_SYSTEM_TIME(ptr); \
45 add ra,ra,rb; /* add on to system time */ \
46 PPC_STL ra, ACCOUNT_SYSTEM_TIME(ptr)
48 #ifdef CONFIG_PPC_SPLPAR
49 #define ACCOUNT_STOLEN_TIME \
50 BEGIN_FW_FTR_SECTION; \
52 /* from user - see if there are any DTL entries to process */ \
53 ld r10,PACALPPACAPTR(r13); /* get ptr to VPA */ \
54 ld r11,PACA_DTL_RIDX(r13); /* get log read index */ \
55 addi r10,r10,LPPACA_DTLIDX; \
56 LDX_BE r10,0,r10; /* get log write index */ \
59 bl accumulate_stolen_time; \
61 andi. r10,r12,MSR_PR; /* Restore cr0 (coming from user) */ \
63 END_FW_FTR_SECTION_IFSET(FW_FEATURE_SPLPAR)
65 #else /* CONFIG_PPC_SPLPAR */
66 #define ACCOUNT_STOLEN_TIME
68 #endif /* CONFIG_PPC_SPLPAR */
70 #endif /* CONFIG_VIRT_CPU_ACCOUNTING_NATIVE */
73 * Macros for storing registers into and loading registers from
77 #define SAVE_GPR(n, base) std n,GPR0+8*(n)(base)
78 #define REST_GPR(n, base) ld n,GPR0+8*(n)(base)
79 #define SAVE_NVGPRS(base) SAVE_8GPRS(14, base); SAVE_10GPRS(22, base)
80 #define REST_NVGPRS(base) REST_8GPRS(14, base); REST_10GPRS(22, base)
82 #define SAVE_GPR(n, base) stw n,GPR0+4*(n)(base)
83 #define REST_GPR(n, base) lwz n,GPR0+4*(n)(base)
84 #define SAVE_NVGPRS(base) stmw 13, GPR0+4*13(base)
85 #define REST_NVGPRS(base) lmw 13, GPR0+4*13(base)
88 #define SAVE_2GPRS(n, base) SAVE_GPR(n, base); SAVE_GPR(n+1, base)
89 #define SAVE_4GPRS(n, base) SAVE_2GPRS(n, base); SAVE_2GPRS(n+2, base)
90 #define SAVE_8GPRS(n, base) SAVE_4GPRS(n, base); SAVE_4GPRS(n+4, base)
91 #define SAVE_10GPRS(n, base) SAVE_8GPRS(n, base); SAVE_2GPRS(n+8, base)
92 #define REST_2GPRS(n, base) REST_GPR(n, base); REST_GPR(n+1, base)
93 #define REST_4GPRS(n, base) REST_2GPRS(n, base); REST_2GPRS(n+2, base)
94 #define REST_8GPRS(n, base) REST_4GPRS(n, base); REST_4GPRS(n+4, base)
95 #define REST_10GPRS(n, base) REST_8GPRS(n, base); REST_2GPRS(n+8, base)
97 #define SAVE_FPR(n, base) stfd n,8*TS_FPRWIDTH*(n)(base)
98 #define SAVE_2FPRS(n, base) SAVE_FPR(n, base); SAVE_FPR(n+1, base)
99 #define SAVE_4FPRS(n, base) SAVE_2FPRS(n, base); SAVE_2FPRS(n+2, base)
100 #define SAVE_8FPRS(n, base) SAVE_4FPRS(n, base); SAVE_4FPRS(n+4, base)
101 #define SAVE_16FPRS(n, base) SAVE_8FPRS(n, base); SAVE_8FPRS(n+8, base)
102 #define SAVE_32FPRS(n, base) SAVE_16FPRS(n, base); SAVE_16FPRS(n+16, base)
103 #define REST_FPR(n, base) lfd n,8*TS_FPRWIDTH*(n)(base)
104 #define REST_2FPRS(n, base) REST_FPR(n, base); REST_FPR(n+1, base)
105 #define REST_4FPRS(n, base) REST_2FPRS(n, base); REST_2FPRS(n+2, base)
106 #define REST_8FPRS(n, base) REST_4FPRS(n, base); REST_4FPRS(n+4, base)
107 #define REST_16FPRS(n, base) REST_8FPRS(n, base); REST_8FPRS(n+8, base)
108 #define REST_32FPRS(n, base) REST_16FPRS(n, base); REST_16FPRS(n+16, base)
110 #define SAVE_VR(n,b,base) li b,16*(n); stvx n,base,b
111 #define SAVE_2VRS(n,b,base) SAVE_VR(n,b,base); SAVE_VR(n+1,b,base)
112 #define SAVE_4VRS(n,b,base) SAVE_2VRS(n,b,base); SAVE_2VRS(n+2,b,base)
113 #define SAVE_8VRS(n,b,base) SAVE_4VRS(n,b,base); SAVE_4VRS(n+4,b,base)
114 #define SAVE_16VRS(n,b,base) SAVE_8VRS(n,b,base); SAVE_8VRS(n+8,b,base)
115 #define SAVE_32VRS(n,b,base) SAVE_16VRS(n,b,base); SAVE_16VRS(n+16,b,base)
116 #define REST_VR(n,b,base) li b,16*(n); lvx n,base,b
117 #define REST_2VRS(n,b,base) REST_VR(n,b,base); REST_VR(n+1,b,base)
118 #define REST_4VRS(n,b,base) REST_2VRS(n,b,base); REST_2VRS(n+2,b,base)
119 #define REST_8VRS(n,b,base) REST_4VRS(n,b,base); REST_4VRS(n+4,b,base)
120 #define REST_16VRS(n,b,base) REST_8VRS(n,b,base); REST_8VRS(n+8,b,base)
121 #define REST_32VRS(n,b,base) REST_16VRS(n,b,base); REST_16VRS(n+16,b,base)
123 #ifdef __BIG_ENDIAN__
124 #define STXVD2X_ROT(n,b,base) STXVD2X(n,b,base)
125 #define LXVD2X_ROT(n,b,base) LXVD2X(n,b,base)
127 #define STXVD2X_ROT(n,b,base) XXSWAPD(n,n); \
131 #define LXVD2X_ROT(n,b,base) LXVD2X(n,b,base); \
134 /* Save the lower 32 VSRs in the thread VSR region */
135 #define SAVE_VSR(n,b,base) li b,16*(n); STXVD2X_ROT(n,R##base,R##b)
136 #define SAVE_2VSRS(n,b,base) SAVE_VSR(n,b,base); SAVE_VSR(n+1,b,base)
137 #define SAVE_4VSRS(n,b,base) SAVE_2VSRS(n,b,base); SAVE_2VSRS(n+2,b,base)
138 #define SAVE_8VSRS(n,b,base) SAVE_4VSRS(n,b,base); SAVE_4VSRS(n+4,b,base)
139 #define SAVE_16VSRS(n,b,base) SAVE_8VSRS(n,b,base); SAVE_8VSRS(n+8,b,base)
140 #define SAVE_32VSRS(n,b,base) SAVE_16VSRS(n,b,base); SAVE_16VSRS(n+16,b,base)
141 #define REST_VSR(n,b,base) li b,16*(n); LXVD2X_ROT(n,R##base,R##b)
142 #define REST_2VSRS(n,b,base) REST_VSR(n,b,base); REST_VSR(n+1,b,base)
143 #define REST_4VSRS(n,b,base) REST_2VSRS(n,b,base); REST_2VSRS(n+2,b,base)
144 #define REST_8VSRS(n,b,base) REST_4VSRS(n,b,base); REST_4VSRS(n+4,b,base)
145 #define REST_16VSRS(n,b,base) REST_8VSRS(n,b,base); REST_8VSRS(n+8,b,base)
146 #define REST_32VSRS(n,b,base) REST_16VSRS(n,b,base); REST_16VSRS(n+16,b,base)
149 * b = base register for addressing, o = base offset from register of 1st EVR
150 * n = first EVR, s = scratch
152 #define SAVE_EVR(n,s,b,o) evmergehi s,s,n; stw s,o+4*(n)(b)
153 #define SAVE_2EVRS(n,s,b,o) SAVE_EVR(n,s,b,o); SAVE_EVR(n+1,s,b,o)
154 #define SAVE_4EVRS(n,s,b,o) SAVE_2EVRS(n,s,b,o); SAVE_2EVRS(n+2,s,b,o)
155 #define SAVE_8EVRS(n,s,b,o) SAVE_4EVRS(n,s,b,o); SAVE_4EVRS(n+4,s,b,o)
156 #define SAVE_16EVRS(n,s,b,o) SAVE_8EVRS(n,s,b,o); SAVE_8EVRS(n+8,s,b,o)
157 #define SAVE_32EVRS(n,s,b,o) SAVE_16EVRS(n,s,b,o); SAVE_16EVRS(n+16,s,b,o)
158 #define REST_EVR(n,s,b,o) lwz s,o+4*(n)(b); evmergelo n,s,n
159 #define REST_2EVRS(n,s,b,o) REST_EVR(n,s,b,o); REST_EVR(n+1,s,b,o)
160 #define REST_4EVRS(n,s,b,o) REST_2EVRS(n,s,b,o); REST_2EVRS(n+2,s,b,o)
161 #define REST_8EVRS(n,s,b,o) REST_4EVRS(n,s,b,o); REST_4EVRS(n+4,s,b,o)
162 #define REST_16EVRS(n,s,b,o) REST_8EVRS(n,s,b,o); REST_8EVRS(n+8,s,b,o)
163 #define REST_32EVRS(n,s,b,o) REST_16EVRS(n,s,b,o); REST_16EVRS(n+16,s,b,o)
165 /* Macros to adjust thread priority for hardware multithreading */
166 #define HMT_VERY_LOW or 31,31,31 # very low priority
167 #define HMT_LOW or 1,1,1
168 #define HMT_MEDIUM_LOW or 6,6,6 # medium low priority
169 #define HMT_MEDIUM or 2,2,2
170 #define HMT_MEDIUM_HIGH or 5,5,5 # medium high priority
171 #define HMT_HIGH or 3,3,3
172 #define HMT_EXTRA_HIGH or 7,7,7 # power7 only
179 #define __VCPU_GPR(n) (VCPU_GPRS + (n * ULONG_SIZE))
180 #define VCPU_GPR(n) __VCPU_GPR(__REG_##n)
185 #define STACKFRAMESIZE 256
186 #define __STK_REG(i) (112 + ((i)-14)*8)
187 #define STK_REG(i) __STK_REG(__REG_##i)
189 #ifdef PPC64_ELF_ABI_v2
191 #define __STK_PARAM(i) (32 + ((i)-3)*8)
194 #define __STK_PARAM(i) (48 + ((i)-3)*8)
196 #define STK_PARAM(i) __STK_PARAM(__REG_##i)
198 #ifdef PPC64_ELF_ABI_v2
200 #define _GLOBAL(name) \
202 .type name,@function; \
206 #define _GLOBAL_TOC(name) \
208 .type name,@function; \
211 0: addis r2,r12,(.TOC.-0b)@ha; \
212 addi r2,r2,(.TOC.-0b)@l; \
213 .localentry name,.-name
219 #define XGLUE(a,b) a##b
220 #define GLUE(a,b) XGLUE(a,b)
222 #define _GLOBAL(name) \
225 .globl GLUE(.,name); \
226 .pushsection ".opd","aw"; \
228 .quad GLUE(.,name); \
229 .quad .TOC.@tocbase; \
232 .type GLUE(.,name),@function; \
235 #define _GLOBAL_TOC(name) _GLOBAL(name)
237 #define DOTSYM(a) GLUE(.,a)
248 .stabs __stringify(n:F-1),N_FUN,0,0,n;\
252 #define _GLOBAL_TOC(name) _GLOBAL(name)
257 * __kprobes (the C annotation) puts the symbol into the .kprobes.text
258 * section, which gets emitted at the end of regular text.
260 * _ASM_NOKPROBE_SYMBOL and NOKPROBE_SYMBOL just adds the symbol to
261 * a blacklist. The former is for core kprobe functions/data, the
262 * latter is for those that incdentially must be excluded from probing
263 * and allows them to be linked at more optimal location within text.
265 #ifdef CONFIG_KPROBES
266 #define _ASM_NOKPROBE_SYMBOL(entry) \
267 .pushsection "_kprobe_blacklist","aw"; \
271 #define _ASM_NOKPROBE_SYMBOL(entry)
274 #define FUNC_START(name) _GLOBAL(name)
275 #define FUNC_END(name)
278 * LOAD_REG_IMMEDIATE(rn, expr)
279 * Loads the value of the constant expression 'expr' into register 'rn'
280 * using immediate instructions only. Use this when it's important not
281 * to reference other data (i.e. on ppc64 when the TOC pointer is not
282 * valid) and when 'expr' is a constant or absolute address.
284 * LOAD_REG_ADDR(rn, name)
285 * Loads the address of label 'name' into register 'rn'. Use this when
286 * you don't particularly need immediate instructions only, but you need
287 * the whole address in one register (e.g. it's a structure address and
288 * you want to access various offsets within it). On ppc32 this is
289 * identical to LOAD_REG_IMMEDIATE.
291 * LOAD_REG_ADDR_PIC(rn, name)
292 * Loads the address of label 'name' into register 'run'. Use this when
293 * the kernel doesn't run at the linked or relocated address. Please
294 * note that this macro will clobber the lr register.
296 * LOAD_REG_ADDRBASE(rn, name)
298 * LOAD_REG_ADDRBASE loads part of the address of label 'name' into
299 * register 'rn'. ADDROFF(name) returns the remainder of the address as
300 * a constant expression. ADDROFF(name) is a signed expression < 16 bits
301 * in size, so is suitable for use directly as an offset in load and store
302 * instructions. Use this when loading/storing a single word or less as:
303 * LOAD_REG_ADDRBASE(rX, name)
304 * ld rY,ADDROFF(name)(rX)
307 /* Be careful, this will clobber the lr register. */
308 #define LOAD_REG_ADDR_PIC(reg, name) \
311 addis reg,reg,(name - 0b)@ha; \
312 addi reg,reg,(name - 0b)@l;
314 #if defined(__powerpc64__) && defined(HAVE_AS_ATHIGH)
315 #define __AS_ATHIGH high
317 #define __AS_ATHIGH h
320 .macro __LOAD_REG_IMMEDIATE_32 r
, x
321 .if (\x
) >= 0x8000 || (\x
) < -0x8000
322 lis
\r, (\x
)@__AS_ATHIGH
323 .if (\x
) & 0xffff != 0
331 .macro __LOAD_REG_IMMEDIATE r
, x
332 .if (\x
) >= 0x80000000 || (\x
) < -0x80000000
333 __LOAD_REG_IMMEDIATE_32
\r, (\x
) >> 32
335 .if (\x
) & 0xffff0000 != 0
336 oris
\r, \r, (\x
)@__AS_ATHIGH
338 .if (\x
) & 0xffff != 0
342 __LOAD_REG_IMMEDIATE_32
\r, \x
348 #define LOAD_REG_IMMEDIATE(reg, expr) __LOAD_REG_IMMEDIATE reg, expr
350 #define LOAD_REG_IMMEDIATE_SYM(reg, tmp, expr) \
351 lis tmp, (expr)@highest; \
352 lis reg, (expr)@__AS_ATHIGH; \
353 ori tmp, tmp, (expr)@higher; \
354 ori reg, reg, (expr)@l; \
355 rldimi reg, tmp, 32, 0
357 #define LOAD_REG_ADDR(reg,name) \
360 #define LOAD_REG_ADDRBASE(reg,name) LOAD_REG_ADDR(reg,name)
361 #define ADDROFF(name) 0
363 /* offsets for stack frame layout */
368 #define LOAD_REG_IMMEDIATE(reg, expr) __LOAD_REG_IMMEDIATE_32 reg, expr
370 #define LOAD_REG_IMMEDIATE_SYM(reg,expr) \
372 addi reg,reg,(expr)@l;
374 #define LOAD_REG_ADDR(reg,name) LOAD_REG_IMMEDIATE_SYM(reg, name)
376 #define LOAD_REG_ADDRBASE(reg, name) lis reg,name@ha
377 #define ADDROFF(name) name@l
379 /* offsets for stack frame layout */
384 /* various errata or part fixups */
385 #ifdef CONFIG_PPC601_SYNC_FIX
386 #define SYNC sync; isync
387 #define SYNC_601 sync
388 #define ISYNC_601 isync
395 #if defined(CONFIG_PPC_CELL) || defined(CONFIG_PPC_FSL_BOOK3E)
397 90: mfspr dest, SPRN_TBRL; \
398 BEGIN_FTR_SECTION_NESTED(96); \
401 END_FTR_SECTION_NESTED(CPU_FTR_CELL_TB_BUG, CPU_FTR_CELL_TB_BUG, 96)
403 #define MFTB(dest) MFTBL(dest)
406 #ifdef CONFIG_PPC_8xx
407 #define MFTBL(dest) mftb dest
408 #define MFTBU(dest) mftbu dest
410 #define MFTBL(dest) mfspr dest, SPRN_TBRL
411 #define MFTBU(dest) mfspr dest, SPRN_TBRU
414 /* tlbsync is not implemented on 601 */
415 #if !defined(CONFIG_SMP) || defined(CONFIG_PPC_BOOK3S_601)
418 #define TLBSYNC tlbsync; sync
422 #define MTOCRF(FXM, RS) \
423 BEGIN_FTR_SECTION_NESTED(848); \
425 FTR_SECTION_ELSE_NESTED(848); \
427 ALT_FTR_SECTION_END_NESTED_IFCLR(CPU_FTR_NOEXECUTE, 848)
431 * This instruction is not implemented on the PPC 603 or 601; however, on
432 * the 403GCX and 405GP tlbia IS defined and tlbie is not.
433 * All of these instructions exist in the 8xx, they have magical powers,
434 * and they must be used.
437 #if !defined(CONFIG_4xx) && !defined(CONFIG_PPC_8xx)
441 lis r4,KERNELBASE@h; \
451 #ifdef CONFIG_IBM440EP_ERR42
452 #define PPC440EP_ERR42 isync
454 #define PPC440EP_ERR42
457 /* The following stops all load and store data streams associated with stream
458 * ID (ie. streams created explicitly). The embedded and server mnemonics for
459 * dcbt are different so this must only be used for server.
461 #define DCBT_BOOK3S_STOP_ALL_STREAM_IDS(scratch) \
462 lis scratch,0x60000000@h; \
463 dcbt 0,scratch,0b01010
466 * toreal/fromreal/tophys/tovirt macros. 32-bit BookE makes them
467 * keep the address intact to be compatible with code shared with
470 * On the other hand, I find it useful to have them behave as expected
471 * by their name (ie always do the addition) on 64-bit BookE
473 #if defined(CONFIG_BOOKE) && !defined(CONFIG_PPC64)
478 * We use addis to ensure compatibility with the "classic" ppc versions of
479 * these macros, which use rs = 0 to get the tophys offset in rd, rather than
480 * converting the address in r0, and so this version has to do that too
481 * (i.e. set register rd to 0 when rs == 0).
483 #define tophys(rd,rs) \
486 #define tovirt(rd,rs) \
489 #elif defined(CONFIG_PPC64)
490 #define toreal(rd) /* we can access c000... in real mode */
493 #define tophys(rd,rs) \
496 #define tovirt(rd,rs) \
498 ori rd,rd,((KERNELBASE>>48)&0xFFFF);\
501 #define toreal(rd) tophys(rd,rd)
502 #define fromreal(rd) tovirt(rd,rd)
504 #define tophys(rd, rs) addis rd, rs, -PAGE_OFFSET@h
505 #define tovirt(rd, rs) addis rd, rs, PAGE_OFFSET@h
508 #ifdef CONFIG_PPC_BOOK3S_64
510 #define MTMSRD(r) mtmsrd r
511 #define MTMSR_EERI(reg) mtmsrd reg,1
516 #define RFI rfi; b . /* Prevent prefetch past rfi */
518 #define MTMSRD(r) mtmsr r
519 #define MTMSR_EERI(reg) mtmsr reg
522 #endif /* __KERNEL__ */
524 /* The boring bits... */
526 /* Condition Register Bit Fields */
539 * General Purpose Registers (GPRs)
541 * The lower case r0-r31 should be used in preference to the upper
542 * case R0-R31 as they provide more error checking in the assembler.
543 * Use R0-31 only when really nessesary.
580 /* Floating Point Registers (FPRs) */
615 /* AltiVec Registers (VPRs) */
650 /* VSX Registers (VSRs) */
717 /* SPE Registers (EVPRs) */
752 /* some stab codes */
759 * Create an endian fixup trampoline
761 * This starts with a "tdi 0,0,0x48" instruction which is
762 * essentially a "trap never", and thus akin to a nop.
764 * The opcode for this instruction read with the wrong endian
765 * however results in a b . + 8
767 * So essentially we use that trick to execute the following
768 * trampoline in "reverse endian" if we are running with the
769 * MSR_LE bit set the "wrong" way for whatever endianness the
770 * kernel is built for.
773 #ifdef CONFIG_PPC_BOOK3E
777 * This version may be used in in HV or non-HV context.
778 * MSR[EE] must be disabled.
780 #define FIXUP_ENDIAN \
781 tdi 0,0,0x48; /* Reverse endian of b . + 8 */ \
782 b 191f; /* Skip trampoline if endian is good */ \
783 .long 0xa600607d; /* mfmsr r11 */ \
784 .long 0x01006b69; /* xori r11,r11,1 */ \
785 .long 0x00004039; /* li r10,0 */ \
786 .long 0x6401417d; /* mtmsrd r10,1 */ \
787 .long 0x05009f42; /* bcl 20,31,$+4 */ \
788 .long 0xa602487d; /* mflr r10 */ \
789 .long 0x14004a39; /* addi r10,r10,20 */ \
790 .long 0xa6035a7d; /* mtsrr0 r10 */ \
791 .long 0xa6037b7d; /* mtsrr1 r11 */ \
792 .long 0x2400004c; /* rfid */ \
796 * This version that may only be used with MSR[HV]=1
797 * - Does not clear MSR[RI], so more robust.
798 * - Slightly smaller and faster.
800 #define FIXUP_ENDIAN_HV \
801 tdi 0,0,0x48; /* Reverse endian of b . + 8 */ \
802 b 191f; /* Skip trampoline if endian is good */ \
803 .long 0xa600607d; /* mfmsr r11 */ \
804 .long 0x01006b69; /* xori r11,r11,1 */ \
805 .long 0x05009f42; /* bcl 20,31,$+4 */ \
806 .long 0xa602487d; /* mflr r10 */ \
807 .long 0x14004a39; /* addi r10,r10,20 */ \
808 .long 0xa64b5a7d; /* mthsrr0 r10 */ \
809 .long 0xa64b7b7d; /* mthsrr1 r11 */ \
810 .long 0x2402004c; /* hrfid */ \
813 #endif /* !CONFIG_PPC_BOOK3E */
815 #endif /* __ASSEMBLY__ */
818 * Helper macro for exception table entries
820 #define EX_TABLE(_fault, _target) \
821 stringify_in_c(.section __ex_table,"a";)\
822 stringify_in_c(.balign 4;) \
823 stringify_in_c(.long (_fault) - . ;) \
824 stringify_in_c(.long (_target) - . ;) \
825 stringify_in_c(.previous)
827 #ifdef CONFIG_PPC_FSL_BOOK3E
828 #define BTB_FLUSH(reg) \
829 lis reg,BUCSR_INIT@h; \
830 ori reg,reg,BUCSR_INIT@l; \
831 mtspr SPRN_BUCSR,reg; \
834 #define BTB_FLUSH(reg)
835 #endif /* CONFIG_PPC_FSL_BOOK3E */
837 #endif /* _ASM_POWERPC_PPC_ASM_H */