ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / include / asm-mips / cpu-features.h
1 /*
2  * This file is subject to the terms and conditions of the GNU General Public
3  * License.  See the file "COPYING" in the main directory of this archive
4  * for more details.
5  *
6  * Copyright (C) 2003 Ralf Baechle
7  */
8 #ifndef __ASM_CPU_FEATURES_H
9 #define __ASM_CPU_FEATURES_H
10
11 #include <cpu-feature-overrides.h>
12
13 /*
14  * SMP assumption: Options of CPU 0 are a superset of all processors.
15  * This is true for all known MIPS systems.
16  */
17 #ifndef cpu_has_tlb
18 #define cpu_has_tlb             (cpu_data[0].options & MIPS_CPU_TLB)
19 #endif
20 #ifndef cpu_has_4kex
21 #define cpu_has_4kex            (cpu_data[0].options & MIPS_CPU_4KEX)
22 #endif
23 #ifndef cpu_has_4ktlb
24 #define cpu_has_4ktlb           (cpu_data[0].options & MIPS_CPU_4KTLB)
25 #endif
26 #ifndef cpu_has_fpu
27 #define cpu_has_fpu             (cpu_data[0].options & MIPS_CPU_FPU)
28 #endif
29 #ifndef cpu_has_32fpr
30 #define cpu_has_32fpr           (cpu_data[0].options & MIPS_CPU_32FPR)
31 #endif
32 #ifndef cpu_has_counter
33 #define cpu_has_counter         (cpu_data[0].options & MIPS_CPU_COUNTER)
34 #endif
35 #ifndef cpu_has_watch
36 #define cpu_has_watch           (cpu_data[0].options & MIPS_CPU_WATCH)
37 #endif
38 #ifndef cpu_has_mips16
39 #define cpu_has_mips16          (cpu_data[0].options & MIPS_CPU_MIPS16)
40 #endif
41 #ifndef cpu_has_divec
42 #define cpu_has_divec           (cpu_data[0].options & MIPS_CPU_DIVEC)
43 #endif
44 #ifndef cpu_has_vce
45 #define cpu_has_vce             (cpu_data[0].options & MIPS_CPU_VCE)
46 #endif
47 #ifndef cpu_has_cache_cdex_p
48 #define cpu_has_cache_cdex_p    (cpu_data[0].options & MIPS_CPU_CACHE_CDEX_P)
49 #endif
50 #ifndef cpu_has_cache_cdex_s
51 #define cpu_has_cache_cdex_s    (cpu_data[0].options & MIPS_CPU_CACHE_CDEX_S)
52 #endif
53 #ifndef cpu_has_prefetch
54 #define cpu_has_prefetch        (cpu_data[0].options & MIPS_CPU_PREFETCH)
55 #endif
56 #ifndef cpu_has_mcheck
57 #define cpu_has_mcheck          (cpu_data[0].options & MIPS_CPU_MCHECK)
58 #endif
59 #ifndef cpu_has_ejtag
60 #define cpu_has_ejtag           (cpu_data[0].options & MIPS_CPU_EJTAG)
61 #endif
62 #ifndef cpu_has_llsc
63 #define cpu_has_llsc            (cpu_data[0].options & MIPS_CPU_LLSC)
64 #endif
65 #ifndef cpu_has_vtag_icache
66 #define cpu_has_vtag_icache     (cpu_data[0].icache.flags & MIPS_CACHE_VTAG)
67 #endif
68 #ifndef cpu_has_dc_aliases
69 #define cpu_has_dc_aliases      (cpu_data[0].dcache.flags & MIPS_CACHE_ALIASES)
70 #endif
71 #ifndef cpu_has_ic_fills_f_dc
72 #define cpu_has_ic_fills_f_dc   (cpu_data[0].dcache.flags & MIPS_CACHE_IC_F_DC)
73 #endif
74
75 #ifdef CONFIG_MIPS32
76 # ifndef cpu_has_nofpuex
77 # define cpu_has_nofpuex        (cpu_data[0].options & MIPS_CPU_NOFPUEX)
78 # endif
79 # ifndef cpu_has_64bits
80 # define cpu_has_64bits         (cpu_data[0].isa_level & MIPS_CPU_ISA_64BIT)
81 # endif
82 # ifndef cpu_has_64bit_zero_reg
83 # define cpu_has_64bit_zero_reg (cpu_data[0].isa_level & MIPS_CPU_ISA_64BIT)
84 # endif
85 # ifndef cpu_has_64bit_gp_regs
86 # define cpu_has_64bit_gp_regs          0
87 # endif
88 # ifndef cpu_has_64bit_addresses
89 # define cpu_has_64bit_addresses        0
90 # endif
91 #endif
92
93 #ifdef CONFIG_MIPS64
94 # ifndef cpu_has_nofpuex
95 # define cpu_has_nofpuex                0
96 # endif
97 # ifndef cpu_has_64bits
98 # define cpu_has_64bits                 1
99 # endif
100 # ifndef cpu_has_64bit_zero_reg
101 # define cpu_has_64bit_zero_reg         1
102 # endif
103 # ifndef cpu_has_64bit_gp_regs
104 # define cpu_has_64bit_gp_regs          1
105 # endif
106 # ifndef cpu_has_64bit_addresses
107 # define cpu_has_64bit_addresses        1
108 # endif
109 #endif
110
111 #ifndef cpu_has_subset_pcaches
112 #define cpu_has_subset_pcaches  (cpu_data[0].options & MIPS_CPU_SUBSET_CACHES)
113 #endif
114
115 #ifndef cpu_dcache_line_size
116 #define cpu_dcache_line_size()  current_cpu_data.dcache.linesz
117 #endif
118 #ifndef cpu_icache_line_size
119 #define cpu_icache_line_size()  current_cpu_data.icache.linesz
120 #endif
121 #ifndef cpu_scache_line_size
122 #define cpu_scache_line_size()  current_cpu_data.scache.linesz
123 #endif
124
125 #endif /* __ASM_CPU_FEATURES_H */