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