diff options
author | James Hogan <james.hogan@imgtec.com> | 2015-05-13 11:17:14 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2016-05-13 08:01:56 -0400 |
commit | 0c94fa33b4de55a0dcb60519ba04a0fd49da124d (patch) | |
tree | 97374aecf740e169328c5de6806dee8bb96e548a /arch/mips/include/asm/cpu.h | |
parent | c0291f7c735941f2cf5c8d5264c2cc2402b77869 (diff) |
MIPS: cpu: Convert MIPS_CPU_* defs to (1ull << x)
The MIPS_CPU_* definitions have now filled the first 32-bits, and are
getting longer since they're written in hex without zero padding. Adding
my 8 extra MIPS_CPU_* definitions which I haven't upstreamed yet this is
getting increasingly ugly as the comments get shifted progressively to
the right. Its also error prone, and I've seen this cause mistakes on 3
separate occasions now, not helped by it being a conflict hotspot.
Convert all the MIPS_CPU_* definitions to the form (1ull << x). Humans
are better at incrementing than shifting.
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/10045/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/include/asm/cpu.h')
-rw-r--r-- | arch/mips/include/asm/cpu.h | 89 |
1 files changed, 48 insertions, 41 deletions
diff --git a/arch/mips/include/asm/cpu.h b/arch/mips/include/asm/cpu.h index a9a5aa75a863..cc579a6c8016 100644 --- a/arch/mips/include/asm/cpu.h +++ b/arch/mips/include/asm/cpu.h | |||
@@ -350,49 +350,56 @@ enum cpu_type_enum { | |||
350 | MIPS_CPU_ISA_M64R6) | 350 | MIPS_CPU_ISA_M64R6) |
351 | 351 | ||
352 | /* | 352 | /* |
353 | * Private version of BIT_ULL() to escape include file recursion hell. | ||
354 | * We soon will have to switch to another mechanism that will work with | ||
355 | * more than 64 bits anyway. | ||
356 | */ | ||
357 | #define MBIT_ULL(bit) (1ULL << (bit)) | ||
358 | |||
359 | /* | ||
353 | * CPU Option encodings | 360 | * CPU Option encodings |
354 | */ | 361 | */ |
355 | #define MIPS_CPU_TLB 0x00000001ull /* CPU has TLB */ | 362 | #define MIPS_CPU_TLB MBIT_ULL( 0) /* CPU has TLB */ |
356 | #define MIPS_CPU_4KEX 0x00000002ull /* "R4K" exception model */ | 363 | #define MIPS_CPU_4KEX MBIT_ULL( 1) /* "R4K" exception model */ |
357 | #define MIPS_CPU_3K_CACHE 0x00000004ull /* R3000-style caches */ | 364 | #define MIPS_CPU_3K_CACHE MBIT_ULL( 2) /* R3000-style caches */ |
358 | #define MIPS_CPU_4K_CACHE 0x00000008ull /* R4000-style caches */ | 365 | #define MIPS_CPU_4K_CACHE MBIT_ULL( 3) /* R4000-style caches */ |
359 | #define MIPS_CPU_TX39_CACHE 0x00000010ull /* TX3900-style caches */ | 366 | #define MIPS_CPU_TX39_CACHE MBIT_ULL( 4) /* TX3900-style caches */ |
360 | #define MIPS_CPU_FPU 0x00000020ull /* CPU has FPU */ | 367 | #define MIPS_CPU_FPU MBIT_ULL( 5) /* CPU has FPU */ |
361 | #define MIPS_CPU_32FPR 0x00000040ull /* 32 dbl. prec. FP registers */ | 368 | #define MIPS_CPU_32FPR MBIT_ULL( 6) /* 32 dbl. prec. FP registers */ |
362 | #define MIPS_CPU_COUNTER 0x00000080ull /* Cycle count/compare */ | 369 | #define MIPS_CPU_COUNTER MBIT_ULL( 7) /* Cycle count/compare */ |
363 | #define MIPS_CPU_WATCH 0x00000100ull /* watchpoint registers */ | 370 | #define MIPS_CPU_WATCH MBIT_ULL( 8) /* watchpoint registers */ |
364 | #define MIPS_CPU_DIVEC 0x00000200ull /* dedicated interrupt vector */ | 371 | #define MIPS_CPU_DIVEC MBIT_ULL( 9) /* dedicated interrupt vector */ |
365 | #define MIPS_CPU_VCE 0x00000400ull /* virt. coherence conflict possible */ | 372 | #define MIPS_CPU_VCE MBIT_ULL(10) /* virt. coherence conflict possible */ |
366 | #define MIPS_CPU_CACHE_CDEX_P 0x00000800ull /* Create_Dirty_Exclusive CACHE op */ | 373 | #define MIPS_CPU_CACHE_CDEX_P MBIT_ULL(11) /* Create_Dirty_Exclusive CACHE op */ |
367 | #define MIPS_CPU_CACHE_CDEX_S 0x00001000ull /* ... same for seconary cache ... */ | 374 | #define MIPS_CPU_CACHE_CDEX_S MBIT_ULL(12) /* ... same for seconary cache ... */ |
368 | #define MIPS_CPU_MCHECK 0x00002000ull /* Machine check exception */ | 375 | #define MIPS_CPU_MCHECK MBIT_ULL(13) /* Machine check exception */ |
369 | #define MIPS_CPU_EJTAG 0x00004000ull /* EJTAG exception */ | 376 | #define MIPS_CPU_EJTAG MBIT_ULL(14) /* EJTAG exception */ |
370 | #define MIPS_CPU_NOFPUEX 0x00008000ull /* no FPU exception */ | 377 | #define MIPS_CPU_NOFPUEX MBIT_ULL(15) /* no FPU exception */ |
371 | #define MIPS_CPU_LLSC 0x00010000ull /* CPU has ll/sc instructions */ | 378 | #define MIPS_CPU_LLSC MBIT_ULL(16) /* CPU has ll/sc instructions */ |
372 | #define MIPS_CPU_INCLUSIVE_CACHES 0x00020000ull /* P-cache subset enforced */ | 379 | #define MIPS_CPU_INCLUSIVE_CACHES MBIT_ULL(17) /* P-cache subset enforced */ |
373 | #define MIPS_CPU_PREFETCH 0x00040000ull /* CPU has usable prefetch */ | 380 | #define MIPS_CPU_PREFETCH MBIT_ULL(18) /* CPU has usable prefetch */ |
374 | #define MIPS_CPU_VINT 0x00080000ull /* CPU supports MIPSR2 vectored interrupts */ | 381 | #define MIPS_CPU_VINT MBIT_ULL(19) /* CPU supports MIPSR2 vectored interrupts */ |
375 | #define MIPS_CPU_VEIC 0x00100000ull /* CPU supports MIPSR2 external interrupt controller mode */ | 382 | #define MIPS_CPU_VEIC MBIT_ULL(20) /* CPU supports MIPSR2 external interrupt controller mode */ |
376 | #define MIPS_CPU_ULRI 0x00200000ull /* CPU has ULRI feature */ | 383 | #define MIPS_CPU_ULRI MBIT_ULL(21) /* CPU has ULRI feature */ |
377 | #define MIPS_CPU_PCI 0x00400000ull /* CPU has Perf Ctr Int indicator */ | 384 | #define MIPS_CPU_PCI MBIT_ULL(22) /* CPU has Perf Ctr Int indicator */ |
378 | #define MIPS_CPU_RIXI 0x00800000ull /* CPU has TLB Read/eXec Inhibit */ | 385 | #define MIPS_CPU_RIXI MBIT_ULL(23) /* CPU has TLB Read/eXec Inhibit */ |
379 | #define MIPS_CPU_MICROMIPS 0x01000000ull /* CPU has microMIPS capability */ | 386 | #define MIPS_CPU_MICROMIPS MBIT_ULL(24) /* CPU has microMIPS capability */ |
380 | #define MIPS_CPU_TLBINV 0x02000000ull /* CPU supports TLBINV/F */ | 387 | #define MIPS_CPU_TLBINV MBIT_ULL(25) /* CPU supports TLBINV/F */ |
381 | #define MIPS_CPU_SEGMENTS 0x04000000ull /* CPU supports Segmentation Control registers */ | 388 | #define MIPS_CPU_SEGMENTS MBIT_ULL(26) /* CPU supports Segmentation Control registers */ |
382 | #define MIPS_CPU_EVA 0x08000000ull /* CPU supports Enhanced Virtual Addressing */ | 389 | #define MIPS_CPU_EVA MBIT_ULL(27) /* CPU supports Enhanced Virtual Addressing */ |
383 | #define MIPS_CPU_HTW 0x10000000ull /* CPU support Hardware Page Table Walker */ | 390 | #define MIPS_CPU_HTW MBIT_ULL(28) /* CPU support Hardware Page Table Walker */ |
384 | #define MIPS_CPU_RIXIEX 0x20000000ull /* CPU has unique exception codes for {Read, Execute}-Inhibit exceptions */ | 391 | #define MIPS_CPU_RIXIEX MBIT_ULL(29) /* CPU has unique exception codes for {Read, Execute}-Inhibit exceptions */ |
385 | #define MIPS_CPU_MAAR 0x40000000ull /* MAAR(I) registers are present */ | 392 | #define MIPS_CPU_MAAR MBIT_ULL(30) /* MAAR(I) registers are present */ |
386 | #define MIPS_CPU_FRE 0x80000000ull /* FRE & UFE bits implemented */ | 393 | #define MIPS_CPU_FRE MBIT_ULL(31) /* FRE & UFE bits implemented */ |
387 | #define MIPS_CPU_RW_LLB 0x100000000ull /* LLADDR/LLB writes are allowed */ | 394 | #define MIPS_CPU_RW_LLB MBIT_ULL(32) /* LLADDR/LLB writes are allowed */ |
388 | #define MIPS_CPU_XPA 0x200000000ull /* CPU supports Extended Physical Addressing */ | 395 | #define MIPS_CPU_XPA MBIT_ULL(33) /* CPU supports Extended Physical Addressing */ |
389 | #define MIPS_CPU_CDMM 0x400000000ull /* CPU has Common Device Memory Map */ | 396 | #define MIPS_CPU_CDMM MBIT_ULL(34) /* CPU has Common Device Memory Map */ |
390 | #define MIPS_CPU_BP_GHIST 0x8000000000ull /* R12K+ Branch Prediction Global History */ | 397 | #define MIPS_CPU_BP_GHIST MBIT_ULL(35) /* R12K+ Branch Prediction Global History */ |
391 | #define MIPS_CPU_SP 0x10000000000ull /* Small (1KB) page support */ | 398 | #define MIPS_CPU_SP MBIT_ULL(36) /* Small (1KB) page support */ |
392 | #define MIPS_CPU_FTLB 0x20000000000ull /* CPU has Fixed-page-size TLB */ | 399 | #define MIPS_CPU_FTLB MBIT_ULL(37) /* CPU has Fixed-page-size TLB */ |
393 | #define MIPS_CPU_NAN_LEGACY 0x40000000000ull /* Legacy NaN implemented */ | 400 | #define MIPS_CPU_NAN_LEGACY MBIT_ULL(38) /* Legacy NaN implemented */ |
394 | #define MIPS_CPU_NAN_2008 0x80000000000ull /* 2008 NaN implemented */ | 401 | #define MIPS_CPU_NAN_2008 MBIT_ULL(39) /* 2008 NaN implemented */ |
395 | #define MIPS_CPU_VP 0x100000000000ull /* MIPSr6 Virtual Processors (multi-threading) */ | 402 | #define MIPS_CPU_VP MBIT_ULL(40) /* MIPSr6 Virtual Processors (multi-threading) */ |
396 | 403 | ||
397 | /* | 404 | /* |
398 | * CPU ASE encodings | 405 | * CPU ASE encodings |