| .. | .. |
|---|
| 20 | 20 | #include <asm/sgidefs.h> |
|---|
| 21 | 21 | #include <asm/asm-eva.h> |
|---|
| 22 | 22 | |
|---|
| 23 | | -#ifndef CAT |
|---|
| 24 | | -#ifdef __STDC__ |
|---|
| 25 | | -#define __CAT(str1, str2) str1##str2 |
|---|
| 26 | | -#else |
|---|
| 27 | | -#define __CAT(str1, str2) str1/**/str2 |
|---|
| 28 | | -#endif |
|---|
| 29 | | -#define CAT(str1, str2) __CAT(str1, str2) |
|---|
| 30 | | -#endif |
|---|
| 31 | | - |
|---|
| 23 | +#ifndef __VDSO__ |
|---|
| 32 | 24 | /* |
|---|
| 33 | | - * PIC specific declarations |
|---|
| 34 | | - * Not used for the kernel but here seems to be the right place. |
|---|
| 25 | + * Emit CFI data in .debug_frame sections, not .eh_frame sections. |
|---|
| 26 | + * We don't do DWARF unwinding at runtime, so only the offline DWARF |
|---|
| 27 | + * information is useful to anyone. Note we should change this if we |
|---|
| 28 | + * ever decide to enable DWARF unwinding at runtime. |
|---|
| 35 | 29 | */ |
|---|
| 36 | | -#ifdef __PIC__ |
|---|
| 37 | | -#define CPRESTORE(register) \ |
|---|
| 38 | | - .cprestore register |
|---|
| 39 | | -#define CPADD(register) \ |
|---|
| 40 | | - .cpadd register |
|---|
| 41 | | -#define CPLOAD(register) \ |
|---|
| 42 | | - .cpload register |
|---|
| 30 | +#define CFI_SECTIONS .cfi_sections .debug_frame |
|---|
| 43 | 31 | #else |
|---|
| 44 | | -#define CPRESTORE(register) |
|---|
| 45 | | -#define CPADD(register) |
|---|
| 46 | | -#define CPLOAD(register) |
|---|
| 32 | + /* |
|---|
| 33 | + * For the vDSO, emit both runtime unwind information and debug |
|---|
| 34 | + * symbols for the .dbg file. |
|---|
| 35 | + */ |
|---|
| 36 | +#define CFI_SECTIONS |
|---|
| 47 | 37 | #endif |
|---|
| 48 | 38 | |
|---|
| 49 | 39 | /* |
|---|
| 50 | 40 | * LEAF - declare leaf routine |
|---|
| 51 | 41 | */ |
|---|
| 52 | 42 | #define LEAF(symbol) \ |
|---|
| 43 | + CFI_SECTIONS; \ |
|---|
| 53 | 44 | .globl symbol; \ |
|---|
| 54 | 45 | .align 2; \ |
|---|
| 55 | 46 | .type symbol, @function; \ |
|---|
| .. | .. |
|---|
| 62 | 53 | * NESTED - declare nested routine entry point |
|---|
| 63 | 54 | */ |
|---|
| 64 | 55 | #define NESTED(symbol, framesize, rpc) \ |
|---|
| 56 | + CFI_SECTIONS; \ |
|---|
| 65 | 57 | .globl symbol; \ |
|---|
| 66 | 58 | .align 2; \ |
|---|
| 67 | 59 | .type symbol, @function; \ |
|---|
| .. | .. |
|---|
| 100 | 92 | .globl symbol; \ |
|---|
| 101 | 93 | symbol = value |
|---|
| 102 | 94 | |
|---|
| 103 | | -#define PANIC(msg) \ |
|---|
| 95 | +#define TEXT(msg) \ |
|---|
| 96 | + .pushsection .data; \ |
|---|
| 97 | +8: .asciiz msg; \ |
|---|
| 98 | + .popsection; |
|---|
| 99 | + |
|---|
| 100 | +#define ASM_PANIC(msg) \ |
|---|
| 104 | 101 | .set push; \ |
|---|
| 105 | 102 | .set reorder; \ |
|---|
| 106 | | - PTR_LA a0, 8f; \ |
|---|
| 103 | + PTR_LA a0, 8f; \ |
|---|
| 107 | 104 | jal panic; \ |
|---|
| 108 | 105 | 9: b 9b; \ |
|---|
| 109 | 106 | .set pop; \ |
|---|
| .. | .. |
|---|
| 113 | 110 | * Print formatted string |
|---|
| 114 | 111 | */ |
|---|
| 115 | 112 | #ifdef CONFIG_PRINTK |
|---|
| 116 | | -#define PRINT(string) \ |
|---|
| 113 | +#define ASM_PRINT(string) \ |
|---|
| 117 | 114 | .set push; \ |
|---|
| 118 | 115 | .set reorder; \ |
|---|
| 119 | | - PTR_LA a0, 8f; \ |
|---|
| 116 | + PTR_LA a0, 8f; \ |
|---|
| 120 | 117 | jal printk; \ |
|---|
| 121 | 118 | .set pop; \ |
|---|
| 122 | 119 | TEXT(string) |
|---|
| 123 | 120 | #else |
|---|
| 124 | | -#define PRINT(string) |
|---|
| 121 | +#define ASM_PRINT(string) |
|---|
| 125 | 122 | #endif |
|---|
| 126 | | - |
|---|
| 127 | | -#define TEXT(msg) \ |
|---|
| 128 | | - .pushsection .data; \ |
|---|
| 129 | | -8: .asciiz msg; \ |
|---|
| 130 | | - .popsection; |
|---|
| 131 | | - |
|---|
| 132 | | -/* |
|---|
| 133 | | - * Build text tables |
|---|
| 134 | | - */ |
|---|
| 135 | | -#define TTABLE(string) \ |
|---|
| 136 | | - .pushsection .text; \ |
|---|
| 137 | | - .word 1f; \ |
|---|
| 138 | | - .popsection \ |
|---|
| 139 | | - .pushsection .data; \ |
|---|
| 140 | | -1: .asciiz string; \ |
|---|
| 141 | | - .popsection |
|---|
| 142 | | - |
|---|
| 143 | | -/* |
|---|
| 144 | | - * MIPS IV pref instruction. |
|---|
| 145 | | - * Use with .set noreorder only! |
|---|
| 146 | | - * |
|---|
| 147 | | - * MIPS IV implementations are free to treat this as a nop. The R5000 |
|---|
| 148 | | - * is one of them. So we should have an option not to use this instruction. |
|---|
| 149 | | - */ |
|---|
| 150 | | -#ifdef CONFIG_CPU_HAS_PREFETCH |
|---|
| 151 | | - |
|---|
| 152 | | -#define PREF(hint,addr) \ |
|---|
| 153 | | - .set push; \ |
|---|
| 154 | | - .set arch=r5000; \ |
|---|
| 155 | | - pref hint, addr; \ |
|---|
| 156 | | - .set pop |
|---|
| 157 | | - |
|---|
| 158 | | -#define PREFE(hint, addr) \ |
|---|
| 159 | | - .set push; \ |
|---|
| 160 | | - .set mips0; \ |
|---|
| 161 | | - .set eva; \ |
|---|
| 162 | | - prefe hint, addr; \ |
|---|
| 163 | | - .set pop |
|---|
| 164 | | - |
|---|
| 165 | | -#define PREFX(hint,addr) \ |
|---|
| 166 | | - .set push; \ |
|---|
| 167 | | - .set arch=r5000; \ |
|---|
| 168 | | - prefx hint, addr; \ |
|---|
| 169 | | - .set pop |
|---|
| 170 | | - |
|---|
| 171 | | -#else /* !CONFIG_CPU_HAS_PREFETCH */ |
|---|
| 172 | | - |
|---|
| 173 | | -#define PREF(hint, addr) |
|---|
| 174 | | -#define PREFE(hint, addr) |
|---|
| 175 | | -#define PREFX(hint, addr) |
|---|
| 176 | | - |
|---|
| 177 | | -#endif /* !CONFIG_CPU_HAS_PREFETCH */ |
|---|
| 178 | | - |
|---|
| 179 | | -/* |
|---|
| 180 | | - * MIPS ISA IV/V movn/movz instructions and equivalents for older CPUs. |
|---|
| 181 | | - */ |
|---|
| 182 | | -#if (_MIPS_ISA == _MIPS_ISA_MIPS1) |
|---|
| 183 | | -#define MOVN(rd, rs, rt) \ |
|---|
| 184 | | - .set push; \ |
|---|
| 185 | | - .set reorder; \ |
|---|
| 186 | | - beqz rt, 9f; \ |
|---|
| 187 | | - move rd, rs; \ |
|---|
| 188 | | - .set pop; \ |
|---|
| 189 | | -9: |
|---|
| 190 | | -#define MOVZ(rd, rs, rt) \ |
|---|
| 191 | | - .set push; \ |
|---|
| 192 | | - .set reorder; \ |
|---|
| 193 | | - bnez rt, 9f; \ |
|---|
| 194 | | - move rd, rs; \ |
|---|
| 195 | | - .set pop; \ |
|---|
| 196 | | -9: |
|---|
| 197 | | -#endif /* _MIPS_ISA == _MIPS_ISA_MIPS1 */ |
|---|
| 198 | | -#if (_MIPS_ISA == _MIPS_ISA_MIPS2) || (_MIPS_ISA == _MIPS_ISA_MIPS3) |
|---|
| 199 | | -#define MOVN(rd, rs, rt) \ |
|---|
| 200 | | - .set push; \ |
|---|
| 201 | | - .set noreorder; \ |
|---|
| 202 | | - bnezl rt, 9f; \ |
|---|
| 203 | | - move rd, rs; \ |
|---|
| 204 | | - .set pop; \ |
|---|
| 205 | | -9: |
|---|
| 206 | | -#define MOVZ(rd, rs, rt) \ |
|---|
| 207 | | - .set push; \ |
|---|
| 208 | | - .set noreorder; \ |
|---|
| 209 | | - beqzl rt, 9f; \ |
|---|
| 210 | | - move rd, rs; \ |
|---|
| 211 | | - .set pop; \ |
|---|
| 212 | | -9: |
|---|
| 213 | | -#endif /* (_MIPS_ISA == _MIPS_ISA_MIPS2) || (_MIPS_ISA == _MIPS_ISA_MIPS3) */ |
|---|
| 214 | | -#if (_MIPS_ISA == _MIPS_ISA_MIPS4 ) || (_MIPS_ISA == _MIPS_ISA_MIPS5) || \ |
|---|
| 215 | | - (_MIPS_ISA == _MIPS_ISA_MIPS32) || (_MIPS_ISA == _MIPS_ISA_MIPS64) |
|---|
| 216 | | -#define MOVN(rd, rs, rt) \ |
|---|
| 217 | | - movn rd, rs, rt |
|---|
| 218 | | -#define MOVZ(rd, rs, rt) \ |
|---|
| 219 | | - movz rd, rs, rt |
|---|
| 220 | | -#endif /* MIPS IV, MIPS V, MIPS32 or MIPS64 */ |
|---|
| 221 | 123 | |
|---|
| 222 | 124 | /* |
|---|
| 223 | 125 | * Stack alignment |
|---|
| .. | .. |
|---|
| 318 | 220 | #define LONG_SRA sra |
|---|
| 319 | 221 | #define LONG_SRAV srav |
|---|
| 320 | 222 | |
|---|
| 223 | +#ifdef __ASSEMBLY__ |
|---|
| 321 | 224 | #define LONG .word |
|---|
| 225 | +#endif |
|---|
| 322 | 226 | #define LONGSIZE 4 |
|---|
| 323 | 227 | #define LONGMASK 3 |
|---|
| 324 | 228 | #define LONGLOG 2 |
|---|
| .. | .. |
|---|
| 341 | 245 | #define LONG_SRA dsra |
|---|
| 342 | 246 | #define LONG_SRAV dsrav |
|---|
| 343 | 247 | |
|---|
| 248 | +#ifdef __ASSEMBLY__ |
|---|
| 344 | 249 | #define LONG .dword |
|---|
| 250 | +#endif |
|---|
| 345 | 251 | #define LONGSIZE 8 |
|---|
| 346 | 252 | #define LONGMASK 7 |
|---|
| 347 | 253 | #define LONGLOG 3 |
|---|