1 #pragma once
2
3 #include <stdbool.h>
4 #include <stdint.h>
5
6 #include <arm/api.h>
7 #include <arm/midr.h>
8 #include <cpuinfo.h>
9 #include <cpuinfo/common.h>
10 #include <linux/api.h>
11
12 /* No hard limit in the kernel, maximum length observed on non-rogue kernels is
13 * 64 */
14 #define CPUINFO_HARDWARE_VALUE_MAX 64
15 /* No hard limit in the kernel, maximum length on Raspberry Pi is 8. Add 1
16 * symbol to detect overly large revision strings */
17 #define CPUINFO_REVISION_VALUE_MAX 9
18
19 #ifdef __ANDROID__
20 /* As per include/sys/system_properties.h in Android NDK */
21 #define CPUINFO_BUILD_PROP_NAME_MAX 32
22 #define CPUINFO_BUILD_PROP_VALUE_MAX 92
23
24 struct cpuinfo_android_properties {
25 char proc_cpuinfo_hardware[CPUINFO_HARDWARE_VALUE_MAX];
26 char ro_product_board[CPUINFO_BUILD_PROP_VALUE_MAX];
27 char ro_board_platform[CPUINFO_BUILD_PROP_VALUE_MAX];
28 char ro_mediatek_platform[CPUINFO_BUILD_PROP_VALUE_MAX];
29 char ro_arch[CPUINFO_BUILD_PROP_VALUE_MAX];
30 char ro_chipname[CPUINFO_BUILD_PROP_VALUE_MAX];
31 char ro_hardware_chipname[CPUINFO_BUILD_PROP_VALUE_MAX];
32 };
33 #endif
34
35 #define CPUINFO_ARM_LINUX_ARCH_T UINT32_C(0x00000001)
36 #define CPUINFO_ARM_LINUX_ARCH_E UINT32_C(0x00000002)
37 #define CPUINFO_ARM_LINUX_ARCH_J UINT32_C(0x00000004)
38
39 #define CPUINFO_ARM_LINUX_ARCH_TE UINT32_C(0x00000003)
40 #define CPUINFO_ARM_LINUX_ARCH_TEJ UINT32_C(0x00000007)
41
42 struct cpuinfo_arm_linux_proc_cpuinfo_cache {
43 uint32_t i_size;
44 uint32_t i_assoc;
45 uint32_t i_line_length;
46 uint32_t i_sets;
47 uint32_t d_size;
48 uint32_t d_assoc;
49 uint32_t d_line_length;
50 uint32_t d_sets;
51 };
52
53 #if CPUINFO_ARCH_ARM
54 /* arch/arm/include/uapi/asm/hwcap.h */
55
56 #define CPUINFO_ARM_LINUX_FEATURE_SWP UINT32_C(0x00000001)
57 #define CPUINFO_ARM_LINUX_FEATURE_HALF UINT32_C(0x00000002)
58 #define CPUINFO_ARM_LINUX_FEATURE_THUMB UINT32_C(0x00000004)
59 #define CPUINFO_ARM_LINUX_FEATURE_26BIT UINT32_C(0x00000008)
60 #define CPUINFO_ARM_LINUX_FEATURE_FASTMULT UINT32_C(0x00000010)
61 #define CPUINFO_ARM_LINUX_FEATURE_FPA UINT32_C(0x00000020)
62 #define CPUINFO_ARM_LINUX_FEATURE_VFP UINT32_C(0x00000040)
63 #define CPUINFO_ARM_LINUX_FEATURE_EDSP UINT32_C(0x00000080)
64 #define CPUINFO_ARM_LINUX_FEATURE_JAVA UINT32_C(0x00000100)
65 #define CPUINFO_ARM_LINUX_FEATURE_IWMMXT UINT32_C(0x00000200)
66 #define CPUINFO_ARM_LINUX_FEATURE_CRUNCH UINT32_C(0x00000400)
67 #define CPUINFO_ARM_LINUX_FEATURE_THUMBEE UINT32_C(0x00000800)
68 #define CPUINFO_ARM_LINUX_FEATURE_NEON UINT32_C(0x00001000)
69 #define CPUINFO_ARM_LINUX_FEATURE_VFPV3 UINT32_C(0x00002000)
70 #define CPUINFO_ARM_LINUX_FEATURE_VFPV3D16 \
71 UINT32_C(0x00004000) /* Also set for VFPv4 with 16 double-precision \
72 registers */
73 #define CPUINFO_ARM_LINUX_FEATURE_TLS UINT32_C(0x00008000)
74 #define CPUINFO_ARM_LINUX_FEATURE_VFPV4 UINT32_C(0x00010000)
75 #define CPUINFO_ARM_LINUX_FEATURE_IDIVA UINT32_C(0x00020000)
76 #define CPUINFO_ARM_LINUX_FEATURE_IDIVT UINT32_C(0x00040000)
77 #define CPUINFO_ARM_LINUX_FEATURE_IDIV UINT32_C(0x00060000)
78 #define CPUINFO_ARM_LINUX_FEATURE_VFPD32 UINT32_C(0x00080000)
79 #define CPUINFO_ARM_LINUX_FEATURE_LPAE UINT32_C(0x00100000)
80 #define CPUINFO_ARM_LINUX_FEATURE_EVTSTRM UINT32_C(0x00200000)
81
82 #define CPUINFO_ARM_LINUX_FEATURE2_AES UINT32_C(0x00000001)
83 #define CPUINFO_ARM_LINUX_FEATURE2_PMULL UINT32_C(0x00000002)
84 #define CPUINFO_ARM_LINUX_FEATURE2_SHA1 UINT32_C(0x00000004)
85 #define CPUINFO_ARM_LINUX_FEATURE2_SHA2 UINT32_C(0x00000008)
86 #define CPUINFO_ARM_LINUX_FEATURE2_CRC32 UINT32_C(0x00000010)
87 #elif CPUINFO_ARCH_ARM64
88 /* arch/arm64/include/uapi/asm/hwcap.h */
89 #define CPUINFO_ARM_LINUX_FEATURE_FP UINT32_C(0x00000001)
90 #define CPUINFO_ARM_LINUX_FEATURE_ASIMD UINT32_C(0x00000002)
91 #define CPUINFO_ARM_LINUX_FEATURE_EVTSTRM UINT32_C(0x00000004)
92 #define CPUINFO_ARM_LINUX_FEATURE_AES UINT32_C(0x00000008)
93 #define CPUINFO_ARM_LINUX_FEATURE_PMULL UINT32_C(0x00000010)
94 #define CPUINFO_ARM_LINUX_FEATURE_SHA1 UINT32_C(0x00000020)
95 #define CPUINFO_ARM_LINUX_FEATURE_SHA2 UINT32_C(0x00000040)
96 #define CPUINFO_ARM_LINUX_FEATURE_CRC32 UINT32_C(0x00000080)
97 #define CPUINFO_ARM_LINUX_FEATURE_ATOMICS UINT32_C(0x00000100)
98 #define CPUINFO_ARM_LINUX_FEATURE_FPHP UINT32_C(0x00000200)
99 #define CPUINFO_ARM_LINUX_FEATURE_ASIMDHP UINT32_C(0x00000400)
100 #define CPUINFO_ARM_LINUX_FEATURE_CPUID UINT32_C(0x00000800)
101 #define CPUINFO_ARM_LINUX_FEATURE_ASIMDRDM UINT32_C(0x00001000)
102 #define CPUINFO_ARM_LINUX_FEATURE_JSCVT UINT32_C(0x00002000)
103 #define CPUINFO_ARM_LINUX_FEATURE_FCMA UINT32_C(0x00004000)
104 #define CPUINFO_ARM_LINUX_FEATURE_LRCPC UINT32_C(0x00008000)
105 #define CPUINFO_ARM_LINUX_FEATURE_DCPOP UINT32_C(0x00010000)
106 #define CPUINFO_ARM_LINUX_FEATURE_SHA3 UINT32_C(0x00020000)
107 #define CPUINFO_ARM_LINUX_FEATURE_SM3 UINT32_C(0x00040000)
108 #define CPUINFO_ARM_LINUX_FEATURE_SM4 UINT32_C(0x00080000)
109 #define CPUINFO_ARM_LINUX_FEATURE_ASIMDDP UINT32_C(0x00100000)
110 #define CPUINFO_ARM_LINUX_FEATURE_SHA512 UINT32_C(0x00200000)
111 #define CPUINFO_ARM_LINUX_FEATURE_SVE UINT32_C(0x00400000)
112 #define CPUINFO_ARM_LINUX_FEATURE_ASIMDFHM UINT32_C(0x00800000)
113 #define CPUINFO_ARM_LINUX_FEATURE_DIT UINT32_C(0x01000000)
114 #define CPUINFO_ARM_LINUX_FEATURE_USCAT UINT32_C(0x02000000)
115 #define CPUINFO_ARM_LINUX_FEATURE_ILRCPC UINT32_C(0x04000000)
116 #define CPUINFO_ARM_LINUX_FEATURE_FLAGM UINT32_C(0x08000000)
117 #define CPUINFO_ARM_LINUX_FEATURE_SSBS UINT32_C(0x10000000)
118 #define CPUINFO_ARM_LINUX_FEATURE_SB UINT32_C(0x20000000)
119 #define CPUINFO_ARM_LINUX_FEATURE_PACA UINT32_C(0x40000000)
120 #define CPUINFO_ARM_LINUX_FEATURE_PACG UINT32_C(0x80000000)
121
122 #define CPUINFO_ARM_LINUX_FEATURE2_DCPODP UINT32_C(0x00000001)
123 #define CPUINFO_ARM_LINUX_FEATURE2_SVE2 UINT32_C(0x00000002)
124 #define CPUINFO_ARM_LINUX_FEATURE2_SVEAES UINT32_C(0x00000004)
125 #define CPUINFO_ARM_LINUX_FEATURE2_SVEPMULL UINT32_C(0x00000008)
126 #define CPUINFO_ARM_LINUX_FEATURE2_SVEBITPERM UINT32_C(0x00000010)
127 #define CPUINFO_ARM_LINUX_FEATURE2_SVESHA3 UINT32_C(0x00000020)
128 #define CPUINFO_ARM_LINUX_FEATURE2_SVESM4 UINT32_C(0x00000040)
129 #define CPUINFO_ARM_LINUX_FEATURE2_FLAGM2 UINT32_C(0x00000080)
130 #define CPUINFO_ARM_LINUX_FEATURE2_FRINT UINT32_C(0x00000100)
131 #define CPUINFO_ARM_LINUX_FEATURE2_SVEI8MM UINT32_C(0x00000200)
132 #define CPUINFO_ARM_LINUX_FEATURE2_SVEF32MM UINT32_C(0x00000400)
133 #define CPUINFO_ARM_LINUX_FEATURE2_SVEF64MM UINT32_C(0x00000800)
134 #define CPUINFO_ARM_LINUX_FEATURE2_SVEBF16 UINT32_C(0x00001000)
135 #define CPUINFO_ARM_LINUX_FEATURE2_I8MM UINT32_C(0x00002000)
136 #define CPUINFO_ARM_LINUX_FEATURE2_BF16 UINT32_C(0x00004000)
137 #define CPUINFO_ARM_LINUX_FEATURE2_DGH UINT32_C(0x00008000)
138 #define CPUINFO_ARM_LINUX_FEATURE2_RNG UINT32_C(0x00010000)
139 #define CPUINFO_ARM_LINUX_FEATURE2_BTI UINT32_C(0x00020000)
140 #define CPUINFO_ARM_LINUX_FEATURE2_SME UINT32_C(0x00800000)
141 #define CPUINFO_ARM_LINUX_FEATURE2_SME2 UINT64_C(0x0000002000000000)
142 #define CPUINFO_ARM_LINUX_FEATURE2_SME2P1 UINT64_C(0x0000004000000000)
143 #define CPUINFO_ARM_LINUX_FEATURE2_SME_I16I32 UINT64_C(0x0000008000000000)
144 #define CPUINFO_ARM_LINUX_FEATURE2_SME_BI32I32 UINT64_C(0x0000010000000000)
145 #define CPUINFO_ARM_LINUX_FEATURE2_SME_B16B16 UINT64_C(0x0000020000000000)
146 #define CPUINFO_ARM_LINUX_FEATURE2_SME_F16F16 UINT64_C(0x0000040000000000)
147 #endif
148
149 #define CPUINFO_ARM_LINUX_VALID_ARCHITECTURE UINT32_C(0x00010000)
150 #define CPUINFO_ARM_LINUX_VALID_IMPLEMENTER UINT32_C(0x00020000)
151 #define CPUINFO_ARM_LINUX_VALID_VARIANT UINT32_C(0x00040000)
152 #define CPUINFO_ARM_LINUX_VALID_PART UINT32_C(0x00080000)
153 #define CPUINFO_ARM_LINUX_VALID_REVISION UINT32_C(0x00100000)
154 #define CPUINFO_ARM_LINUX_VALID_PROCESSOR UINT32_C(0x00200000)
155 #define CPUINFO_ARM_LINUX_VALID_FEATURES UINT32_C(0x00400000)
156 #if CPUINFO_ARCH_ARM
157 #define CPUINFO_ARM_LINUX_VALID_ICACHE_SIZE UINT32_C(0x01000000)
158 #define CPUINFO_ARM_LINUX_VALID_ICACHE_SETS UINT32_C(0x02000000)
159 #define CPUINFO_ARM_LINUX_VALID_ICACHE_WAYS UINT32_C(0x04000000)
160 #define CPUINFO_ARM_LINUX_VALID_ICACHE_LINE UINT32_C(0x08000000)
161 #define CPUINFO_ARM_LINUX_VALID_DCACHE_SIZE UINT32_C(0x10000000)
162 #define CPUINFO_ARM_LINUX_VALID_DCACHE_SETS UINT32_C(0x20000000)
163 #define CPUINFO_ARM_LINUX_VALID_DCACHE_WAYS UINT32_C(0x40000000)
164 #define CPUINFO_ARM_LINUX_VALID_DCACHE_LINE UINT32_C(0x80000000)
165 #endif
166
167 #define CPUINFO_ARM_LINUX_VALID_INFO UINT32_C(0x007F0000)
168 #define CPUINFO_ARM_LINUX_VALID_MIDR UINT32_C(0x003F0000)
169 #if CPUINFO_ARCH_ARM
170 #define CPUINFO_ARM_LINUX_VALID_ICACHE UINT32_C(0x0F000000)
171 #define CPUINFO_ARM_LINUX_VALID_DCACHE UINT32_C(0xF0000000)
172 #define CPUINFO_ARM_LINUX_VALID_CACHE_LINE UINT32_C(0x88000000)
173 #endif
174
175 struct cpuinfo_arm_linux_processor {
176 uint32_t architecture_version;
177 #if CPUINFO_ARCH_ARM
178 uint32_t architecture_flags;
179 struct cpuinfo_arm_linux_proc_cpuinfo_cache proc_cpuinfo_cache;
180 #endif
181 uint32_t features;
182 uint64_t features2;
183 /**
184 * Main ID Register value.
185 */
186 uint32_t midr;
187 enum cpuinfo_vendor vendor;
188 enum cpuinfo_uarch uarch;
189 uint32_t uarch_index;
190 /**
191 * ID of the physical package which includes this logical processor.
192 * The value is parsed from
193 * /sys/devices/system/cpu/cpu<N>/topology/physical_package_id
194 */
195 uint32_t package_id;
196 /**
197 * Minimum processor ID on the package which includes this logical
198 * processor. This value can serve as an ID for the cluster of logical
199 * processors: it is the same for all logical processors on the same
200 * package.
201 */
202 uint32_t package_leader_id;
203 /**
204 * Number of logical processors in the package.
205 */
206 uint32_t package_processor_count;
207 /**
208 * Maximum frequency, in kHZ.
209 * The value is parsed from
210 * /sys/devices/system/cpu/cpu<N>/cpufreq/cpuinfo_max_freq If failed to
211 * read or parse the file, the value is 0.
212 */
213 uint32_t max_frequency;
214 /**
215 * Minimum frequency, in kHZ.
216 * The value is parsed from
217 * /sys/devices/system/cpu/cpu<N>/cpufreq/cpuinfo_min_freq If failed to
218 * read or parse the file, the value is 0.
219 */
220 uint32_t min_frequency;
221 /** Linux processor ID */
222 uint32_t system_processor_id;
223 uint32_t flags;
224 };
225
226 struct cpuinfo_arm_linux_cluster {
227 uint32_t processor_id_min;
228 uint32_t processor_id_max;
229 };
230
231 /* Returns true if the two processors do belong to the same cluster */
cpuinfo_arm_linux_processor_equals(struct cpuinfo_arm_linux_processor processor_i[restrict static1],struct cpuinfo_arm_linux_processor processor_j[restrict static1])232 static inline bool cpuinfo_arm_linux_processor_equals(
233 struct cpuinfo_arm_linux_processor processor_i[restrict static 1],
234 struct cpuinfo_arm_linux_processor processor_j[restrict static 1]) {
235 const uint32_t joint_flags = processor_i->flags & processor_j->flags;
236
237 bool same_max_frequency = false;
238 if (joint_flags & CPUINFO_LINUX_FLAG_MAX_FREQUENCY) {
239 if (processor_i->max_frequency != processor_j->max_frequency) {
240 return false;
241 } else {
242 same_max_frequency = true;
243 }
244 }
245
246 bool same_min_frequency = false;
247 if (joint_flags & CPUINFO_LINUX_FLAG_MIN_FREQUENCY) {
248 if (processor_i->min_frequency != processor_j->min_frequency) {
249 return false;
250 } else {
251 same_min_frequency = true;
252 }
253 }
254
255 if ((joint_flags & CPUINFO_ARM_LINUX_VALID_MIDR) == CPUINFO_ARM_LINUX_VALID_MIDR) {
256 if (processor_i->midr == processor_j->midr) {
257 if (midr_is_cortex_a53(processor_i->midr)) {
258 return same_min_frequency & same_max_frequency;
259 } else {
260 return true;
261 }
262 }
263 }
264
265 return same_max_frequency && same_min_frequency;
266 }
267
268 /* Returns true if the two processors certainly don't belong to the same cluster
269 */
cpuinfo_arm_linux_processor_not_equals(struct cpuinfo_arm_linux_processor processor_i[restrict static1],struct cpuinfo_arm_linux_processor processor_j[restrict static1])270 static inline bool cpuinfo_arm_linux_processor_not_equals(
271 struct cpuinfo_arm_linux_processor processor_i[restrict static 1],
272 struct cpuinfo_arm_linux_processor processor_j[restrict static 1]) {
273 const uint32_t joint_flags = processor_i->flags & processor_j->flags;
274
275 if (joint_flags & CPUINFO_LINUX_FLAG_MAX_FREQUENCY) {
276 if (processor_i->max_frequency != processor_j->max_frequency) {
277 return true;
278 }
279 }
280
281 if (joint_flags & CPUINFO_LINUX_FLAG_MIN_FREQUENCY) {
282 if (processor_i->min_frequency != processor_j->min_frequency) {
283 return true;
284 }
285 }
286
287 if ((joint_flags & CPUINFO_ARM_LINUX_VALID_MIDR) == CPUINFO_ARM_LINUX_VALID_MIDR) {
288 if (processor_i->midr != processor_j->midr) {
289 return true;
290 }
291 }
292
293 return false;
294 }
295
296 CPUINFO_INTERNAL bool cpuinfo_arm_linux_parse_proc_cpuinfo(
297 char hardware[restrict static CPUINFO_HARDWARE_VALUE_MAX],
298 char revision[restrict static CPUINFO_REVISION_VALUE_MAX],
299 uint32_t max_processors_count,
300 struct cpuinfo_arm_linux_processor processors[restrict static max_processors_count]);
301
302 #if CPUINFO_ARCH_ARM
303 CPUINFO_INTERNAL bool cpuinfo_arm_linux_hwcap_from_getauxval(
304 uint32_t hwcap[restrict static 1],
305 uint64_t hwcap2[restrict static 1]);
306 CPUINFO_INTERNAL bool cpuinfo_arm_linux_hwcap_from_procfs(
307 uint32_t hwcap[restrict static 1],
308 uint64_t hwcap2[restrict static 1]);
309
310 CPUINFO_INTERNAL void cpuinfo_arm_linux_decode_isa_from_proc_cpuinfo(
311 uint32_t features,
312 uint64_t features2,
313 uint32_t midr,
314 uint32_t architecture_version,
315 uint32_t architecture_flags,
316 const struct cpuinfo_arm_chipset chipset[restrict static 1],
317 struct cpuinfo_arm_isa isa[restrict static 1]);
318 #elif CPUINFO_ARCH_ARM64
319 CPUINFO_INTERNAL void cpuinfo_arm_linux_hwcap_from_getauxval(
320 uint32_t hwcap[restrict static 1],
321 uint64_t hwcap2[restrict static 1]);
322
323 CPUINFO_INTERNAL void cpuinfo_arm64_linux_decode_isa_from_proc_cpuinfo(
324 uint32_t features,
325 uint64_t features2,
326 uint32_t midr,
327 const struct cpuinfo_arm_chipset chipset[restrict static 1],
328 struct cpuinfo_arm_isa isa[restrict static 1]);
329 #endif
330
331 #if defined(__ANDROID__)
332 CPUINFO_INTERNAL struct cpuinfo_arm_chipset cpuinfo_arm_android_decode_chipset(
333 const struct cpuinfo_android_properties properties[restrict static 1],
334 uint32_t cores,
335 uint32_t max_cpu_freq_max);
336 #else
337 CPUINFO_INTERNAL struct cpuinfo_arm_chipset cpuinfo_arm_linux_decode_chipset(
338 const char hardware[restrict static CPUINFO_HARDWARE_VALUE_MAX],
339 const char revision[restrict static CPUINFO_REVISION_VALUE_MAX],
340 uint32_t cores,
341 uint32_t max_cpu_freq_max);
342 #endif
343
344 CPUINFO_INTERNAL struct cpuinfo_arm_chipset cpuinfo_arm_linux_decode_chipset_from_proc_cpuinfo_hardware(
345 const char proc_cpuinfo_hardware[restrict static CPUINFO_HARDWARE_VALUE_MAX],
346 uint32_t cores,
347 uint32_t max_cpu_freq_max,
348 bool is_tegra);
349
350 #ifdef __ANDROID__
351 CPUINFO_INTERNAL struct cpuinfo_arm_chipset cpuinfo_arm_android_decode_chipset_from_ro_product_board(
352 const char ro_product_board[restrict static CPUINFO_BUILD_PROP_VALUE_MAX],
353 uint32_t cores,
354 uint32_t max_cpu_freq_max);
355 CPUINFO_INTERNAL struct cpuinfo_arm_chipset cpuinfo_arm_android_decode_chipset_from_ro_board_platform(
356 const char ro_board_platform[restrict static CPUINFO_BUILD_PROP_VALUE_MAX],
357 uint32_t cores,
358 uint32_t max_cpu_freq_max);
359 CPUINFO_INTERNAL struct cpuinfo_arm_chipset cpuinfo_arm_android_decode_chipset_from_ro_mediatek_platform(
360 const char ro_mediatek_platform[restrict static CPUINFO_BUILD_PROP_VALUE_MAX]);
361 CPUINFO_INTERNAL struct cpuinfo_arm_chipset cpuinfo_arm_android_decode_chipset_from_ro_arch(
362 const char ro_arch[restrict static CPUINFO_BUILD_PROP_VALUE_MAX]);
363 CPUINFO_INTERNAL struct cpuinfo_arm_chipset cpuinfo_arm_android_decode_chipset_from_ro_chipname(
364 const char ro_chipname[restrict static CPUINFO_BUILD_PROP_VALUE_MAX]);
365 CPUINFO_INTERNAL struct cpuinfo_arm_chipset cpuinfo_arm_android_decode_chipset_from_ro_hardware_chipname(
366 const char ro_hardware_chipname[restrict static CPUINFO_BUILD_PROP_VALUE_MAX]);
367 #else
368 CPUINFO_INTERNAL struct cpuinfo_arm_chipset cpuinfo_arm_linux_decode_chipset_from_proc_cpuinfo_revision(
369 const char proc_cpuinfo_revision[restrict static CPUINFO_REVISION_VALUE_MAX]);
370 #endif
371
372 CPUINFO_INTERNAL bool cpuinfo_arm_linux_detect_core_clusters_by_heuristic(
373 uint32_t usable_processors,
374 uint32_t max_processors,
375 struct cpuinfo_arm_linux_processor processors[restrict static max_processors]);
376
377 CPUINFO_INTERNAL void cpuinfo_arm_linux_detect_core_clusters_by_sequential_scan(
378 uint32_t max_processors,
379 struct cpuinfo_arm_linux_processor processors[restrict static max_processors]);
380
381 CPUINFO_INTERNAL void cpuinfo_arm_linux_count_cluster_processors(
382 uint32_t max_processors,
383 struct cpuinfo_arm_linux_processor processors[restrict static max_processors]);
384
385 CPUINFO_INTERNAL uint32_t cpuinfo_arm_linux_detect_cluster_midr(
386 const struct cpuinfo_arm_chipset chipset[restrict static 1],
387 uint32_t max_processors,
388 uint32_t usable_processors,
389 struct cpuinfo_arm_linux_processor processors[restrict static max_processors]);
390
391 extern CPUINFO_INTERNAL const uint32_t* cpuinfo_linux_cpu_to_uarch_index_map;
392 extern CPUINFO_INTERNAL uint32_t cpuinfo_linux_cpu_to_uarch_index_map_entries;
393