Skip to content

Commit e40c3aa

Browse files
committed
x86: document the array of cpu features
By the way, we already get word 16 so save it too. Signed-off-by: Brice Goglin <[email protected]>
1 parent 9e90851 commit e40c3aa

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

hwloc/topology-x86.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1459,7 +1459,15 @@ int hwloc_look_x86(struct hwloc_backend *backend, unsigned long flags)
14591459
unsigned i;
14601460
unsigned highest_cpuid;
14611461
unsigned highest_ext_cpuid;
1462-
/* This stores cpuid features with the same indexing as Linux */
1462+
/* This stores cpuid features with the same indexing as Linux:
1463+
* [0] = 0x1 edx
1464+
* [1] = 0x80000001 edx
1465+
* [4] = 0x1 ecx
1466+
* [6] = 0x80000001 ecx
1467+
* [9] = 0x7/0 ebx
1468+
* [16] = 0x7/0 ecx
1469+
* [18] = 0x7/0 edx
1470+
*/
14631471
unsigned features[19] = { 0 };
14641472
struct procinfo *infos = NULL;
14651473
enum cpuid_type cpuid_type = unknown;
@@ -1579,6 +1587,7 @@ int hwloc_look_x86(struct hwloc_backend *backend, unsigned long flags)
15791587
ecx = 0;
15801588
cpuid_or_from_dump(&eax, &ebx, &ecx, &edx, src_cpuiddump);
15811589
features[9] = ebx;
1590+
features[16] = ecx;
15821591
features[18] = edx;
15831592
}
15841593

0 commit comments

Comments
 (0)