1 /* 2 * arch/arm/include/asm/proc-fns.h 3 * 4 * Copyright (C) 1997-1999 Russell King 5 * Copyright (C) 2000 Deep Blue Solutions Ltd 6 * 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License version 2 as 9 * published by the Free Software Foundation. 10 */ 11 #ifndef __ASM_PROCFNS_H 12 #define __ASM_PROCFNS_H 13 14 #ifdef __KERNEL__ 15 16 17 /* 18 * Work out if we need multiple CPU support 19 */ 20 #undef MULTI_CPU 21 #undef CPU_NAME 22 23 /* 24 * CPU_NAME - the prefix for CPU related functions 25 */ 26 27 #ifdef CONFIG_CPU_ARM610 28 # ifdef CPU_NAME 29 # undef MULTI_CPU 30 # define MULTI_CPU 31 # else 32 # define CPU_NAME cpu_arm6 33 # endif 34 #endif 35 36 #ifdef CONFIG_CPU_ARM7TDMI 37 # ifdef CPU_NAME 38 # undef MULTI_CPU 39 # define MULTI_CPU 40 # else 41 # define CPU_NAME cpu_arm7tdmi 42 # endif 43 #endif 44 45 #ifdef CONFIG_CPU_ARM710 46 # ifdef CPU_NAME 47 # undef MULTI_CPU 48 # define MULTI_CPU 49 # else 50 # define CPU_NAME cpu_arm7 51 # endif 52 #endif 53 54 #ifdef CONFIG_CPU_ARM720T 55 # ifdef CPU_NAME 56 # undef MULTI_CPU 57 # define MULTI_CPU 58 # else 59 # define CPU_NAME cpu_arm720 60 # endif 61 #endif 62 63 #ifdef CONFIG_CPU_ARM740T 64 # ifdef CPU_NAME 65 # undef MULTI_CPU 66 # define MULTI_CPU 67 # else 68 # define CPU_NAME cpu_arm740 69 # endif 70 #endif 71 72 #ifdef CONFIG_CPU_ARM9TDMI 73 # ifdef CPU_NAME 74 # undef MULTI_CPU 75 # define MULTI_CPU 76 # else 77 # define CPU_NAME cpu_arm9tdmi 78 # endif 79 #endif 80 81 #ifdef CONFIG_CPU_ARM920T 82 # ifdef CPU_NAME 83 # undef MULTI_CPU 84 # define MULTI_CPU 85 # else 86 # define CPU_NAME cpu_arm920 87 # endif 88 #endif 89 90 #ifdef CONFIG_CPU_ARM922T 91 # ifdef CPU_NAME 92 # undef MULTI_CPU 93 # define MULTI_CPU 94 # else 95 # define CPU_NAME cpu_arm922 96 # endif 97 #endif 98 99 #ifdef CONFIG_CPU_FA526 100 # ifdef CPU_NAME 101 # undef MULTI_CPU 102 # define MULTI_CPU 103 # else 104 # define CPU_NAME cpu_fa526 105 # endif 106 #endif 107 108 #ifdef CONFIG_CPU_ARM925T 109 # ifdef CPU_NAME 110 # undef MULTI_CPU 111 # define MULTI_CPU 112 # else 113 # define CPU_NAME cpu_arm925 114 # endif 115 #endif 116 117 #ifdef CONFIG_CPU_ARM926T 118 # ifdef CPU_NAME 119 # undef MULTI_CPU 120 # define MULTI_CPU 121 # else 122 # define CPU_NAME cpu_arm926 123 # endif 124 #endif 125 126 #ifdef CONFIG_CPU_ARM940T 127 # ifdef CPU_NAME 128 # undef MULTI_CPU 129 # define MULTI_CPU 130 # else 131 # define CPU_NAME cpu_arm940 132 # endif 133 #endif 134 135 #ifdef CONFIG_CPU_ARM946E 136 # ifdef CPU_NAME 137 # undef MULTI_CPU 138 # define MULTI_CPU 139 # else 140 # define CPU_NAME cpu_arm946 141 # endif 142 #endif 143 144 #ifdef CONFIG_CPU_SA110 145 # ifdef CPU_NAME 146 # undef MULTI_CPU 147 # define MULTI_CPU 148 # else 149 # define CPU_NAME cpu_sa110 150 # endif 151 #endif 152 153 #ifdef CONFIG_CPU_SA1100 154 # ifdef CPU_NAME 155 # undef MULTI_CPU 156 # define MULTI_CPU 157 # else 158 # define CPU_NAME cpu_sa1100 159 # endif 160 #endif 161 162 #ifdef CONFIG_CPU_ARM1020 163 # ifdef CPU_NAME 164 # undef MULTI_CPU 165 # define MULTI_CPU 166 # else 167 # define CPU_NAME cpu_arm1020 168 # endif 169 #endif 170 171 #ifdef CONFIG_CPU_ARM1020E 172 # ifdef CPU_NAME 173 # undef MULTI_CPU 174 # define MULTI_CPU 175 # else 176 # define CPU_NAME cpu_arm1020e 177 # endif 178 #endif 179 180 #ifdef CONFIG_CPU_ARM1022 181 # ifdef CPU_NAME 182 # undef MULTI_CPU 183 # define MULTI_CPU 184 # else 185 # define CPU_NAME cpu_arm1022 186 # endif 187 #endif 188 189 #ifdef CONFIG_CPU_ARM1026 190 # ifdef CPU_NAME 191 # undef MULTI_CPU 192 # define MULTI_CPU 193 # else 194 # define CPU_NAME cpu_arm1026 195 # endif 196 #endif 197 198 #ifdef CONFIG_CPU_XSCALE 199 # ifdef CPU_NAME 200 # undef MULTI_CPU 201 # define MULTI_CPU 202 # else 203 # define CPU_NAME cpu_xscale 204 # endif 205 #endif 206 207 #ifdef CONFIG_CPU_XSC3 208 # ifdef CPU_NAME 209 # undef MULTI_CPU 210 # define MULTI_CPU 211 # else 212 # define CPU_NAME cpu_xsc3 213 # endif 214 #endif 215 216 #ifdef CONFIG_CPU_MOHAWK 217 # ifdef CPU_NAME 218 # undef MULTI_CPU 219 # define MULTI_CPU 220 # else 221 # define CPU_NAME cpu_mohawk 222 # endif 223 #endif 224 225 #ifdef CONFIG_CPU_FEROCEON 226 # ifdef CPU_NAME 227 # undef MULTI_CPU 228 # define MULTI_CPU 229 # else 230 # define CPU_NAME cpu_feroceon 231 # endif 232 #endif 233 234 #ifdef CONFIG_CPU_V6 235 # ifdef CPU_NAME 236 # undef MULTI_CPU 237 # define MULTI_CPU 238 # else 239 # define CPU_NAME cpu_v6 240 # endif 241 #endif 242 243 #ifdef CONFIG_CPU_V7 244 # ifdef CPU_NAME 245 # undef MULTI_CPU 246 # define MULTI_CPU 247 # else 248 # define CPU_NAME cpu_v7 249 # endif 250 #endif 251 252 #ifndef __ASSEMBLY__ 253 254 #ifndef MULTI_CPU 255 #include <asm/cpu-single.h> 256 #else 257 #include <asm/cpu-multi32.h> 258 #endif 259 260 #include <asm/memory.h> 261 262 #ifdef CONFIG_MMU 263 264 #define cpu_switch_mm(pgd,mm) cpu_do_switch_mm(virt_to_phys(pgd),mm) 265 266 #define cpu_get_pgd() \ 267 ({ \ 268 unsigned long pg; \ 269 __asm__("mrc p15, 0, %0, c2, c0, 0" \ 270 : "=r" (pg) : : "cc"); \ 271 pg &= ~0x3fff; \ 272 (pgd_t *)phys_to_virt(pg); \ 273 }) 274 275 #endif 276 277 #endif /* __ASSEMBLY__ */ 278 #endif /* __KERNEL__ */ 279 #endif /* __ASM_PROCFNS_H */ 280