1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
|
/** @file
CPUID leaf definitions.
Provides defines for CPUID leaf indexes. Data structures are provided for
registers returned by a CPUID leaf that contain one or more bit fields.
If a register returned is a single 32-bit value, then a data structure is
not provided for that register.
Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License which accompanies this distribution.
The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
@par Specification Reference:
Intel(R) 64 and IA-32 Architectures Software Developer's Manual, Volume 2A,
November 2018, CPUID instruction.
**/
#ifndef __CPUID_H__
#define __CPUID_H__
/**
CPUID Signature Information
@param EAX CPUID_SIGNATURE (0x00)
@retval EAX Returns the highest value the CPUID instruction recognizes for
returning basic processor information. The value is returned is
processor specific.
@retval EBX First 4 characters of a vendor identification string.
@retval ECX Last 4 characters of a vendor identification string.
@retval EDX Middle 4 characters of a vendor identification string.
<b>Example usage</b>
@code
UINT32 Eax;
UINT32 Ebx;
UINT32 Ecx;
UINT32 Edx;
AsmCpuid (CPUID_SIGNATURE, &Eax, &Ebx, &Ecx, &Edx);
@endcode
**/
#define CPUID_SIGNATURE 0x00
///
/// @{ CPUID signature values returned by Intel processors
///
#define CPUID_SIGNATURE_GENUINE_INTEL_EBX SIGNATURE_32 ('G', 'e', 'n', 'u')
#define CPUID_SIGNATURE_GENUINE_INTEL_EDX SIGNATURE_32 ('i', 'n', 'e', 'I')
#define CPUID_SIGNATURE_GENUINE_INTEL_ECX SIGNATURE_32 ('n', 't', 'e', 'l')
///
/// @}
///
/**
CPUID Version Information
@param EAX CPUID_VERSION_INFO (0x01)
@retval EAX Returns Model, Family, Stepping Information described by the
type CPUID_VERSION_INFO_EAX.
@retval EBX Returns Brand, Cache Line Size, and Initial APIC ID described by
the type CPUID_VERSION_INFO_EBX.
@retval ECX CPU Feature Information described by the type
CPUID_VERSION_INFO_ECX.
@retval EDX CPU Feature Information described by the type
CPUID_VERSION_INFO_EDX.
<b>Example usage</b>
@code
CPUID_VERSION_INFO_EAX Eax;
CPUID_VERSION_INFO_EBX Ebx;
CPUID_VERSION_INFO_ECX Ecx;
CPUID_VERSION_INFO_EDX Edx;
AsmCpuid (CPUID_VERSION_INFO, &Eax.Uint32, &Ebx.Uint32, &Ecx.Uint32, &Edx.Uint32);
@endcode
**/
#define CPUID_VERSION_INFO 0x01
/**
CPUID Version Information returned in EAX for CPUID leaf
#CPUID_VERSION_INFO.
**/
typedef union {
///
/// Individual bit fields
///
struct {
UINT32 SteppingId:4; ///< [Bits 3:0] Stepping ID
UINT32 Model:4; ///< [Bits 7:4] Model
UINT32 FamilyId:4; ///< [Bits 11:8] Family
UINT32 ProcessorType:2; ///< [Bits 13:12] Processor Type
UINT32 Reserved1:2; ///< [Bits 15:14] Reserved
UINT32 ExtendedModelId:4; ///< [Bits 19:16] Extended Model ID
UINT32 ExtendedFamilyId:8; ///< [Bits 27:20] Extended Family ID
UINT32 Reserved2:4; ///< Reserved
} Bits;
///
/// All bit fields as a 32-bit value
///
UINT32 Uint32;
} CPUID_VERSION_INFO_EAX;
///
/// @{ Define value for bit field CPUID_VERSION_INFO_EAX.ProcessorType
///
#define CPUID_VERSION_INFO_EAX_PROCESSOR_TYPE_ORIGINAL_OEM_PROCESSOR 0x00
#define CPUID_VERSION_INFO_EAX_PROCESSOR_TYPE_INTEL_OVERDRIVE_PROCESSOR 0x01
#define CPUID_VERSION_INFO_EAX_PROCESSOR_TYPE_DUAL_PROCESSOR 0x02
///
/// @}
///
/**
CPUID Version Information returned in EBX for CPUID leaf
#CPUID_VERSION_INFO.
**/
typedef union {
///
/// Individual bit fields
///
struct {
///
/// [Bits 7:0] Provides an entry into a brand string table that contains
/// brand strings for IA-32 processors.
///
UINT32 BrandIndex:8;
///
/// [Bits 15:8] Indicates the size of the cache line flushed by the CLFLUSH
/// and CLFLUSHOPT instructions in 8-byte increments. This field was
/// introduced in the Pentium 4 processor.
///
UINT32 CacheLineSize:8;
///
/// [Bits 23:16] Maximum number of addressable IDs for logical processors
/// in this physical package.
///
/// @note
/// The nearest power-of-2 integer that is not smaller than EBX[23:16] is
/// the number of unique initial APICIDs reserved for addressing different
/// logical processors in a physical package. This field is only valid if
/// CPUID.1.EDX.HTT[bit 28]= 1.
///
UINT32 MaximumAddressableIdsForLogicalProcessors:8;
///
/// [Bits 31:24] The 8-bit ID that is assigned to the local APIC on the
/// processor during power up. This field was introduced in the Pentium 4
/// processor.
///
UINT32 InitialLocalApicId:8;
} Bits;
///
/// All bit fields as a 32-bit value
///
UINT32 Uint32;
} CPUID_VERSION_INFO_EBX;
/**
CPUID Version Information returned in ECX for CPUID leaf
#CPUID_VERSION_INFO.
**/
typedef union {
///
/// Individual bit fields
///
struct {
///
/// [Bit 0] Streaming SIMD Extensions 3 (SSE3). A value of 1 indicates the
/// processor supports this technology
///
UINT32 SSE3:1;
///
/// [Bit 1] A value of 1 indicates the processor supports the PCLMULQDQ
/// instruction. Carryless Multiplication
///
UINT32 PCLMULQDQ:1;
///
/// [Bit 2] 64-bit DS Area. A value of 1 indicates the processor supports
/// DS area using 64-bit layout.
///
UINT32 DTES64:1;
///
/// [Bit 3] MONITOR/MWAIT. A value of 1 indicates the processor supports
/// this feature.
///
UINT32 MONITOR:1;
///
/// [Bit 4] CPL Qualified Debug Store. A value of 1 indicates the processor
/// supports the extensions to the Debug Store feature to allow for branch
/// message storage qualified by CPL
///
UINT32 DS_CPL:1;
///
/// [Bit 5] Virtual Machine Extensions. A value of 1 indicates that the
/// processor supports this technology.
///
UINT32 VMX:1;
///
/// [Bit 6] Safer Mode Extensions. A value of 1 indicates that the processor
/// supports this technology
///
UINT32 SMX:1;
///
/// [Bit 7] Enhanced Intel SpeedStep(R) technology. A value of 1 indicates
/// that the processor supports this technology
///
UINT32 EIST:1;
///
/// [Bit 8] Thermal Monitor 2. A value of 1 indicates whether the processor
/// supports this technology
///
UINT32 TM2:1;
///
/// [Bit 9] A value of 1 indicates the presence of the Supplemental Streaming
/// SIMD Extensions 3 (SSSE3). A value of 0 indicates the instruction
/// extensions are not present in the processor.
///
UINT32 SSSE3:1;
///
/// [Bit 10] L1 Context ID. A value of 1 indicates the L1 data cache mode
/// can be set to either adaptive mode or shared mode. A value of 0 indicates
/// this feature is not supported. See definition of the IA32_MISC_ENABLE MSR
/// Bit 24 (L1 Data Cache Context Mode) for details
///
UINT32 CNXT_ID:1;
///
/// [Bit 11] A value of 1 indicates the processor supports IA32_DEBUG_INTERFACE
/// MSR for silicon debug
///
UINT32 SDBG:1;
///
/// [Bit 12] A value of 1 indicates the processor supports FMA (Fused Multiple
/// Add) extensions using YMM state.
///
UINT32 FMA:1;
///
/// [Bit 13] CMPXCHG16B Available. A value of 1 indicates that the feature
/// is available.
///
UINT32 CMPXCHG16B:1;
///
/// [Bit 14] xTPR Update Control. A value of 1 indicates that the processor
/// supports changing IA32_MISC_ENABLE[Bit 23].
///
UINT32 xTPR_Update_Control:1;
///
/// [Bit 15] Perfmon and Debug Capability: A value of 1 indicates the
/// processor supports the performance and debug feature indication MSR
/// IA32_PERF_CAPABILITIES.
///
UINT32 PDCM:1;
UINT32 Reserved:1;
///
/// [Bit 17] Process-context identifiers. A value of 1 indicates that the
/// processor supports PCIDs and that software may set CR4.PCIDE to 1.
///
UINT32 PCID:1;
///
/// [Bit 18] A value of 1 indicates the processor supports the ability to
/// prefetch data from a memory mapped device. Direct Cache Access.
///
UINT32 DCA:1;
///
/// [Bit 19] A value of 1 indicates that the processor supports SSE4.1.
///
UINT32 SSE4_1:1;
///
/// [Bit 20] A value of 1 indicates that the processor supports SSE4.2.
///
UINT32 SSE4_2:1;
///
/// [Bit 21] A value of 1 indicates that the processor supports x2APIC
/// feature.
///
UINT32 x2APIC:1;
///
/// [Bit 22] A value of 1 indicates that the processor supports MOVBE
/// instruction.
///
UINT32 MOVBE:1;
///
/// [Bit 23] A value of 1 indicates that the processor supports the POPCNT
/// instruction.
///
UINT32 POPCNT:1;
///
/// [Bit 24] A value of 1 indicates that the processor's local APIC timer
/// supports one-shot operation using a TSC deadline value.
///
UINT32 TSC_Deadline:1;
///
/// [Bit 25] A value of 1 indicates that the processor supports the AESNI
/// instruction extensions.
///
UINT32 AESNI:1;
///
/// [Bit 26] A value of 1 indicates that the processor supports the
/// XSAVE/XRSTOR processor extended states feature, the XSETBV/XGETBV
/// instructions, and XCR0.
///
UINT32 XSAVE:1;
///
/// [Bit 27] A value of 1 indicates that the OS has set CR4.OSXSAVE[Bit 18]
/// to enable XSETBV/XGETBV instructions to access XCR0 and to support
/// processor extended state management using XSAVE/XRSTOR.
///
UINT32 OSXSAVE:1;
///
/// [Bit 28] A value of 1 indicates the processor supports the AVX instruction
/// extensions.
///
UINT32 AVX:1;
///
/// [Bit 29] A value of 1 indicates that processor supports 16-bit
/// floating-point conversion instructions.
///
UINT32 F16C:1;
///
/// [Bit 30] A value of 1 indicates that processor supports RDRAND instruction.
///
UINT32 RDRAND:1;
///
/// [Bit 31] Always returns 0.
///
UINT32 NotUsed:1;
} Bits;
///
/// All bit fields as a 32-bit value
///
UINT32 Uint32;
} CPUID_VERSION_INFO_ECX;
/**
CPUID Version Information returned in EDX for CPUID leaf
#CPUID_VERSION_INFO.
**/
typedef union {
///
/// Individual bit fields
///
struct {
///
/// [Bit 0] Floating Point Unit On-Chip. The processor contains an x87 FPU.
///
UINT32 FPU:1;
///
/// [Bit 1] Virtual 8086 Mode Enhancements. Virtual 8086 mode enhancements,
/// including CR4.VME for controlling the feature, CR4.PVI for protected
/// mode virtual interrupts, software interrupt indirection, expansion of
/// the TSS with the software indirection bitmap, and EFLAGS.VIF and
/// EFLAGS.VIP flags.
///
UINT32 VME:1;
///
/// [Bit 2] Debugging Extensions. Support for I/O breakpoints, including
/// CR4.DE for controlling the feature, and optional trapping of accesses to
/// DR4 and DR5.
///
UINT32 DE:1;
///
/// [Bit 3] Page Size Extension. Large pages of size 4 MByte are supported,
/// including CR4.PSE for controlling the feature, the defined dirty bit in
/// PDE (Page Directory Entries), optional reserved bit trapping in CR3,
/// PDEs, and PTEs.
///
UINT32 PSE:1;
///
/// [Bit 4] Time Stamp Counter. The RDTSC instruction is supported,
/// including CR4.TSD for controlling privilege.
///
UINT32 TSC:1;
///
/// [Bit 5] Model Specific Registers RDMSR and WRMSR Instructions. The
/// RDMSR and WRMSR instructions are supported. Some of the MSRs are
/// implementation dependent.
///
UINT32 MSR:1;
///
/// [Bit 6] Physical Address Extension. Physical addresses greater than 32
/// bits are supported: extended page table entry formats, an extra level in
/// the page translation tables is defined, 2-MByte pages are supported
/// instead of 4 Mbyte pages if PAE bit is 1.
///
UINT32 PAE:1;
///
/// [Bit 7] Machine Check Exception. Exception 18 is defined for Machine
/// Checks, including CR4.MCE for controlling the feature. This feature does
/// not define the model-specific implementations of machine-check error
/// logging, reporting, and processor shutdowns. Machine Check exception
/// handlers may have to depend on processor version to do model specific
/// processing of the exception, or test for the presence of the Machine
/// Check feature.
///
UINT32 MCE:1;
///
/// [Bit 8] CMPXCHG8B Instruction. The compare-and-exchange 8 bytes(64 bits)
/// instruction is supported (implicitly locked and atomic).
///
UINT32 CX8:1;
///
/// [Bit 9] APIC On-Chip. The processor contains an Advanced Programmable
/// Interrupt Controller (APIC), responding to memory mapped commands in the
/// physical address range FFFE0000H to FFFE0FFFH (by default - some
/// processors permit the APIC to be relocated).
///
UINT32 APIC:1;
UINT32 Reserved1:1;
///
/// [Bit 11] SYSENTER and SYSEXIT Instructions. The SYSENTER and SYSEXIT
/// and associated MSRs are supported.
///
UINT32 SEP:1;
///
/// [Bit 12] Memory Type Range Registers. MTRRs are supported. The MTRRcap
/// MSR contains feature bits that describe what memory types are supported,
/// how many variable MTRRs are supported, and whether fixed MTRRs are
/// supported.
///
UINT32 MTRR:1;
///
/// [Bit 13] Page Global Bit. The global bit is supported in paging-structure
/// entries that map a page, indicating TLB entries that are common to
/// different processes and need not be flushed. The CR4.PGE bit controls
/// this feature.
///
UINT32 PGE:1;
///
/// [Bit 14] Machine Check Architecture. A value of 1 indicates the Machine
/// Check Architecture of reporting machine errors is supported. The MCG_CAP
/// MSR contains feature bits describing how many banks of error reporting
/// MSRs are supported.
///
UINT32 MCA:1;
///
/// [Bit 15] Conditional Move Instructions. The conditional move instruction
/// CMOV is supported. In addition, if x87 FPU is present as indicated by the
/// CPUID.FPU feature bit, then the FCOMI and FCMOV instructions are supported.
///
UINT32 CMOV:1;
///
/// [Bit 16] Page Attribute Table. Page Attribute Table is supported. This
/// feature augments the Memory Type Range Registers (MTRRs), allowing an
/// operating system to specify attributes of memory accessed through a
/// linear address on a 4KB granularity.
///
UINT32 PAT:1;
///
/// [Bit 17] 36-Bit Page Size Extension. 4-MByte pages addressing physical
/// memory beyond 4 GBytes are supported with 32-bit paging. This feature
/// indicates that upper bits of the physical address of a 4-MByte page are
/// encoded in bits 20:13 of the page-directory entry. Such physical
/// addresses are limited by MAXPHYADDR and may be up to 40 bits in size.
///
UINT32 PSE_36:1;
///
/// [Bit 18] Processor Serial Number. The processor supports the 96-bit
/// processor identification number feature and the feature is enabled.
///
UINT32 PSN:1;
///
/// [Bit 19] CLFLUSH Instruction. CLFLUSH Instruction is supported.
///
UINT32 CLFSH:1;
UINT32 Reserved2:1;
///
/// [Bit 21] Debug Store. The processor supports the ability to write debug
/// information into a memory resident buffer. This feature is used by the
/// branch trace store (BTS) and precise event-based sampling (PEBS)
/// facilities.
///
UINT32 DS:1;
///
/// [Bit 22] Thermal Monitor and Software Controlled Clock Facilities. The
/// processor implements internal MSRs that allow processor temperature to
/// be monitored and processor performance to be modulated in predefined
/// duty cycles under software control.
///
UINT32 ACPI:1;
///
/// [Bit 23] Intel MMX Technology. The processor supports the Intel MMX
/// technology.
///
UINT32 MMX:1;
///
/// [Bit 24] FXSAVE and FXRSTOR Instructions. The FXSAVE and FXRSTOR
/// instructions are supported for fast save and restore of the floating
/// point context. Presence of this bit also indicates that CR4.OSFXSR is
/// available for an operating system to indicate that it supports the
/// FXSAVE and FXRSTOR instructions.
///
UINT32 FXSR:1;
///
/// [Bit 25] SSE. The processor supports the SSE extensions.
///
UINT32 SSE:1;
///
/// [Bit 26] SSE2. The processor supports the SSE2 extensions.
///
UINT32 SSE2:1;
///
/// [Bit 27] Self Snoop. The processor supports the management of
/// conflicting memory types by performing a snoop of its own cache
/// structure for transactions issued to the bus.
///
UINT32 SS:1;
///
/// [Bit 28] Max APIC IDs reserved field is Valid. A value of 0 for HTT
/// indicates there is only a single logical processor in the package and
/// software should assume only a single APIC ID is reserved. A value of 1
/// for HTT indicates the value in CPUID.1.EBX[23:16] (the Maximum number of
/// addressable IDs for logical processors in this package) is valid for the
/// package.
///
UINT32 HTT:1;
///
/// [Bit 29] Thermal Monitor. The processor implements the thermal monitor
/// automatic thermal control circuitry (TCC).
///
UINT32 TM:1;
UINT32 Reserved3:1;
///
/// [Bit 31] Pending Break Enable. The processor supports the use of the
/// FERR#/PBE# pin when the processor is in the stop-clock state (STPCLK# is
/// asserted) to signal the processor that an interrupt is pending and that
/// the processor should return to normal operation to handle the interrupt.
/// Bit 10 (PBE enable) in the IA32_MISC_ENABLE MSR enables this capability.
///
UINT32 PBE:1;
} Bits;
///
/// All bit fields as a 32-bit value
///
UINT32 Uint32;
} CPUID_VERSION_INFO_EDX;
/**
CPUID Cache and TLB Information
@param EAX CPUID_CACHE_INFO (0x02)
@retval EAX Cache and TLB Information described by the type
CPUID_CACHE_INFO_CACHE_TLB.
CPUID_CACHE_INFO_CACHE_TLB.CacheDescriptor[0] always returns
0x01 and must be ignored. Only valid if
CPUID_CACHE_INFO_CACHE_TLB.Bits.NotValid is clear.
@retval EBX Cache and TLB Information described by the type
CPUID_CACHE_INFO_CACHE_TLB. Only valid if
CPUID_CACHE_INFO_CACHE_TLB.Bits.NotValid is clear.
@retval ECX Cache and TLB Information described by the type
CPUID_CACHE_INFO_CACHE_TLB. Only valid if
CPUID_CACHE_INFO_CACHE_TLB.Bits.NotValid is clear.
@retval EDX Cache and TLB Information described by the type
CPUID_CACHE_INFO_CACHE_TLB. Only valid if
CPUID_CACHE_INFO_CACHE_TLB.Bits.NotValid is clear.
<b>Example usage</b>
@code
CPUID_CACHE_INFO_CACHE_TLB Eax;
CPUID_CACHE_INFO_CACHE_TLB Ebx;
CPUID_CACHE_INFO_CACHE_TLB Ecx;
CPUID_CACHE_INFO_CACHE_TLB Edx;
AsmCpuid (CPUID_CACHE_INFO, &Eax.Uint32, &Ebx.Uint32, &Ecx.Uint32, &Edx.Uint32);
@endcode
<b>Cache Descriptor values</b>
<table>
<tr><th>Value </th><th> Type </th><th> Description </th></tr>
<tr><td> 0x00 </td><td> General </td><td> Null descriptor, this byte contains no information</td></tr>
<tr><td> 0x01 </td><td> TLB </td><td> Instruction TLB: 4 KByte pages, 4-way set associative, 32 entries</td></tr>
<tr><td> 0x02 </td><td> TLB </td><td> Instruction TLB: 4 MByte pages, fully associative, 2 entries</td></tr>
<tr><td> 0x03 </td><td> TLB </td><td> Data TLB: 4 KByte pages, 4-way set associative, 64 entries</td></tr>
<tr><td> 0x04 </td><td> TLB </td><td> Data TLB: 4 MByte pages, 4-way set associative, 8 entries</td></tr>
<tr><td> 0x05 </td><td> TLB </td><td> Data TLB1: 4 MByte pages, 4-way set associative, 32 entries</td></tr>
<tr><td> 0x06 </td><td> Cache </td><td> 1st-level instruction cache: 8 KBytes, 4-way set associative,
32 byte line size</td></tr>
<tr><td> 0x08 </td><td> Cache </td><td> 1st-level instruction cache: 16 KBytes, 4-way set associative,
32 byte line size</td></tr>
<tr><td> 0x09 </td><td> Cache </td><td> 1st-level instruction cache: 32KBytes, 4-way set associative,
64 byte line size</td></tr>
<tr><td> 0x0A </td><td> Cache </td><td> 1st-level data cache: 8 KBytes, 2-way set associative, 32 byte line size</td></tr>
<tr><td> 0x0B </td><td> TLB </td><td> Instruction TLB: 4 MByte pages, 4-way set associative, 4 entries</td></tr>
<tr><td> 0x0C </td><td> Cache </td><td> 1st-level data cache: 16 KBytes, 4-way set associative, 32 byte line size</td></tr>
<tr><td> 0x0D </td><td> Cache </td><td> 1st-level data cache: 16 KBytes, 4-way set associative, 64 byte line size</td></tr>
<tr><td> 0x0E </td><td> Cache </td><td> 1st-level data cache: 24 KBytes, 6-way set associative, 64 byte line size</td></tr>
<tr><td> 0x1D </td><td> Cache </td><td> 2nd-level cache: 128 KBytes, 2-way set associative, 64 byte line size</td></tr>
<tr><td> 0x21 </td><td> Cache </td><td> 2nd-level cache: 256 KBytes, 8-way set associative, 64 byte line size</td></tr>
<tr><td> 0x22 </td><td> Cache </td><td> 3rd-level cache: 512 KBytes, 4-way set associative, 64 byte line size,
2 lines per sector</td></tr>
<tr><td> 0x23 </td><td> Cache </td><td> 3rd-level cache: 1 MBytes, 8-way set associative, 64 byte line size,
2 lines per sector</td></tr>
<tr><td> 0x24 </td><td> Cache </td><td> 2nd-level cache: 1 MBytes, 16-way set associative, 64 byte line size</td></tr>
<tr><td> 0x25 </td><td> Cache </td><td> 3rd-level cache: 2 MBytes, 8-way set associative, 64 byte line size,
2 lines per sector</td></tr>
<tr><td> 0x29 </td><td> Cache </td><td> 3rd-level cache: 4 MBytes, 8-way set associative, 64 byte line size,
2 lines per sector</td></tr>
<tr><td> 0x2C </td><td> Cache </td><td> 1st-level data cache: 32 KBytes, 8-way set associative,
64 byte line size</td></tr>
<tr><td> 0x30 </td><td> Cache </td><td> 1st-level instruction cache: 32 KBytes, 8-way set associative,
64 byte line size</td></tr>
<tr><td> 0x40 </td><td> Cache </td><td> No 2nd-level cache or, if processor contains a valid 2nd-level cache,
no 3rd-level cache</td></tr>
<tr><td> 0x41 </td><td> Cache </td><td> 2nd-level cache: 128 KBytes, 4-way set associative, 32 byte line size</td></tr>
<tr><td> 0x42 </td><td> Cache </td><td> 2nd-level cache: 256 KBytes, 4-way set associative, 32 byte line size</td></tr>
<tr><td> 0x43 </td><td> Cache </td><td> 2nd-level cache: 512 KBytes, 4-way set associative, 32 byte line size</td></tr>
<tr><td> 0x44 </td><td> Cache </td><td> 2nd-level cache: 1 MByte, 4-way set associative, 32 byte line size</td></tr>
<tr><td> 0x45 </td><td> Cache </td><td> 2nd-level cache: 2 MByte, 4-way set associative, 32 byte line size</td></tr>
<tr><td> 0x46 </td><td> Cache </td><td> 3rd-level cache: 4 MByte, 4-way set associative, 64 byte line size</td></tr>
<tr><td> 0x47 </td><td> Cache </td><td> 3rd-level cache: 8 MByte, 8-way set associative, 64 byte line size</td></tr>
<tr><td> 0x48 </td><td> Cache </td><td> 2nd-level cache: 3MByte, 12-way set associative, 64 byte line size</td></tr>
<tr><td> 0x49 </td><td> Cache </td><td> 3rd-level cache: 4MB, 16-way set associative, 64-byte line size
(Intel Xeon processor MP, Family 0FH, Model 06H)<BR>
2nd-level cache: 4 MByte, 16-way set associative, 64 byte line size</td></tr>
<tr><td> 0x4A </td><td> Cache </td><td> 3rd-level cache: 6MByte, 12-way set associative, 64 byte line size</td></tr>
<tr><td> 0x4B </td><td> Cache </td><td> 3rd-level cache: 8MByte, 16-way set associative, 64 byte line size</td></tr>
<tr><td> 0x4C </td><td> Cache </td><td> 3rd-level cache: 12MByte, 12-way set associative, 64 byte line size</td></tr>
<tr><td> 0x4D </td><td> Cache </td><td> 3rd-level cache: 16MByte, 16-way set associative, 64 byte line size</td></tr>
<tr><td> 0x4E </td><td> Cache </td><td> 2nd-level cache: 6MByte, 24-way set associative, 64 byte line size</td></tr>
<tr><td> 0x4F </td><td> TLB </td><td> Instruction TLB: 4 KByte pages, 32 entries</td></tr>
<tr><td> 0x50 </td><td> TLB </td><td> Instruction TLB: 4 KByte and 2-MByte or 4-MByte pages, 64 entries</td></tr>
<tr><td> 0x51 </td><td> TLB </td><td> Instruction TLB: 4 KByte and 2-MByte or 4-MByte pages, 128 entries</td></tr>
<tr><td> 0x52 </td><td> TLB </td><td> Instruction TLB: 4 KByte and 2-MByte or 4-MByte pages, 256 entries</td></tr>
<tr><td> 0x55 </td><td> TLB </td><td> Instruction TLB: 2-MByte or 4-MByte pages, fully associative, 7 entries</td></tr>
<tr><td> 0x56 </td><td> TLB </td><td> Data TLB0: 4 MByte pages, 4-way set associative, 16 entries</td></tr>
<tr><td> 0x57 </td><td> TLB </td><td> Data TLB0: 4 KByte pages, 4-way associative, 16 entries</td></tr>
<tr><td> 0x59 </td><td> TLB </td><td> Data TLB0: 4 KByte pages, fully associative, 16 entries</td></tr>
<tr><td> 0x5A </td><td> TLB </td><td> Data TLB0: 2 MByte or 4 MByte pages, 4-way set associative, 32 entries</td></tr>
<tr><td> 0x5B </td><td> TLB </td><td> Data TLB: 4 KByte and 4 MByte pages, 64 entries</td></tr>
<tr><td> 0x5C </td><td> TLB </td><td> Data TLB: 4 KByte and 4 MByte pages,128 entries</td></tr>
<tr><td> 0x5D </td><td> TLB </td><td> Data TLB: 4 KByte and 4 MByte pages,256 entries</td></tr>
<tr><td> 0x60 </td><td> Cache </td><td> 1st-level data cache: 16 KByte, 8-way set associative, 64 byte line size</td></tr>
<tr><td> 0x61 </td><td> TLB </td><td> Instruction TLB: 4 KByte pages, fully associative, 48 entries</td></tr>
<tr><td> 0x63 </td><td> TLB </td><td> Data TLB: 2 MByte or 4 MByte pages, 4-way set associative,
32 entries and a separate array with 1 GByte pages, 4-way set associative,
4 entries</td></tr>
<tr><td> 0x64 </td><td> TLB </td><td> Data TLB: 4 KByte pages, 4-way set associative, 512 entries</td></tr>
<tr><td> 0x66 </td><td> Cache </td><td> 1st-level data cache: 8 KByte, 4-way set associative, 64 byte line size</td></tr>
<tr><td> 0x67 </td><td> Cache </td><td> 1st-level data cache: 16 KByte, 4-way set associative, 64 byte line size</td></tr>
<tr><td> 0x68 </td><td> Cache </td><td> 1st-level data cache: 32 KByte, 4-way set associative, 64 byte line size</td></tr>
<tr><td> 0x6A </td><td> Cache </td><td> uTLB: 4 KByte pages, 8-way set associative, 64 entries</td></tr>
<tr><td> 0x6B </td><td> Cache </td><td> DTLB: 4 KByte pages, 8-way set associative, 256 entries</td></tr>
<tr><td> 0x6C </td><td> Cache </td><td> DTLB: 2M/4M pages, 8-way set associative, 128 entries</td></tr>
<tr><td> 0x6D </td><td> Cache </td><td> DTLB: 1 GByte pages, fully associative, 16 entries</td></tr>
<tr><td> 0x70 </td><td> Cache </td><td> Trace cache: 12 K-uop, 8-way set associative</td></tr>
<tr><td> 0x71 </td><td> Cache </td><td> Trace cache: 16 K-uop, 8-way set associative</td></tr>
<tr><td> 0x72 </td><td> Cache </td><td> Trace cache: 32 K-uop, 8-way set associative</td></tr>
<tr><td> 0x76 </td><td> TLB </td><td> Instruction TLB: 2M/4M pages, fully associative, 8 entries</td></tr>
<tr><td> 0x78 </td><td> Cache </td><td> 2nd-level cache: 1 MByte, 4-way set associative, 64byte line size</td></tr>
<tr><td> 0x79 </td><td> Cache </td><td> 2nd-level cache: 128 KByte, 8-way set associative, 64 byte line size,
2 lines per sector</td></tr>
<tr><td> 0x7A </td><td> Cache </td><td> 2nd-level cache: 256 KByte, 8-way set associative, 64 byte line size,
2 lines per sector</td></tr>
<tr><td> 0x7B </td><td> Cache </td><td> 2nd-level cache: 512 KByte, 8-way set associative, 64 byte line size,
2 lines per sector</td></tr>
<tr><td> 0x7C </td><td> Cache </td><td> 2nd-level cache: 1 MByte, 8-way set associative, 64 byte line size,
2 lines per sector</td></tr>
<tr><td> 0x7D </td><td> Cache </td><td> 2nd-level cache: 2 MByte, 8-way set associative, 64byte line size</td></tr>
<tr><td> 0x7F </td><td> Cache </td><td> 2nd-level cache: 512 KByte, 2-way set associative, 64-byte line size</td></tr>
<tr><td> 0x80 </td><td> Cache </td><td> 2nd-level cache: 512 KByte, 8-way set associative, 64-byte line size</td></tr>
<tr><td> 0x82 </td><td> Cache </td><td> 2nd-level cache: 256 KByte, 8-way set associative, 32 byte line size</td></tr>
<tr><td> 0x83 </td><td> Cache </td><td> 2nd-level cache: 512 KByte, 8-way set associative, 32 byte line size</td></tr>
<tr><td> 0x84 </td><td> Cache </td><td> 2nd-level cache: 1 MByte, 8-way set associative, 32 byte line size</td></tr>
<tr><td> 0x85 </td><td> Cache </td><td> 2nd-level cache: 2 MByte, 8-way set associative, 32 byte line size</td></tr>
<tr><td> 0x86 </td><td> Cache </td><td> 2nd-level cache: 512 KByte, 4-way set associative, 64 byte line size</td></tr>
<tr><td> 0x87 </td><td> Cache </td><td> 2nd-level cache: 1 MByte, 8-way set associative, 64 byte line size</td></tr>
<tr><td> 0xA0 </td><td> DTLB </td><td> DTLB: 4k pages, fully associative, 32 entries</td></tr>
<tr><td> 0xB0 </td><td> TLB </td><td> Instruction TLB: 4 KByte pages, 4-way set associative, 128 entries</td></tr>
<tr><td> 0xB1 </td><td> TLB </td><td> Instruction TLB: 2M pages, 4-way, 8 entries or 4M pages, 4-way, 4 entries</td></tr>
<tr><td> 0xB2 </td><td> TLB </td><td> Instruction TLB: 4KByte pages, 4-way set associative, 64 entries</td></tr>
<tr><td> 0xB3 </td><td> TLB </td><td> Data TLB: 4 KByte pages, 4-way set associative, 128 entries</td></tr>
<tr><td> 0xB4 </td><td> TLB </td><td> Data TLB1: 4 KByte pages, 4-way associative, 256 entries</td></tr>
<tr><td> 0xB5 </td><td> TLB </td><td> Instruction TLB: 4KByte pages, 8-way set associative, 64 entries</td></tr>
<tr><td> 0xB6 </td><td> TLB </td><td> Instruction TLB: 4KByte pages, 8-way set associative,
128 entries</td></tr>
<tr><td> 0xBA </td><td> TLB </td><td> Data TLB1: 4 KByte pages, 4-way associative, 64 entries</td></tr>
<tr><td> 0xC0 </td><td> TLB </td><td> Data TLB: 4 KByte and 4 MByte pages, 4-way associative, 8 entries</td></tr>
<tr><td> 0xC1 </td><td> STLB </td><td> Shared 2nd-Level TLB: 4 KByte/2MByte pages, 8-way associative,
1024 entries</td></tr>
<tr><td> 0xC2 </td><td> DTLB </td><td> DTLB: 4 KByte/2 MByte pages, 4-way associative, 16 entries</td></tr>
<tr><td> 0xC3 </td><td> STLB </td><td> Shared 2nd-Level TLB: 4 KByte /2 MByte pages, 6-way associative,
1536 entries. Also 1GBbyte pages, 4-way, 16 entries.</td></tr>
<tr><td> 0xC4 </td><td> DTLB </td><td> DTLB: 2M/4M Byte pages, 4-way associative, 32 entries</td></tr>
<tr><td> 0xCA </td><td> STLB </td><td> Shared 2nd-Level TLB: 4 KByte pages, 4-way associative, 512 entries</td></tr>
<tr><td> 0xD0 </td><td> Cache </td><td> 3rd-level cache: 512 KByte, 4-way set associative, 64 byte line size</td></tr>
<tr><td> 0xD1 </td><td> Cache </td><td> 3rd-level cache: 1 MByte, 4-way set associative, 64 byte line size</td></tr>
<tr><td> 0xD2 </td><td> Cache </td><td> 3rd-level cache: 2 MByte, 4-way set associative, 64 byte line size</td></tr>
<tr><td> 0xD6 </td><td> Cache </td><td> 3rd-level cache: 1 MByte, 8-way set associative, 64 byte line size</td></tr>
<tr><td> 0xD7 </td><td> Cache </td><td> 3rd-level cache: 2 MByte, 8-way set associative, 64 byte line size</td></tr>
<tr><td> 0xD8 </td><td> Cache </td><td> 3rd-level cache: 4 MByte, 8-way set associative, 64 byte line size</td></tr>
<tr><td> 0xDC </td><td> Cache </td><td> 3rd-level cache: 1.5 MByte, 12-way set associative, 64 byte line size</td></tr>
<tr><td> 0xDD </td><td> Cache </td><td> 3rd-level cache: 3 MByte, 12-way set associative, 64 byte line size</td></tr>
<tr><td> 0xDE </td><td> Cache </td><td> 3rd-level cache: 6 MByte, 12-way set associative, 64 byte line size</td></tr>
<tr><td> 0xE2 </td><td> Cache </td><td> 3rd-level cache: 2 MByte, 16-way set associative, 64 byte line size</td></tr>
<tr><td> 0xE3 </td><td> Cache </td><td> 3rd-level cache: 4 MByte, 16-way set associative, 64 byte line size</td></tr>
<tr><td> 0xE4 </td><td> Cache </td><td> 3rd-level cache: 8 MByte, 16-way set associative, 64 byte line size</td></tr>
<tr><td> 0xEA </td><td> Cache </td><td> 3rd-level cache: 12MByte, 24-way set associative, 64 byte line size</td></tr>
<tr><td> 0xEB </td><td> Cache </td><td> 3rd-level cache: 18MByte, 24-way set associative, 64 byte line size</td></tr>
<tr><td> 0xEC </td><td> Cache </td><td> 3rd-level cache: 24MByte, 24-way set associative, 64 byte line size</td></tr>
<tr><td> 0xF0 </td><td> Prefetch</td><td> 64-Byte prefetching</td></tr>
<tr><td> 0xF1 </td><td> Prefetch</td><td> 128-Byte prefetching</td></tr>
<tr><td> 0xFE </td><td> General </td><td> CPUID leaf 2 does not report TLB descriptor information; use CPUID
leaf 18H to query TLB and other address translation parameters.</td></tr>
<tr><td> 0xFF </td><td> General </td><td> CPUID leaf 2 does not report cache descriptor information,
use CPUID leaf 4 to query cache parameters</td></tr>
</table>
**/
#define CPUID_CACHE_INFO 0x02
/**
CPUID Cache and TLB Information returned in EAX, EBX, ECX, and EDX for CPUID
leaf #CPUID_CACHE_INFO.
**/
typedef union {
///
/// Individual bit fields
///
struct {
UINT32 Reserved:31;
///
/// [Bit 31] If 0, then the cache descriptor bytes in the register are valid.
/// if 1, then none of the cache descriptor bytes in the register are valid.
///
UINT32 NotValid:1;
} Bits;
///
/// Array of Cache and TLB descriptor bytes
///
UINT8 CacheDescriptor[4];
///
/// All bit fields as a 32-bit value
///
UINT32 Uint32;
} CPUID_CACHE_INFO_CACHE_TLB;
/**
CPUID Processor Serial Number
Processor serial number (PSN) is not supported in the Pentium 4 processor
or later. On all models, use the PSN flag (returned using CPUID) to check
for PSN support before accessing the feature.
@param EAX CPUID_SERIAL_NUMBER (0x03)
@retval EAX Reserved.
@retval EBX Reserved.
@retval ECX Bits 31:0 of 96 bit processor serial number. (Available in
Pentium III processor only; otherwise, the value in this
register is reserved.)
@retval EDX Bits 63:32 of 96 bit processor serial number. (Available in
Pentium III processor only; otherwise, the value in this
register is reserved.)
<b>Example usage</b>
@code
UINT32 Ecx;
UINT32 Edx;
AsmCpuid (CPUID_SERIAL_NUMBER, NULL, NULL, &Ecx, &Edx);
@endcode
**/
#define CPUID_SERIAL_NUMBER 0x03
/**
CPUID Cache Parameters
@param EAX CPUID_CACHE_PARAMS (0x04)
@param ECX Cache Level. Valid values start at 0. Software can enumerate
the deterministic cache parameters for each level of the cache
hierarchy starting with an index value of 0, until the
parameters report the value associated with the CacheType
field in CPUID_CACHE_PARAMS_EAX is 0.
@retval EAX Returns cache type information described by the type
CPUID_CACHE_PARAMS_EAX.
@retval EBX Returns cache line and associativity information described by
the type CPUID_CACHE_PARAMS_EBX.
@retval ECX Returns the number of sets in the cache.
@retval EDX Returns cache WINVD/INVD behavior described by the type
CPUID_CACHE_PARAMS_EDX.
<b>Example usage</b>
@code
UINT32 CacheLevel;
CPUID_CACHE_PARAMS_EAX Eax;
CPUID_CACHE_PARAMS_EBX Ebx;
UINT32 Ecx;
CPUID_CACHE_PARAMS_EDX Edx;
CacheLevel = 0;
do {
AsmCpuidEx (
CPUID_CACHE_PARAMS, CacheLevel,
&Eax.Uint32, &Ebx.Uint32, &Ecx, &Edx.Uint32
);
CacheLevel++;
} while (Eax.Bits.CacheType != CPUID_CACHE_PARAMS_CACHE_TYPE_NULL);
@endcode
**/
#define CPUID_CACHE_PARAMS 0x04
/**
CPUID Cache Parameters Information returned in EAX for CPUID leaf
#CPUID_CACHE_PARAMS.
**/
typedef union {
///
/// Individual bit fields
///
struct {
///
/// [Bits 4:0] Cache type field. If #CPUID_CACHE_PARAMS_CACHE_TYPE_NULL,
/// then there is no information for the requested cache level.
///
UINT32 CacheType:5;
///
/// [Bits 7:5] Cache level (Starts at 1).
///
UINT32 CacheLevel:3;
///
/// [Bit 8] Self Initializing cache level (does not need SW initialization).
///
UINT32 SelfInitializingCache:1;
///
/// [Bit 9] Fully Associative cache.
///
UINT32 FullyAssociativeCache:1;
///
/// [Bits 13:10] Reserved.
///
UINT32 Reserved:4;
///
/// [Bits 25:14] Maximum number of addressable IDs for logical processors
/// sharing this cache.
///
/// Add one to the return value to get the result.
/// The nearest power-of-2 integer that is not smaller than (1 + EAX[25:14])
/// is the number of unique initial APIC IDs reserved for addressing
/// different logical processors sharing this cache.
///
UINT32 MaximumAddressableIdsForLogicalProcessors:12;
///
/// [Bits 31:26] Maximum number of addressable IDs for processor cores in
/// the physical package.
///
/// The nearest power-of-2 integer that is not smaller than (1 + EAX[31:26])
/// is the number of unique Core_IDs reserved for addressing different
/// processor cores in a physical package. Core ID is a subset of bits of
/// the initial APIC ID.
/// The returned value is constant for valid initial values in ECX. Valid
/// ECX values start from 0.
///
UINT32 MaximumAddressableIdsForProcessorCores:6;
} Bits;
///
/// All bit fields as a 32-bit value
///
UINT32 Uint32;
} CPUID_CACHE_PARAMS_EAX;
///
/// @{ Define value for bit field CPUID_CACHE_PARAMS_EAX.CacheType
///
#define CPUID_CACHE_PARAMS_CACHE_TYPE_NULL 0x00
#define CPUID_CACHE_PARAMS_CACHE_TYPE_DATA 0x01
#define CPUID_CACHE_PARAMS_CACHE_TYPE_INSTRUCTION 0x02
#define CPUID_CACHE_PARAMS_CACHE_TYPE_UNIFIED 0x03
///
/// @}
///
/**
CPUID Cache Parameters Information returned in EBX for CPUID leaf
#CPUID_CACHE_PARAMS.
**/
typedef union {
///
/// Individual bit fields
///
struct {
///
/// [Bits 11:0] System Coherency Line Size. Add one to the return value to
/// get the result.
///
UINT32 LineSize:12;
///
/// [Bits 21:12] Physical Line Partitions. Add one to the return value to
/// get the result.
///
UINT32 LinePartitions:10;
///
/// [Bits 31:22] Ways of associativity. Add one to the return value to get
/// the result.
///
UINT32 Ways:10;
} Bits;
///
/// All bit fields as a 32-bit value
///
UINT32 Uint32;
} CPUID_CACHE_PARAMS_EBX;
/**
CPUID Cache Parameters Information returned in EDX for CPUID leaf
#CPUID_CACHE_PARAMS.
**/
typedef union {
///
/// Individual bit fields
///
struct {
///
/// [Bit 0] Write-Back Invalidate/Invalidate.
/// 0 = WBINVD/INVD from threads sharing this cache acts upon lower level
/// caches for threads sharing this cache.
/// 1 = WBINVD/INVD is not guaranteed to act upon lower level caches of
/// non-originating threads sharing this cache.
///
UINT32 Invalidate:1;
///
/// [Bit 1] Cache Inclusiveness.
/// 0 = Cache is not inclusive of lower cache levels.
/// 1 = Cache is inclusive of lower cache levels.
///
UINT32 CacheInclusiveness:1;
///
/// [Bit 2] Complex Cache Indexing.
/// 0 = Direct mapped cache.
/// 1 = A complex function is used to index the cache, potentially using all
/// address bits.
///
UINT32 ComplexCacheIndexing:1;
UINT32 Reserved:29;
} Bits;
///
/// All bit fields as a 32-bit value
///
UINT32 Uint32;
} CPUID_CACHE_PARAMS_EDX;
/**
CPUID MONITOR/MWAIT Information
@param EAX CPUID_MONITOR_MWAIT (0x05)
@retval EAX Smallest monitor-line size in bytes described by the type
CPUID_MONITOR_MWAIT_EAX.
@retval EBX Largest monitor-line size in bytes described by the type
CPUID_MONITOR_MWAIT_EBX.
@retval ECX Enumeration of Monitor-Mwait extensions support described by
the type CPUID_MONITOR_MWAIT_ECX.
@retval EDX Sub C-states supported described by the type
CPUID_MONITOR_MWAIT_EDX.
<b>Example usage</b>
@code
CPUID_MONITOR_MWAIT_EAX Eax;
CPUID_MONITOR_MWAIT_EBX Ebx;
CPUID_MONITOR_MWAIT_ECX Ecx;
CPUID_MONITOR_MWAIT_EDX Edx;
AsmCpuid (CPUID_MONITOR_MWAIT, &Eax.Uint32, &Ebx.Uint32, &Ecx.Uint32, &Edx.Uint32);
@endcode
**/
#define CPUID_MONITOR_MWAIT 0x05
/**
CPUID MONITOR/MWAIT Information returned in EAX for CPUID leaf
#CPUID_MONITOR_MWAIT.
**/
typedef union {
///
/// Individual bit fields
///
struct {
///
/// [Bits 15:0] Smallest monitor-line size in bytes (default is processor's
/// monitor granularity).
///
UINT32 SmallestMonitorLineSize:16;
UINT32 Reserved:16;
} Bits;
///
/// All bit fields as a 32-bit value
///
UINT32 Uint32;
} CPUID_MONITOR_MWAIT_EAX;
/**
CPUID MONITOR/MWAIT Information returned in EBX for CPUID leaf
#CPUID_MONITOR_MWAIT.
**/
typedef union {
///
/// Individual bit fields
///
struct {
///
/// [Bits 15:0] Largest monitor-line size in bytes (default is processor's
/// monitor granularity).
///
UINT32 LargestMonitorLineSize:16;
UINT32 Reserved:16;
} Bits;
///
/// All bit fields as a 32-bit value
///
UINT32 Uint32;
} CPUID_MONITOR_MWAIT_EBX;
/**
CPUID MONITOR/MWAIT Information returned in ECX for CPUID leaf
#CPUID_MONITOR_MWAIT.
**/
typedef union {
///
/// Individual bit fields
///
struct {
///
/// [Bit 0] If 0, then only EAX and EBX are valid. If 1, then EAX, EBX, ECX,
/// and EDX are valid.
///
UINT32 ExtensionsSupported:1;
///
/// [Bit 1] Supports treating interrupts as break-event for MWAIT, even when
/// interrupts disabled.
///
UINT32 InterruptAsBreak:1;
UINT32 Reserved:30;
} Bits;
///
/// All bit fields as a 32-bit value
///
UINT32 Uint32;
} CPUID_MONITOR_MWAIT_ECX;
/**
CPUID MONITOR/MWAIT Information returned in EDX for CPUID leaf
#CPUID_MONITOR_MWAIT.
@note
The definition of C0 through C7 states for MWAIT extension are
processor-specific C-states, not ACPI C-states.
**/
typedef union {
///
/// Individual bit fields
///
struct {
///
/// [Bits 3:0] Number of C0 sub C-states supported using MWAIT.
///
UINT32 C0States:4;
///
/// [Bits 7:4] Number of C1 sub C-states supported using MWAIT.
///
UINT32 C1States:4;
///
/// [Bits 11:8] Number of C2 sub C-states supported using MWAIT.
///
UINT32 C2States:4;
///
/// [Bits 15:12] Number of C3 sub C-states supported using MWAIT.
///
UINT32 C3States:4;
///
/// [Bits 19:16] Number of C4 sub C-states supported using MWAIT.
///
UINT32 C4States:4;
///
/// [Bits 23:20] Number of C5 sub C-states supported using MWAIT.
///
UINT32 C5States:4;
///
/// [Bits 27:24] Number of C6 sub C-states supported using MWAIT.
///
UINT32 C6States:4;
///
/// [Bits 31:28] Number of C7 sub C-states supported using MWAIT.
///
UINT32 C7States:4;
} Bits;
///
/// All bit fields as a 32-bit value
///
UINT32 Uint32;
} CPUID_MONITOR_MWAIT_EDX;
/**
CPUID Thermal and Power Management
@param EAX CPUID_THERMAL_POWER_MANAGEMENT (0x06)
@retval EAX Thermal and power management features described by the type
CPUID_THERMAL_POWER_MANAGEMENT_EAX.
@retval EBX Number of Interrupt Thresholds in Digital Thermal Sensor
described by the type CPUID_THERMAL_POWER_MANAGEMENT_EBX.
@retval ECX Performance features described by the type
CPUID_THERMAL_POWER_MANAGEMENT_ECX.
@retval EDX Reserved.
<b>Example usage</b>
@code
CPUID_THERMAL_POWER_MANAGEMENT_EAX Eax;
CPUID_THERMAL_POWER_MANAGEMENT_EBX Ebx;
CPUID_THERMAL_POWER_MANAGEMENT_ECX Ecx;
AsmCpuid (CPUID_THERMAL_POWER_MANAGEMENT, &Eax.Uint32, &Ebx.Uint32, &Ecx.Uint32, NULL);
@endcode
**/
#define CPUID_THERMAL_POWER_MANAGEMENT 0x06
/**
CPUID Thermal and Power Management Information returned in EAX for CPUID leaf
#CPUID_THERMAL_POWER_MANAGEMENT.
**/
typedef union {
///
/// Individual bit fields
///
struct {
///
/// [Bit 0] Digital temperature sensor is supported if set.
///
UINT32 DigitalTemperatureSensor:1;
///
/// [Bit 1] Intel Turbo Boost Technology Available (see IA32_MISC_ENABLE[38]).
///
UINT32 TurboBoostTechnology:1;
///
/// [Bit 2] APIC-Timer-always-running feature is supported if set.
///
UINT32 ARAT:1;
UINT32 Reserved1:1;
///
/// [Bit 4] Power limit notification controls are supported if set.
///
UINT32 PLN:1;
///
/// [Bit 5] Clock modulation duty cycle extension is supported if set.
///
UINT32 ECMD:1;
///
/// [Bit 6] Package thermal management is supported if set.
///
UINT32 PTM:1;
///
/// [Bit 7] HWP base registers (IA32_PM_ENABLE[Bit 0], IA32_HWP_CAPABILITIES,
/// IA32_HWP_REQUEST, IA32_HWP_STATUS) are supported if set.
///
UINT32 HWP:1;
///
/// [Bit 8] IA32_HWP_INTERRUPT MSR is supported if set.
///
UINT32 HWP_Notification:1;
///
/// [Bit 9] IA32_HWP_REQUEST[Bits 41:32] is supported if set.
///
UINT32 HWP_Activity_Window:1;
///
/// [Bit 10] IA32_HWP_REQUEST[Bits 31:24] is supported if set.
///
UINT32 HWP_Energy_Performance_Preference:1;
///
/// [Bit 11] IA32_HWP_REQUEST_PKG MSR is supported if set.
///
UINT32 HWP_Package_Level_Request:1;
UINT32 Reserved2:1;
///
/// [Bit 13] HDC base registers IA32_PKG_HDC_CTL, IA32_PM_CTL1,
/// IA32_THREAD_STALL MSRs are supported if set.
///
UINT32 HDC:1;
///
/// [Bit 14] Intel Turbo Boost Max Technology 3.0 available.
///
UINT32 TurboBoostMaxTechnology30:1;
///
/// [Bit 15] HWP Capabilities.
/// Highest Performance change is supported if set.
///
UINT32 HWPCapabilities:1;
///
/// [Bit 16] HWP PECI override is supported if set.
///
UINT32 HWPPECIOverride:1;
///
/// [Bit 17] Flexible HWP is supported if set.
///
UINT32 FlexibleHWP:1;
///
/// [Bit 18] Fast access mode for the IA32_HWP_REQUEST MSR is supported if set.
///
UINT32 FastAccessMode:1;
UINT32 Reserved4:1;
///
/// [Bit 20] Ignoring Idle Logical Processor HWP request is supported if set.
///
UINT32 IgnoringIdleLogicalProcessorHWPRequest:1;
UINT32 Reserved5:11;
} Bits;
///
/// All bit fields as a 32-bit value
///
UINT32 Uint32;
} CPUID_THERMAL_POWER_MANAGEMENT_EAX;
/**
CPUID Thermal and Power Management Information returned in EBX for CPUID leaf
#CPUID_THERMAL_POWER_MANAGEMENT.
**/
typedef union {
///
/// Individual bit fields
///
struct {
///
/// {Bits 3:0] Number of Interrupt Thresholds in Digital Thermal Sensor.
///
UINT32 InterruptThresholds:4;
UINT32 Reserved:28;
} Bits;
///
/// All bit fields as a 32-bit value
///
UINT32 Uint32;
} CPUID_THERMAL_POWER_MANAGEMENT_EBX;
/**
CPUID Thermal and Power Management Information returned in ECX for CPUID leaf
#CPUID_THERMAL_POWER_MANAGEMENT.
**/
typedef union {
///
/// Individual bit fields
///
struct {
///
/// [Bit 0] Hardware Coordination Feedback Capability (Presence of IA32_MPERF
/// and IA32_APERF). The capability to provide a measure of delivered
/// processor performance (since last reset of the counters), as a percentage
/// of the expected processor performance when running at the TSC frequency.
///
UINT32 HardwareCoordinationFeedback:1;
UINT32 Reserved1:2;
///
/// [Bit 3] If this bit is set, then the processor supports performance-energy
/// bias preference and the architectural MSR called IA32_ENERGY_PERF_BIAS
/// (1B0H).
///
UINT32 PerformanceEnergyBias:1;
UINT32 Reserved2:28;
} Bits;
///
/// All bit fields as a 32-bit value
///
UINT32 Uint32;
} CPUID_THERMAL_POWER_MANAGEMENT_ECX;
/**
CPUID Structured Extended Feature Flags Enumeration
@param EAX CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS (0x07)
@param ECX CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS_SUB_LEAF_INFO (0x00).
@note
If ECX contains an invalid sub-leaf index, EAX/EBX/ECX/EDX return 0. Sub-leaf
index n is invalid if n exceeds the value that sub-leaf 0 returns in EAX.
@retval EAX The maximum input value for ECX to retrieve sub-leaf information.
@retval EBX Structured Extended Feature Flags described by the type
CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS_EBX.
@retval EBX Structured Extended Feature Flags described by the type
CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS_ECX.
@retval EDX Reserved.
<b>Example usage</b>
@code
UINT32 Eax;
CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS_EBX Ebx;
CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS_ECX Ecx;
UINT32 SubLeaf;
AsmCpuidEx (
CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS,
CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS_SUB_LEAF_INFO,
&Eax, NULL, NULL, NULL
);
for (SubLeaf = 0; SubLeaf <= Eax; SubLeaf++) {
AsmCpuidEx (
CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS,
SubLeaf,
NULL, &Ebx.Uint32, &Ecx.Uint32, NULL
);
}
@endcode
**/
#define CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS 0x07
///
/// CPUID Structured Extended Feature Flags Enumeration sub-leaf
///
#define CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS_SUB_LEAF_INFO 0x00
/**
CPUID Structured Extended Feature Flags Enumeration in EBX for CPUID leaf
#CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS sub leaf
#CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS_SUB_LEAF_INFO.
**/
typedef union {
///
/// Individual bit fields
///
struct {
///
/// [Bit 0] Supports RDFSBASE/RDGSBASE/WRFSBASE/WRGSBASE if 1.
///
UINT32 FSGSBASE:1;
///
/// [Bit 1] IA32_TSC_ADJUST MSR is supported if 1.
///
UINT32 IA32_TSC_ADJUST:1;
///
/// [Bit 2] Intel SGX is supported if 1. See section 37.7 "DISCOVERING SUPPORT
/// FOR INTEL(R) SGX AND ENABLING ENCLAVE INSTRUCTIONS".
///
UINT32 SGX:1;
///
/// [Bit 3] If 1 indicates the processor supports the first group of advanced
/// bit manipulation extensions (ANDN, BEXTR, BLSI, BLSMSK, BLSR, TZCNT)
///
UINT32 BMI1:1;
///
/// [Bit 4] Hardware Lock Elision
///
UINT32 HLE:1;
///
/// [Bit 5] If 1 indicates the processor supports AVX2 instruction extensions.
///
UINT32 AVX2:1;
///
/// [Bit 6] x87 FPU Data Pointer updated only on x87 exceptions if 1.
///
UINT32 FDP_EXCPTN_ONLY:1;
///
/// [Bit 7] Supports Supervisor-Mode Execution Prevention if 1.
///
UINT32 SMEP:1;
///
/// [Bit 8] If 1 indicates the processor supports the second group of
/// advanced bit manipulation extensions (BZHI, MULX, PDEP, PEXT, RORX,
/// SARX, SHLX, SHRX)
///
UINT32 BMI2:1;
///
/// [Bit 9] Supports Enhanced REP MOVSB/STOSB if 1.
///
UINT32 EnhancedRepMovsbStosb:1;
///
/// [Bit 10] If 1, supports INVPCID instruction for system software that
/// manages process-context identifiers.
///
UINT32 INVPCID:1;
///
/// [Bit 11] Restricted Transactional Memory
///
UINT32 RTM:1;
///
/// [Bit 12] Supports Intel(R) Resource Director Technology (Intel(R) RDT)
/// Monitoring capability if 1.
///
UINT32 RDT_M:1;
///
/// [Bit 13] Deprecates FPU CS and FPU DS values if 1.
///
UINT32 DeprecateFpuCsDs:1;
///
/// [Bit 14] Supports Intel(R) Memory Protection Extensions if 1.
///
UINT32 MPX:1;
///
/// [Bit 15] Supports Intel(R) Resource Director Technology (Intel(R) RDT)
/// Allocation capability if 1.
///
UINT32 RDT_A:1;
///
/// [Bit 16] AVX512F.
///
UINT32 AVX512F:1;
///
/// [Bit 17] AVX512DQ.
///
UINT32 AVX512DQ:1;
///
/// [Bit 18] If 1 indicates the processor supports the RDSEED instruction.
///
UINT32 RDSEED:1;
///
/// [Bit 19] If 1 indicates the processor supports the ADCX and ADOX
/// instructions.
///
UINT32 ADX:1;
///
/// [Bit 20] Supports Supervisor-Mode Access Prevention (and the CLAC/STAC
/// instructions) if 1.
///
UINT32 SMAP:1;
///
/// [Bit 21] AVX512_IFMA.
///
UINT32 AVX512_IFMA:1;
UINT32 Reserved6:1;
///
/// [Bit 23] If 1 indicates the processor supports the CLFLUSHOPT instruction.
///
UINT32 CLFLUSHOPT:1;
///
/// [Bit 24] If 1 indicates the processor supports the CLWB instruction.
///
UINT32 CLWB:1;
///
/// [Bit 25] If 1 indicates the processor supports the Intel Processor Trace
/// extensions.
///
UINT32 IntelProcessorTrace:1;
///
/// [Bit 26] AVX512PF. (Intel Xeon Phi only.).
///
UINT32 AVX512PF:1;
///
/// [Bit 27] AVX512ER. (Intel Xeon Phi only.).
///
UINT32 AVX512ER:1;
///
/// [Bit 28] AVX512CD.
///
UINT32 AVX512CD:1;
///
/// [Bit 29] Supports Intel(R) Secure Hash Algorithm Extensions (Intel(R)
/// SHA Extensions) if 1.
///
UINT32 SHA:1;
///
/// [Bit 30] AVX512BW.
///
UINT32 AVX512BW:1;
///
/// [Bit 31] AVX512VL.
///
UINT32 AVX512VL:1;
} Bits;
///
/// All bit fields as a 32-bit value
///
UINT32 Uint32;
} CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS_EBX;
/**
CPUID Structured Extended Feature Flags Enumeration in ECX for CPUID leaf
#CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS sub leaf
#CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS_SUB_LEAF_INFO.
**/
typedef union {
///
/// Individual bit fields
///
struct {
///
/// [Bit 0] If 1 indicates the processor supports the PREFETCHWT1 instruction.
/// (Intel Xeon Phi only.)
///
UINT32 PREFETCHWT1:1;
///
/// [Bit 1] AVX512_VBMI.
///
UINT32 AVX512_VBMI:1;
///
/// [Bit 2] Supports user-mode instruction prevention if 1.
///
UINT32 UMIP:1;
///
/// [Bit 3] Supports protection keys for user-mode pages if 1.
///
UINT32 PKU:1;
///
/// [Bit 4] If 1, OS has set CR4.PKE to enable protection keys (and the
/// RDPKRU/WRPKRU instructions).
///
UINT32 OSPKE:1;
UINT32 Reserved5:9;
///
/// [Bits 14] AVX512_VPOPCNTDQ. (Intel Xeon Phi only.).
///
UINT32 AVX512_VPOPCNTDQ:1;
UINT32 Reserved6:2;
///
/// [Bits 21:17] The value of MAWAU used by the BNDLDX and BNDSTX instructions
/// in 64-bit mode.
///
UINT32 MAWAU:5;
///
/// [Bit 22] RDPID and IA32_TSC_AUX are available if 1.
///
UINT32 RDPID:1;
UINT32 Reserved3:7;
///
/// [Bit 30] Supports SGX Launch Configuration if 1.
///
UINT32 SGX_LC:1;
UINT32 Reserved4:1;
} Bits;
///
/// All bit fields as a 32-bit value
///
UINT32 Uint32;
} CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS_ECX;
/**
CPUID Structured Extended Feature Flags Enumeration in EDX for CPUID leaf
#CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS sub leaf
#CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS_SUB_LEAF_INFO.
**/
typedef union {
///
/// Individual bit fields
///
struct {
///
/// [Bit 1:0] Reserved.
///
UINT32 Reserved1:2;
///
/// [Bit 2] AVX512_4VNNIW. (Intel Xeon Phi only.)
///
UINT32 AVX512_4VNNIW:1;
///
/// [Bit 3] AVX512_4FMAPS. (Intel Xeon Phi only.)
///
UINT32 AVX512_4FMAPS:1;
///
/// [Bit 25:4] Reserved.
///
UINT32 Reserved2:22;
///
/// [Bit 26] Enumerates support for indirect branch restricted speculation
/// (IBRS) and the indirect branch pre-dictor barrier (IBPB). Processors
/// that set this bit support the IA32_SPEC_CTRL MSR and the IA32_PRED_CMD
/// MSR. They allow software to set IA32_SPEC_CTRL[0] (IBRS) and
/// IA32_PRED_CMD[0] (IBPB).
///
UINT32 EnumeratesSupportForIBRSAndIBPB:1;
///
/// [Bit 27] Enumerates support for single thread indirect branch
/// predictors (STIBP). Processors that set this bit support the
/// IA32_SPEC_CTRL MSR. They allow software to set IA32_SPEC_CTRL[1]
/// (STIBP).
///
UINT32 EnumeratesSupportForSTIBP:1;
///
/// [Bit 28] Enumerates support for L1D_FLUSH. Processors that set this bit
/// support the IA32_FLUSH_CMD MSR. They allow software to set
/// IA32_FLUSH_CMD[0] (L1D_FLUSH).
///
UINT32 EnumeratesSupportForL1D_FLUSH:1;
///
/// [Bit 29] Enumerates support for the IA32_ARCH_CAPABILITIES MSR.
///
UINT32 EnumeratesSupportForCapability:1;
///
/// [Bit 30] Reserved.
///
UINT32 Reserved3:1;
///
/// [Bit 31] Enumerates support for Speculative Store Bypass Disable (SSBD).
/// Processors that set this bit sup-port the IA32_SPEC_CTRL MSR. They allow
/// software to set IA32_SPEC_CTRL[2] (SSBD).
///
UINT32 EnumeratesSupportForSSBD:1;
} Bits;
///
/// All bit fields as a 32-bit value
///
UINT32 Uint32;
} CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS_EDX;
/**
CPUID Direct Cache Access Information
@param EAX CPUID_DIRECT_CACHE_ACCESS_INFO (0x09)
@retval EAX Value of bits [31:0] of IA32_PLATFORM_DCA_CAP MSR (address 1F8H).
@retval EBX Reserved.
@retval ECX Reserved.
@retval EDX Reserved.
<b>Example usage</b>
@code
UINT32 Eax;
AsmCpuid (CPUID_DIRECT_CACHE_ACCESS_INFO, &Eax, NULL, NULL, NULL);
@endcode
**/
#define CPUID_DIRECT_CACHE_ACCESS_INFO 0x09
/**
CPUID Architectural Performance Monitoring
@param EAX CPUID_ARCHITECTURAL_PERFORMANCE_MONITORING (0x0A)
@retval EAX Architectural Performance Monitoring information described by
the type CPUID_ARCHITECTURAL_PERFORMANCE_MONITORING_EAX.
@retval EBX Architectural Performance Monitoring information described by
the type CPUID_ARCHITECTURAL_PERFORMANCE_MONITORING_EBX.
@retval ECX Reserved.
@retval EDX Architectural Performance Monitoring information described by
the type CPUID_ARCHITECTURAL_PERFORMANCE_MONITORING_EDX.
<b>Example usage</b>
@code
CPUID_ARCHITECTURAL_PERFORMANCE_MONITORING_EAX Eax;
CPUID_ARCHITECTURAL_PERFORMANCE_MONITORING_EBX Ebx;
CPUID_ARCHITECTURAL_PERFORMANCE_MONITORING_EDX Edx;
AsmCpuid (CPUID_ARCHITECTURAL_PERFORMANCE_MONITORING, &Eax.Uint32, &Ebx.Uint32, NULL, &Edx.Uint32);
@endcode
**/
#define CPUID_ARCHITECTURAL_PERFORMANCE_MONITORING 0x0A
/**
CPUID Architectural Performance Monitoring EAX for CPUID leaf
#CPUID_ARCHITECTURAL_PERFORMANCE_MONITORING.
**/
typedef union {
///
/// Individual bit fields
///
struct {
///
/// [Bit 7:0] Version ID of architectural performance monitoring.
///
UINT32 ArchPerfMonVerID:8;
///
/// [Bits 15:8] Number of general-purpose performance monitoring counter
/// per logical processor.
///
/// IA32_PERFEVTSELx MSRs start at address 186H and occupy a contiguous
/// block of MSR address space. Each performance event select register is
/// paired with a corresponding performance counter in the 0C1H address
/// block.
///
UINT32 PerformanceMonitorCounters:8;
///
/// [Bits 23:16] Bit width of general-purpose, performance monitoring counter.
///
/// The bit width of an IA32_PMCx MSR. This the number of valid bits for
/// read operation. On write operations, the lower-order 32 bits of the MSR
/// may be written with any value, and the high-order bits are sign-extended
/// from the value of bit 31.
///
UINT32 PerformanceMonitorCounterWidth:8;
///
/// [Bits 31:24] Length of EBX bit vector to enumerate architectural
/// performance monitoring events.
///
UINT32 EbxBitVectorLength:8;
} Bits;
///
/// All bit fields as a 32-bit value
///
UINT32 Uint32;
} CPUID_ARCHITECTURAL_PERFORMANCE_MONITORING_EAX;
/**
CPUID Architectural Performance Monitoring EBX for CPUID leaf
#CPUID_ARCHITECTURAL_PERFORMANCE_MONITORING.
**/
typedef union {
///
/// Individual bit fields
///
struct {
///
/// [Bit 0] Core cycle event not available if 1.
///
UINT32 UnhaltedCoreCycles:1;
///
/// [Bit 1] Instruction retired event not available if 1.
///
UINT32 InstructionsRetired:1;
///
/// [Bit 2] Reference cycles event not available if 1.
///
UINT32 UnhaltedReferenceCycles:1;
///
/// [Bit 3] Last-level cache reference event not available if 1.
///
UINT32 LastLevelCacheReferences:1;
///
/// [Bit 4] Last-level cache misses event not available if 1.
///
UINT32 LastLevelCacheMisses:1;
///
/// [Bit 5] Branch instruction retired event not available if 1.
///
UINT32 BranchInstructionsRetired:1;
///
/// [Bit 6] Branch mispredict retired event not available if 1.
///
UINT32 AllBranchMispredictRetired:1;
UINT32 Reserved:25;
} Bits;
///
/// All bit fields as a 32-bit value
///
UINT32 Uint32;
} CPUID_ARCHITECTURAL_PERFORMANCE_MONITORING_EBX;
/**
CPUID Architectural Performance Monitoring EDX for CPUID leaf
#CPUID_ARCHITECTURAL_PERFORMANCE_MONITORING.
**/
typedef union {
///
/// Individual bit fields
///
struct {
///
/// [Bits 4:0] Number of fixed-function performance counters
/// (if Version ID > 1).
///
UINT32 FixedFunctionPerformanceCounters:5;
///
/// [Bits 12:5] Bit width of fixed-function performance counters
/// (if Version ID > 1).
///
UINT32 FixedFunctionPerformanceCounterWidth:8;
UINT32 Reserved1:2;
///
/// [Bits 15] AnyThread deprecation.
///
UINT32 AnyThreadDeprecation:1;
UINT32 Reserved2:16;
} Bits;
///
/// All bit fields as a 32-bit value
///
UINT32 Uint32;
} CPUID_ARCHITECTURAL_PERFORMANCE_MONITORING_EDX;
/**
CPUID Extended Topology Information
@note
CPUID leaf 1FH is a preferred superset to leaf 0BH. Intel recommends first
checking for the existence of Leaf 1FH before using leaf 0BH.
Most of Leaf 0BH output depends on the initial value in ECX. The EDX output
of leaf 0BH is always valid and does not vary with input value in ECX. Output
value in ECX[7:0] always equals input value in ECX[7:0].
Sub-leaf index 0 enumerates SMT level. Each subsequent higher sub-leaf index
enumerates a higher-level topological entity in hierarchical order.
For sub-leaves that return an invalid level-type of 0 in ECX[15:8]; EAX and
EBX will return 0.
If an input value n in ECX returns the invalid level-type of 0 in ECX[15:8],
other input values with ECX > n also return 0 in ECX[15:8].
@param EAX CPUID_EXTENDED_TOPOLOGY (0x0B)
@param ECX Level number
@retval EAX Extended topology information described by the type
CPUID_EXTENDED_TOPOLOGY_EAX.
@retval EBX Extended topology information described by the type
CPUID_EXTENDED_TOPOLOGY_EBX.
@retval ECX Extended topology information described by the type
CPUID_EXTENDED_TOPOLOGY_ECX.
@retval EDX x2APIC ID the current logical processor.
<b>Example usage</b>
@code
CPUID_EXTENDED_TOPOLOGY_EAX Eax;
CPUID_EXTENDED_TOPOLOGY_EBX Ebx;
CPUID_EXTENDED_TOPOLOGY_ECX Ecx;
UINT32 Edx;
UINT32 LevelNumber;
LevelNumber = 0;
do {
AsmCpuidEx (
CPUID_EXTENDED_TOPOLOGY, LevelNumber,
&Eax.Uint32, &Ebx.Uint32, &Ecx.Uint32, &Edx
);
LevelNumber++;
} while (Eax.Bits.ApicIdShift != 0);
@endcode
**/
#define CPUID_EXTENDED_TOPOLOGY 0x0B
/**
CPUID Extended Topology Information EAX for CPUID leaf #CPUID_EXTENDED_TOPOLOGY.
**/
typedef union {
///
/// Individual bit fields
///
struct {
///
/// [Bits 4:0] Number of bits to shift right on x2APIC ID to get a unique
/// topology ID of the next level type. All logical processors with the
/// same next level ID share current level.
///
/// @note
/// Software should use this field (EAX[4:0]) to enumerate processor
/// topology of the system.
///
UINT32 ApicIdShift:5;
UINT32 Reserved:27;
} Bits;
///
/// All bit fields as a 32-bit value
///
UINT32 Uint32;
} CPUID_EXTENDED_TOPOLOGY_EAX;
/**
CPUID Extended Topology Information EBX for CPUID leaf #CPUID_EXTENDED_TOPOLOGY.
**/
typedef union {
///
/// Individual bit fields
///
struct {
///
/// [Bits 15:0] Number of logical processors at this level type. The number
/// reflects configuration as shipped by Intel.
///
/// @note
/// Software must not use EBX[15:0] to enumerate processor topology of the
/// system. This value in this field (EBX[15:0]) is only intended for
/// display/diagnostic purposes. The actual number of logical processors
/// available to BIOS/OS/Applications may be different from the value of
/// EBX[15:0], depending on software and platform hardware configurations.
///
UINT32 LogicalProcessors:16;
UINT32 Reserved:16;
} Bits;
///
/// All bit fields as a 32-bit value
///
UINT32 Uint32;
} CPUID_EXTENDED_TOPOLOGY_EBX;
/**
CPUID Extended Topology Information ECX for CPUID leaf #CPUID_EXTENDED_TOPOLOGY.
**/
typedef union {
///
/// Individual bit fields
///
struct {
///
/// [Bits 7:0] Level number. Same value in ECX input.
///
UINT32 LevelNumber:8;
///
/// [Bits 15:8] Level type.
///
/// @note
/// The value of the "level type" field is not related to level numbers in
/// any way, higher "level type" values do not mean higher levels.
///
UINT32 LevelType:8;
UINT32 Reserved:16;
} Bits;
///
/// All bit fields as a 32-bit value
///
UINT32 Uint32;
} CPUID_EXTENDED_TOPOLOGY_ECX;
///
/// @{ Define value for CPUID_EXTENDED_TOPOLOGY_ECX.LevelType
///
#define CPUID_EXTENDED_TOPOLOGY_LEVEL_TYPE_INVALID 0x00
#define CPUID_EXTENDED_TOPOLOGY_LEVEL_TYPE_SMT 0x01
#define CPUID_EXTENDED_TOPOLOGY_LEVEL_TYPE_CORE 0x02
///
/// @}
///
/**
CPUID Extended State Information
@param EAX CPUID_EXTENDED_STATE (0x0D)
@param ECX CPUID_EXTENDED_STATE_MAIN_LEAF (0x00).
CPUID_EXTENDED_STATE_SUB_LEAF (0x01).
CPUID_EXTENDED_STATE_SIZE_OFFSET (0x02).
Sub leafs 2..n based on supported bits in XCR0 or IA32_XSS_MSR.
**/
#define CPUID_EXTENDED_STATE 0x0D
/**
CPUID Extended State Information Main Leaf
@param EAX CPUID_EXTENDED_STATE (0x0D)
@param ECX CPUID_EXTENDED_STATE_MAIN_LEAF (0x00)
@retval EAX Reports the supported bits of the lower 32 bits of XCR0. XCR0[n]
can be set to 1 only if EAX[n] is 1. The format of the extended
state main leaf is described by the type
CPUID_EXTENDED_STATE_MAIN_LEAF_EAX.
@retval EBX Maximum size (bytes, from the beginning of the XSAVE/XRSTOR save
area) required by enabled features in XCR0. May be different than
ECX if some features at the end of the XSAVE save area are not
enabled.
@retval ECX Maximum size (bytes, from the beginning of the XSAVE/XRSTOR save
area) of the XSAVE/XRSTOR save area required by all supported
features in the processor, i.e., all the valid bit fields in XCR0.
@retval EDX Reports the supported bits of the upper 32 bits of XCR0.
XCR0[n+32] can be set to 1 only if EDX[n] is 1.
<b>Example usage</b>
@code
CPUID_EXTENDED_STATE_MAIN_LEAF_EAX Eax;
UINT32 Ebx;
UINT32 Ecx;
UINT32 Edx;
AsmCpuidEx (
CPUID_EXTENDED_STATE, CPUID_EXTENDED_STATE_MAIN_LEAF,
&Eax.Uint32, &Ebx, &Ecx, &Edx
);
@endcode
**/
#define CPUID_EXTENDED_STATE_MAIN_LEAF 0x00
/**
CPUID Extended State Information EAX for CPUID leaf #CPUID_EXTENDED_STATE,
sub-leaf #CPUID_EXTENDED_STATE_MAIN_LEAF.
**/
typedef union {
///
/// Individual bit fields
///
struct {
///
/// [Bit 0] x87 state.
///
UINT32 x87:1;
///
/// [Bit 1] SSE state.
///
UINT32 SSE:1;
///
/// [Bit 2] AVX state.
///
UINT32 AVX:1;
///
/// [Bits 4:3] MPX state.
///
UINT32 MPX:2;
///
/// [Bits 7:5] AVX-512 state.
///
UINT32 AVX_512:3;
///
/// [Bit 8] Used for IA32_XSS.
///
UINT32 IA32_XSS:1;
///
/// [Bit 9] PKRU state.
///
UINT32 PKRU:1;
UINT32 Reserved1:3;
///
/// [Bit 13] Used for IA32_XSS, part 2.
///
UINT32 IA32_XSS_2:1;
UINT32 Reserved2:18;
} Bits;
///
/// All bit fields as a 32-bit value
///
UINT32 Uint32;
} CPUID_EXTENDED_STATE_MAIN_LEAF_EAX;
/**
CPUID Extended State Information Sub Leaf
@param EAX CPUID_EXTENDED_STATE (0x0D)
@param ECX CPUID_EXTENDED_STATE_SUB_LEAF (0x01)
@retval EAX The format of the extended state sub-leaf is described by the
type CPUID_EXTENDED_STATE_SUB_LEAF_EAX.
@retval EBX The size in bytes of the XSAVE area containing all states
enabled by XCRO | IA32_XSS.
@retval ECX The format of the extended state sub-leaf is described by the
type CPUID_EXTENDED_STATE_SUB_LEAF_ECX.
@retval EDX Reports the supported bits of the upper 32 bits of the
IA32_XSS MSR. IA32_XSS[n+32] can be set to 1 only if EDX[n] is 1.
<b>Example usage</b>
@code
CPUID_EXTENDED_STATE_SUB_LEAF_EAX Eax;
UINT32 Ebx;
CPUID_EXTENDED_STATE_SUB_LEAF_ECX Ecx;
UINT32 Edx;
AsmCpuidEx (
CPUID_EXTENDED_STATE, CPUID_EXTENDED_STATE_SUB_LEAF,
&Eax.Uint32, &Ebx, &Ecx.Uint32, &Edx
);
@endcode
**/
#define CPUID_EXTENDED_STATE_SUB_LEAF 0x01
/**
CPUID Extended State Information EAX for CPUID leaf #CPUID_EXTENDED_STATE,
sub-leaf #CPUID_EXTENDED_STATE_SUB_LEAF.
**/
typedef union {
///
/// Individual bit fields
///
struct {
///
/// [Bit 0] XSAVEOPT is available.
///
UINT32 XSAVEOPT:1;
///
/// [Bit 1] Supports XSAVEC and the compacted form of XRSTOR if set.
///
UINT32 XSAVEC:1;
///
/// [Bit 2] Supports XGETBV with ECX = 1 if set.
///
UINT32 XGETBV:1;
///
/// [Bit 3] Supports XSAVES/XRSTORS and IA32_XSS if set.
///
UINT32 XSAVES:1;
UINT32 Reserved:28;
} Bits;
///
/// All bit fields as a 32-bit value
///
UINT32 Uint32;
} CPUID_EXTENDED_STATE_SUB_LEAF_EAX;
/**
CPUID Extended State Information ECX for CPUID leaf #CPUID_EXTENDED_STATE,
sub-leaf #CPUID_EXTENDED_STATE_SUB_LEAF.
**/
typedef union {
///
/// Individual bit fields
///
struct {
///
/// [Bits 7:0] Used for XCR0.
///
UINT32 XCR0:1;
///
/// [Bit 8] PT STate.
///
UINT32 PT:1;
///
/// [Bit 9] Used for XCR0.
///
UINT32 XCR0_1:1;
UINT32 Reserved1:3;
///
/// [Bit 13] HWP state.
///
UINT32 HWPState:1;
UINT32 Reserved8:18;
} Bits;
///
/// All bit fields as a 32-bit value
///
UINT32 Uint32;
} CPUID_EXTENDED_STATE_SUB_LEAF_ECX;
/**
CPUID Extended State Information Size and Offset Sub Leaf
@note
Leaf 0DH output depends on the initial value in ECX.
Each sub-leaf index (starting at position 2) is supported if it corresponds to
a supported bit in either the XCR0 register or the IA32_XSS MSR.
If ECX contains an invalid sub-leaf index, EAX/EBX/ECX/EDX return 0. Sub-leaf
n (0 <= n <= 31) is invalid if sub-leaf 0 returns 0 in EAX[n] and sub-leaf 1
returns 0 in ECX[n]. Sub-leaf n (32 <= n <= 63) is invalid if sub-leaf 0
returns 0 in EDX[n-32] and sub-leaf 1 returns 0 in EDX[n-32].
@param EAX CPUID_EXTENDED_STATE (0x0D)
@param ECX CPUID_EXTENDED_STATE_SIZE_OFFSET (0x02). Sub leafs 2..n based
on supported bits in XCR0 or IA32_XSS_MSR.
@retval EAX The size in bytes (from the offset specified in EBX) of the save
area for an extended state feature associated with a valid
sub-leaf index, n.
@retval EBX The offset in bytes of this extended state component's save area
from the beginning of the XSAVE/XRSTOR area. This field reports
0 if the sub-leaf index, n, does not map to a valid bit in the
XCR0 register.
@retval ECX The format of the extended state components's save area as
described by the type CPUID_EXTENDED_STATE_SIZE_OFFSET_ECX.
This field reports 0 if the sub-leaf index, n, is invalid.
@retval EDX This field reports 0 if the sub-leaf index, n, is invalid;
otherwise it is reserved.
<b>Example usage</b>
@code
UINT32 Eax;
UINT32 Ebx;
CPUID_EXTENDED_STATE_SIZE_OFFSET_ECX Ecx;
UINT32 Edx;
UINTN SubLeaf;
for (SubLeaf = CPUID_EXTENDED_STATE_SIZE_OFFSET; SubLeaf < 32; SubLeaf++) {
AsmCpuidEx (
CPUID_EXTENDED_STATE, SubLeaf,
&Eax, &Ebx, &Ecx.Uint32, &Edx
);
}
@endcode
**/
#define CPUID_EXTENDED_STATE_SIZE_OFFSET 0x02
/**
CPUID Extended State Information ECX for CPUID leaf #CPUID_EXTENDED_STATE,
sub-leaf #CPUID_EXTENDED_STATE_SIZE_OFFSET.
**/
typedef union {
///
/// Individual bit fields
///
struct {
///
/// [Bit 0] Is set if the bit n (corresponding to the sub-leaf index) is
/// supported in the IA32_XSS MSR; it is clear if bit n is instead supported
/// in XCR0.
///
UINT32 XSS:1;
///
/// [Bit 1] is set if, when the compacted format of an XSAVE area is used,
/// this extended state component located on the next 64-byte boundary
/// following the preceding state component (otherwise, it is located
/// immediately following the preceding state component).
///
UINT32 Compacted:1;
UINT32 Reserved:30;
} Bits;
///
/// All bit fields as a 32-bit value
///
UINT32 Uint32;
} CPUID_EXTENDED_STATE_SIZE_OFFSET_ECX;
/**
CPUID Intel Resource Director Technology (Intel RDT) Monitoring Information
@param EAX CPUID_INTEL_RDT_MONITORING (0x0F)
@param ECX CPUID_INTEL_RDT_MONITORING_ENUMERATION_SUB_LEAF (0x00).
CPUID_INTEL_RDT_MONITORING_L3_CACHE_SUB_LEAF (0x01).
**/
#define CPUID_INTEL_RDT_MONITORING 0x0F
/**
CPUID Intel Resource Director Technology (Intel RDT) Monitoring Information
Enumeration Sub-leaf
@param EAX CPUID_INTEL_RDT_MONITORING (0x0F)
@param ECX CPUID_INTEL_RDT_MONITORING_ENUMERATION_SUB_LEAF (0x00)
@retval EAX Reserved.
@retval EBX Maximum range (zero-based) of RMID within this physical
processor of all types.
@retval ECX Reserved.
@retval EDX L3 Cache Intel RDT Monitoring Information Enumeration described by
the type CPUID_INTEL_RDT_MONITORING_ENUMERATION_SUB_LEAF_EDX.
<b>Example usage</b>
@code
UINT32 Ebx;
CPUID_INTEL_RDT_MONITORING_ENUMERATION_SUB_LEAF_EDX Edx;
AsmCpuidEx (
CPUID_INTEL_RDT_MONITORING, CPUID_INTEL_RDT_MONITORING_ENUMERATION_SUB_LEAF,
NULL, &Ebx, NULL, &Edx.Uint32
);
@endcode
**/
#define CPUID_INTEL_RDT_MONITORING_ENUMERATION_SUB_LEAF 0x00
/**
CPUID Intel RDT Monitoring Information EDX for CPUID leaf
#CPUID_INTEL_RDT_MONITORING, sub-leaf
#CPUID_INTEL_RDT_MONITORING_ENUMERATION_SUB_LEAF.
**/
typedef union {
///
/// Individual bit fields
///
struct {
UINT32 Reserved1:1;
///
/// [Bit 1] Supports L3 Cache Intel RDT Monitoring if 1.
///
UINT32 L3CacheRDT_M:1;
UINT32 Reserved2:30;
} Bits;
///
/// All bit fields as a 32-bit value
///
UINT32 Uint32;
} CPUID_INTEL_RDT_MONITORING_ENUMERATION_SUB_LEAF_EDX;
/**
CPUID L3 Cache Intel RDT Monitoring Capability Enumeration Sub-leaf
@param EAX CPUID_INTEL_RDT_MONITORING (0x0F)
@param ECX CPUID_INTEL_RDT_MONITORING_L3_CACHE_SUB_LEAF (0x01)
@retval EAX Reserved.
@retval EBX Conversion factor from reported IA32_QM_CTR value to occupancy metric (bytes).
@retval ECX Maximum range (zero-based) of RMID of this resource type.
@retval EDX L3 Cache Intel RDT Monitoring Capability information described by the
type CPUID_INTEL_RDT_MONITORING_L3_CACHE_SUB_LEAF_EDX.
<b>Example usage</b>
@code
UINT32 Ebx;
UINT32 Ecx;
CPUID_INTEL_RDT_MONITORING_L3_CACHE_SUB_LEAF_EDX Edx;
AsmCpuidEx (
CPUID_INTEL_RDT_MONITORING, CPUID_INTEL_RDT_MONITORING_L3_CACHE_SUB_LEAF,
NULL, &Ebx, &Ecx, &Edx.Uint32
);
@endcode
**/
#define CPUID_INTEL_RDT_MONITORING_L3_CACHE_SUB_LEAF 0x01
/**
CPUID L3 Cache Intel RDT Monitoring Capability Information EDX for CPUID leaf
#CPUID_INTEL_RDT_MONITORING, sub-leaf
#CPUID_INTEL_RDT_MONITORING_L3_CACHE_SUB_LEAF.
**/
typedef union {
///
/// Individual bit fields
///
struct {
///
/// [Bit 0] Supports L3 occupancy monitoring if 1.
///
UINT32 L3CacheOccupancyMonitoring:1;
///
/// [Bit 1] Supports L3 Total Bandwidth monitoring if 1.
///
UINT32 L3CacheTotalBandwidthMonitoring:1;
///
/// [Bit 2] Supports L3 Local Bandwidth monitoring if 1.
///
UINT32 L3CacheLocalBandwidthMonitoring:1;
UINT32 Reserved:29;
} Bits;
///
/// All bit fields as a 32-bit value
///
UINT32 Uint32;
} CPUID_INTEL_RDT_MONITORING_L3_CACHE_SUB_LEAF_EDX;
/**
CPUID Intel Resource Director Technology (Intel RDT) Allocation Information
@param EAX CPUID_INTEL_RDT_ALLOCATION (0x10).
@param ECX CPUID_INTEL_RDT_ALLOCATION_ENUMERATION_SUB_LEAF (0x00).
CPUID_INTEL_RDT_ALLOCATION_L3_CACHE_SUB_LEAF (0x01).
CPUID_INTEL_RDT_ALLOCATION_L2_CACHE_SUB_LEAF (0x02).
**/
#define CPUID_INTEL_RDT_ALLOCATION 0x10
/**
Intel Resource Director Technology (Intel RDT) Allocation Enumeration Sub-leaf
@param EAX CPUID_INTEL_RDT_ALLOCATION (0x10)
@param ECX CPUID_INTEL_RDT_ALLOCATION_ENUMERATION_SUB_LEAF (0x00).
@retval EAX Reserved.
@retval EBX L3 and L2 Cache Allocation Technology information described by
the type CPUID_INTEL_RDT_ALLOCATION_ENUMERATION_SUB_LEAF_EBX.
@retval ECX Reserved.
@retval EDX Reserved.
<b>Example usage</b>
@code
CPUID_INTEL_RDT_ALLOCATION_ENUMERATION_SUB_LEAF_EBX Ebx;
AsmCpuidEx (
CPUID_INTEL_RDT_ALLOCATION, CPUID_INTEL_RDT_ALLOCATION_ENUMERATION_SUB_LEAF,
NULL, &Ebx.Uint32, NULL, NULL
);
@endcode
**/
#define CPUID_INTEL_RDT_ALLOCATION_ENUMERATION_SUB_LEAF 0x00
/**
CPUID L3 and L2 Cache Allocation Support Information EBX for CPUID leaf
#CPUID_INTEL_RDT_ALLOCATION, sub-leaf
#CPUID_INTEL_RDT_ALLOCATION_ENUMERATION_SUB_LEAF.
**/
typedef union {
///
/// Individual bit fields
///
struct {
UINT32 Reserved1:1;
///
/// [Bit 1] Supports L3 Cache Allocation Technology if 1.
///
UINT32 L3CacheAllocation:1;
///
/// [Bit 2] Supports L2 Cache Allocation Technology if 1.
///
UINT32 L2CacheAllocation:1;
///
/// [Bit 3] Supports Memory Bandwidth Allocation if 1.
///
UINT32 MemoryBandwidth:1;
UINT32 Reserved3:28;
} Bits;
///
/// All bit fields as a 32-bit value
///
UINT32 Uint32;
} CPUID_INTEL_RDT_ALLOCATION_ENUMERATION_SUB_LEAF_EBX;
/**
L3 Cache Allocation Technology Enumeration Sub-leaf
@param EAX CPUID_INTEL_RDT_ALLOCATION (0x10)
@param ECX CPUID_INTEL_RDT_ALLOCATION_L3_CACHE_SUB_LEAF (0x01)
@retval EAX RESID L3 Cache Allocation Technology information described by
the type CPUID_INTEL_RDT_ALLOCATION_L3_CACHE_SUB_LEAF_EAX.
@retval EBX Bit-granular map of isolation/contention of allocation units.
@retval ECX RESID L3 Cache Allocation Technology information described by
the type CPUID_INTEL_RDT_ALLOCATION_L3_CACHE_SUB_LEAF_ECX.
@retval EDX RESID L3 Cache Allocation Technology information described by
the type CPUID_INTEL_RDT_ALLOCATION_L3_CACHE_SUB_LEAF_EDX.
<b>Example usage</b>
@code
CPUID_INTEL_RDT_ALLOCATION_L3_CACHE_SUB_LEAF_EAX Eax;
UINT32 Ebx;
CPUID_INTEL_RDT_ALLOCATION_L3_CACHE_SUB_LEAF_ECX Ecx;
CPUID_INTEL_RDT_ALLOCATION_L3_CACHE_SUB_LEAF_EDX Edx;
AsmCpuidEx (
CPUID_INTEL_RDT_ALLOCATION, CPUID_INTEL_RDT_ALLOCATION_L3_CACHE_SUB_LEAF,
&Eax.Uint32, &Ebx, &Ecx.Uint32, &Edx.Uint32
);
@endcode
**/
#define CPUID_INTEL_RDT_ALLOCATION_L3_CACHE_SUB_LEAF 0x01
/**
CPUID L3 Cache Allocation Technology Information EAX for CPUID leaf
#CPUID_INTEL_RDT_ALLOCATION, sub-leaf
#CPUID_INTEL_RDT_ALLOCATION_L3_CACHE_SUB_LEAF.
**/
typedef union {
///
/// Individual bit fields
///
struct {
///
/// [Bits 4:0] Length of the capacity bit mask for the corresponding ResID
/// using minus-one notation.
///
UINT32 CapacityLength:5;
UINT32 Reserved:27;
} Bits;
///
/// All bit fields as a 32-bit value
///
UINT32 Uint32;
} CPUID_INTEL_RDT_ALLOCATION_L3_CACHE_SUB_LEAF_EAX;
/**
CPUID L3 Cache Allocation Technology Information ECX for CPUID leaf
#CPUID_INTEL_RDT_ALLOCATION, sub-leaf
#CPUID_INTEL_RDT_ALLOCATION_L3_CACHE_SUB_LEAF.
**/
typedef union {
///
/// Individual bit fields
///
struct {
UINT32 Reserved3:2;
///
/// [Bit 2] Code and Data Prioritization Technology supported if 1.
///
UINT32 CodeDataPrioritization:1;
UINT32 Reserved2:29;
} Bits;
///
/// All bit fields as a 32-bit value
///
UINT32 Uint32;
} CPUID_INTEL_RDT_ALLOCATION_L3_CACHE_SUB_LEAF_ECX;
/**
CPUID L3 Cache Allocation Technology Information EDX for CPUID leaf
#CPUID_INTEL_RDT_ALLOCATION, sub-leaf
#CPUID_INTEL_RDT_ALLOCATION_L3_CACHE_SUB_LEAF.
**/
typedef union {
///
/// Individual bit fields
///
struct {
///
/// [Bits 15:0] Highest COS number supported for this ResID.
///
UINT32 HighestCosNumber:16;
UINT32 Reserved:16;
} Bits;
///
/// All bit fields as a 32-bit value
///
UINT32 Uint32;
} CPUID_INTEL_RDT_ALLOCATION_L3_CACHE_SUB_LEAF_EDX;
/**
L2 Cache Allocation Technology Enumeration Sub-leaf
@param EAX CPUID_INTEL_RDT_ALLOCATION (0x10)
@param ECX CPUID_INTEL_RDT_ALLOCATION_L2_CACHE_SUB_LEAF (0x02)
@retval EAX RESID L2 Cache Allocation Technology information described by
the type CPUID_INTEL_RDT_ALLOCATION_L2_CACHE_SUB_LEAF_EAX.
@retval EBX Bit-granular map of isolation/contention of allocation units.
@retval ECX Reserved.
@retval EDX RESID L2 Cache Allocation Technology information described by
the type CPUID_INTEL_RDT_ALLOCATION_L2_CACHE_SUB_LEAF_EDX.
<b>Example usage</b>
@code
CPUID_INTEL_RDT_ALLOCATION_L2_CACHE_SUB_LEAF_EAX Eax;
UINT32 Ebx;
CPUID_INTEL_RDT_ALLOCATION_L2_CACHE_SUB_LEAF_EDX Edx;
AsmCpuidEx (
CPUID_INTEL_RDT_ALLOCATION, CPUID_INTEL_RDT_ALLOCATION_L2_CACHE_SUB_LEAF,
&Eax.Uint32, &Ebx, NULL, &Edx.Uint32
);
@endcode
**/
#define CPUID_INTEL_RDT_ALLOCATION_L2_CACHE_SUB_LEAF 0x02
/**
CPUID L2 Cache Allocation Technology Information EAX for CPUID leaf
#CPUID_INTEL_RDT_ALLOCATION, sub-leaf
#CPUID_INTEL_RDT_ALLOCATION_L2_CACHE_SUB_LEAF.
**/
typedef union {
///
/// Individual bit fields
///
struct {
///
/// [Bits 4:0] Length of the capacity bit mask for the corresponding ResID
/// using minus-one notation.
///
UINT32 CapacityLength:5;
UINT32 Reserved:27;
} Bits;
///
/// All bit fields as a 32-bit value
///
UINT32 Uint32;
} CPUID_INTEL_RDT_ALLOCATION_L2_CACHE_SUB_LEAF_EAX;
/**
CPUID L2 Cache Allocation Technology Information EDX for CPUID leaf
#CPUID_INTEL_RDT_ALLOCATION, sub-leaf
#CPUID_INTEL_RDT_ALLOCATION_L2_CACHE_SUB_LEAF.
**/
typedef union {
///
/// Individual bit fields
///
struct {
///
/// [Bits 15:0] Highest COS number supported for this ResID.
///
UINT32 HighestCosNumber:16;
UINT32 Reserved:16;
} Bits;
///
/// All bit fields as a 32-bit value
///
UINT32 Uint32;
} CPUID_INTEL_RDT_ALLOCATION_L2_CACHE_SUB_LEAF_EDX;
/**
Memory Bandwidth Allocation Enumeration Sub-leaf
@param EAX CPUID_INTEL_RDT_ALLOCATION (0x10)
@param ECX CPUID_INTEL_RDT_ALLOCATION_MEMORY_BANDWIDTH_SUB_LEAF (0x03)
@retval EAX RESID memory bandwidth Allocation Technology information
described by the type
CPUID_INTEL_RDT_ALLOCATION_MEMORY_BANDWIDTH_SUB_LEAF_EAX.
@retval EBX Reserved.
@retval ECX RESID memory bandwidth Allocation Technology information
described by the type
CPUID_INTEL_RDT_ALLOCATION_MEMORY_BANDWIDTH_SUB_LEAF_ECX.
@retval EDX RESID memory bandwidth Allocation Technology information
described by the type
CPUID_INTEL_RDT_ALLOCATION_MEMORY_BANDWIDTH_SUB_LEAF_EDX.
<b>Example usage</b>
@code
CPUID_INTEL_RDT_ALLOCATION_MEMORY_BANDWIDTH_SUB_LEAF_EAX Eax;
UINT32 Ebx;
CPUID_INTEL_RDT_ALLOCATION_MEMORY_BANDWIDTH_SUB_LEAF_ECX Ecx;
CPUID_INTEL_RDT_ALLOCATION_MEMORY_BANDWIDTH_SUB_LEAF_EDX Edx;
AsmCpuidEx (
CPUID_INTEL_RDT_ALLOCATION, CPUID_INTEL_RDT_ALLOCATION_MEMORY_BANDWIDTH_SUB_LEAF,
&Eax.Uint32, &Ebx, NULL, &Edx.Uint32
);
@endcode
**/
#define CPUID_INTEL_RDT_ALLOCATION_MEMORY_BANDWIDTH_SUB_LEAF 0x03
/**
CPUID memory bandwidth Allocation Technology Information EAX for CPUID leaf
#CPUID_INTEL_RDT_ALLOCATION, sub-leaf
#CPUID_INTEL_RDT_ALLOCATION_MEMORY_BANDWIDTH_SUB_LEAF.
**/
typedef union {
///
/// Individual bit fields
///
struct {
///
/// [Bits 11:0] Reports the maximum MBA throttling value supported for
/// the corresponding ResID using minus-one notation.
///
UINT32 MaximumMBAThrottling:12;
UINT32 Reserved:20;
} Bits;
///
/// All bit fields as a 32-bit value
///
UINT32 Uint32;
} CPUID_INTEL_RDT_ALLOCATION_MEMORY_BANDWIDTH_SUB_LEAF_EAX;
/**
CPUID memory bandwidth Allocation Technology Information ECX for CPUID leaf
#CPUID_INTEL_RDT_ALLOCATION, sub-leaf
#CPUID_INTEL_RDT_ALLOCATION_MEMORY_BANDWIDTH_SUB_LEAF.
**/
typedef union {
///
/// Individual bit fields
///
struct {
///
/// [Bits 1:0] Reserved.
///
UINT32 Reserved1:2;
///
/// [Bits 3] Reports whether the response of the delay values is linear.
///
UINT32 Liner:1;
UINT32 Reserved2:29;
} Bits;
///
/// All bit fields as a 32-bit value
///
UINT32 Uint32;
} CPUID_INTEL_RDT_ALLOCATION_MEMORY_BANDWIDTH_SUB_LEAF_ECX;
/**
CPUID memory bandwidth Allocation Technology Information EDX for CPUID leaf
#CPUID_INTEL_RDT_ALLOCATION, sub-leaf
#CPUID_INTEL_RDT_ALLOCATION_MEMORY_BANDWIDTH_SUB_LEAF.
**/
typedef union {
///
/// Individual bit fields
///
struct {
///
/// [Bits 15:0] Highest COS number supported for this ResID.
///
UINT32 HighestCosNumber:16;
UINT32 Reserved:16;
} Bits;
///
/// All bit fields as a 32-bit value
///
UINT32 Uint32;
} CPUID_INTEL_RDT_ALLOCATION_MEMORY_BANDWIDTH_SUB_LEAF_EDX;
/**
Intel SGX resource capability and configuration.
See Section 37.7.2 "Intel(R) SGX Resource Enumeration Leaves".
If CPUID.(EAX=07H, ECX=0H):EBX.SGX = 1, the processor also supports querying
CPUID with EAX=12H on Intel SGX resource capability and configuration.
@param EAX CPUID_INTEL_SGX (0x12)
@param ECX CPUID_INTEL_SGX_CAPABILITIES_0_SUB_LEAF (0x00).
CPUID_INTEL_SGX_CAPABILITIES_1_SUB_LEAF (0x01).
CPUID_INTEL_SGX_CAPABILITIES_RESOURCES_SUB_LEAF (0x02).
Sub leafs 2..n based on the sub-leaf-type encoding (returned in EAX[3:0])
until the sub-leaf type is invalid.
**/
#define CPUID_INTEL_SGX 0x12
/**
Sub-Leaf 0 Enumeration of Intel SGX Capabilities.
Enumerates Intel SGX capability, including enclave instruction opcode support.
@param EAX CPUID_INTEL_SGX (0x12)
@param ECX CPUID_INTEL_SGX_CAPABILITIES_0_SUB_LEAF (0x00)
@retval EAX The format of Sub-Leaf 0 Enumeration of Intel SGX Capabilities is
described by the type CPUID_INTEL_SGX_CAPABILITIES_0_SUB_LEAF_EAX.
@retval EBX MISCSELECT: Reports the bit vector of supported extended features
that can be written to the MISC region of the SSA.
@retval ECX Reserved.
@retval EDX The format of Sub-Leaf 0 Enumeration of Intel SGX Capabilities is
described by the type CPUID_INTEL_SGX_CAPABILITIES_0_SUB_LEAF_EDX.
<b>Example usage</b>
@code
CPUID_INTEL_SGX_CAPABILITIES_0_SUB_LEAF_EAX Eax;
UINT32 Ebx;
CPUID_INTEL_SGX_CAPABILITIES_0_SUB_LEAF_EDX Edx;
AsmCpuidEx (
CPUID_INTEL_SGX, CPUID_INTEL_SGX_CAPABILITIES_0_SUB_LEAF,
&Eax.Uint32, &Ebx, NULL, &Edx.Uint32
);
@endcode
**/
#define CPUID_INTEL_SGX_CAPABILITIES_0_SUB_LEAF 0x00
/**
Sub-Leaf 0 Enumeration of Intel SGX Capabilities EAX for CPUID leaf #CPUID_INTEL_SGX,
sub-leaf #CPUID_INTEL_SGX_CAPABILITIES_0_SUB_LEAF.
**/
typedef union {
///
/// Individual bit fields
///
struct {
///
/// [Bit 0] If 1, indicates leaf functions of SGX1 instruction are supported.
///
UINT32 SGX1:1;
///
/// [Bit 1] If 1, indicates leaf functions of SGX2 instruction are supported.
///
UINT32 SGX2:1;
UINT32 Reserved1:3;
///
/// [Bit 5] If 1, indicates Intel SGX supports ENCLV instruction leaves
/// EINCVIRTCHILD, EDECVIRTCHILD, and ESETCONTEXT.
///
UINT32 ENCLV:1;
///
/// [Bit 6] If 1, indicates Intel SGX supports ENCLS instruction leaves ETRACKC,
/// ERDINFO, ELDBC, and ELDUC.
///
UINT32 ENCLS:1;
UINT32 Reserved2:25;
} Bits;
///
/// All bit fields as a 32-bit value
///
UINT32 Uint32;
} CPUID_INTEL_SGX_CAPABILITIES_0_SUB_LEAF_EAX;
/**
Sub-Leaf 0 Enumeration of Intel SGX Capabilities EDX for CPUID leaf #CPUID_INTEL_SGX,
sub-leaf #CPUID_INTEL_SGX_CAPABILITIES_0_SUB_LEAF.
**/
typedef union {
///
/// Individual bit fields
///
struct {
///
/// [Bit 7:0] The maximum supported enclave size is 2^(EDX[7:0]) bytes
/// when not in 64-bit mode.
///
UINT32 MaxEnclaveSize_Not64:8;
///
/// [Bit 15:8] The maximum supported enclave size is 2^(EDX[15:8]) bytes
/// when operating in 64-bit mode.
///
UINT32 MaxEnclaveSize_64:8;
UINT32 Reserved:16;
} Bits;
///
/// All bit fields as a 32-bit value
///
UINT32 Uint32;
} CPUID_INTEL_SGX_CAPABILITIES_0_SUB_LEAF_EDX;
/**
Sub-Leaf 1 Enumeration of Intel SGX Capabilities.
Enumerates Intel SGX capability of processor state configuration and enclave
configuration in the SECS structure.
@param EAX CPUID_INTEL_SGX (0x12)
@param ECX CPUID_INTEL_SGX_CAPABILITIES_1_SUB_LEAF (0x01)
@retval EAX Report the valid bits of SECS.ATTRIBUTES[31:0] that software can
set with ECREATE. SECS.ATTRIBUTES[n] can be set to 1 using ECREATE
only if EAX[n] is 1, where n < 32.
@retval EBX Report the valid bits of SECS.ATTRIBUTES[63:32] that software can
set with ECREATE. SECS.ATTRIBUTES[n+32] can be set to 1 using ECREATE
only if EBX[n] is 1, where n < 32.
@retval ECX Report the valid bits of SECS.ATTRIBUTES[95:64] that software can
set with ECREATE. SECS.ATTRIBUTES[n+64] can be set to 1 using ECREATE
only if ECX[n] is 1, where n < 32.
@retval EDX Report the valid bits of SECS.ATTRIBUTES[127:96] that software can
set with ECREATE. SECS.ATTRIBUTES[n+96] can be set to 1 using ECREATE
only if EDX[n] is 1, where n < 32.
<b>Example usage</b>
@code
UINT32 Eax;
UINT32 Ebx;
UINT32 Ecx;
UINT32 Edx;
AsmCpuidEx (
CPUID_INTEL_SGX, CPUID_INTEL_SGX_CAPABILITIES_1_SUB_LEAF,
&Eax, &Ebx, &Ecx, &Edx
);
@endcode
**/
#define CPUID_INTEL_SGX_CAPABILITIES_1_SUB_LEAF 0x01
/**
Sub-Leaf Index 2 or Higher Enumeration of Intel SGX Resources.
Enumerates available EPC resources.
@param EAX CPUID_INTEL_SGX (0x12)
@param ECX CPUID_INTEL_SGX_CAPABILITIES_RESOURCES_SUB_LEAF (0x02)
@retval EAX The format of Sub-Leaf Index 2 or Higher Enumeration of Intel SGX
Resources is described by the type
CPUID_INTEL_SGX_CAPABILITIES_RESOURCES_SUB_LEAF_EAX.
@retval EBX The format of Sub-Leaf Index 2 or Higher Enumeration of Intel SGX
Resources is described by the type
CPUID_INTEL_SGX_CAPABILITIES_RESOURCES_SUB_LEAF_EBX.
@retval EDX The format of Sub-Leaf Index 2 or Higher Enumeration of Intel SGX
Resources is described by the type
CPUID_INTEL_SGX_CAPABILITIES_RESOURCES_SUB_LEAF_ECX.
@retval EDX The format of Sub-Leaf Index 2 or Higher Enumeration of Intel SGX
Resources is described by the type
CPUID_INTEL_SGX_CAPABILITIES_RESOURCES_SUB_LEAF_EDX.
<b>Example usage</b>
@code
CPUID_INTEL_SGX_CAPABILITIES_RESOURCES_SUB_LEAF_EAX Eax;
CPUID_INTEL_SGX_CAPABILITIES_RESOURCES_SUB_LEAF_EBX Ebx;
CPUID_INTEL_SGX_CAPABILITIES_RESOURCES_SUB_LEAF_ECX Ecx;
CPUID_INTEL_SGX_CAPABILITIES_RESOURCES_SUB_LEAF_EDX Edx;
AsmCpuidEx (
CPUID_INTEL_SGX, CPUID_INTEL_SGX_CAPABILITIES_RESOURCES_SUB_LEAF,
&Eax.Uint32, &Ebx.Uint32, &Ecx.Uint32, &Edx.Uint32
);
@endcode
**/
#define CPUID_INTEL_SGX_CAPABILITIES_RESOURCES_SUB_LEAF 0x02
/**
Sub-Leaf Index 2 or Higher Enumeration of Intel SGX Resources EAX for CPUID
leaf #CPUID_INTEL_SGX, sub-leaf #CPUID_INTEL_SGX_CAPABILITIES_RESOURCES_SUB_LEAF.
**/
typedef union {
///
/// Individual bit fields
///
struct {
///
/// [Bit 3:0] Sub-leaf-type encoding.
/// 0000b: This sub-leaf is invalid, EBX:EAX and EDX:ECX report 0.
/// 0001b: This sub-leaf provides information on the Enclave Page Cache (EPC)
/// in EBX:EAX and EDX:ECX.
/// All other encoding are reserved.
///
UINT32 SubLeafType:4;
UINT32 Reserved:8;
///
/// [Bit 31:12] If EAX[3:0] = 0001b, these are bits 31:12 of the physical address of
/// the base of the EPC section.
///
UINT32 LowAddressOfEpcSection:20;
} Bits;
///
/// All bit fields as a 32-bit value
///
UINT32 Uint32;
} CPUID_INTEL_SGX_CAPABILITIES_RESOURCES_SUB_LEAF_EAX;
/**
Sub-Leaf Index 2 or Higher Enumeration of Intel SGX Resources EBX for CPUID
leaf #CPUID_INTEL_SGX, sub-leaf #CPUID_INTEL_SGX_CAPABILITIES_RESOURCES_SUB_LEAF.
**/
typedef union {
///
/// Individual bit fields
///
struct {
///
/// [Bit 19:0] If EAX[3:0] = 0001b, these are bits 51:32 of the physical address of
/// the base of the EPC section.
///
UINT32 HighAddressOfEpcSection:20;
UINT32 Reserved:12;
} Bits;
///
/// All bit fields as a 32-bit value
///
UINT32 Uint32;
} CPUID_INTEL_SGX_CAPABILITIES_RESOURCES_SUB_LEAF_EBX;
/**
Sub-Leaf Index 2 or Higher Enumeration of Intel SGX Resources ECX for CPUID
leaf #CPUID_INTEL_SGX, sub-leaf #CPUID_INTEL_SGX_CAPABILITIES_RESOURCES_SUB_LEAF.
**/
typedef union {
///
/// Individual bit fields
///
struct {
///
/// [Bit 3:0] The EPC section encoding.
/// 0000b: Not valid.
/// 0001b: The EPC section is confidentiality, integrity and replay protected.
/// All other encoding are reserved.
///
UINT32 EpcSection:4;
UINT32 Reserved:8;
///
/// [Bit 31:12] If EAX[3:0] = 0001b, these are bits 31:12 of the size of the
/// corresponding EPC section within the Processor Reserved Memory.
///
UINT32 LowSizeOfEpcSection:20;
} Bits;
///
/// All bit fields as a 32-bit value
///
UINT32 Uint32;
} CPUID_INTEL_SGX_CAPABILITIES_RESOURCES_SUB_LEAF_ECX;
/**
Sub-Leaf Index 2 or Higher Enumeration of Intel SGX Resources EDX for CPUID
leaf #CPUID_INTEL_SGX, sub-leaf #CPUID_INTEL_SGX_CAPABILITIES_RESOURCES_SUB_LEAF.
**/
typedef union {
///
/// Individual bit fields
///
struct {
///
/// [Bit 19:0] If EAX[3:0] = 0001b, these are bits 51:32 of the size of the
/// corresponding EPC section within the Processor Reserved Memory.
///
UINT32 HighSizeOfEpcSection:20;
UINT32 Reserved:12;
} Bits;
///
/// All bit fields as a 32-bit value
///
UINT32 Uint32;
} CPUID_INTEL_SGX_CAPABILITIES_RESOURCES_SUB_LEAF_EDX;
/**
CPUID Intel Processor Trace Information
@param EAX CPUID_INTEL_PROCESSOR_TRACE (0x14)
@param ECX CPUID_INTEL_PROCESSOR_TRACE_MAIN_LEAF (0x00).
CPUID_INTEL_PROCESSOR_TRACE_SUB_LEAF (0x01).
**/
#define CPUID_INTEL_PROCESSOR_TRACE 0x14
/**
CPUID Intel Processor Trace Information Main Leaf
@param EAX CPUID_INTEL_PROCEDSSOR_TRACE (0x14)
@param ECX CPUID_INTEL_PROCEDSSOR_TRACE_MAIN_LEAF (0x00)
@retval EAX Reports the maximum sub-leaf supported in leaf 14H.
@retval EBX Returns Intel processor trace information described by the
type CPUID_INTEL_PROCESSOR_TRACE_MAIN_LEAF_EBX.
@retval ECX Returns Intel processor trace information described by the
type CPUID_INTEL_PROCESSOR_TRACE_MAIN_LEAF_ECX.
@retval EDX Reserved.
<b>Example usage</b>
@code
UINT32 Eax;
CPUID_INTEL_PROCESSOR_TRACE_MAIN_LEAF_EBX Ebx;
CPUID_INTEL_PROCESSOR_TRACE_MAIN_LEAF_ECX Ecx;
AsmCpuidEx (
CPUID_INTEL_PROCESSOR_TRACE, CPUID_INTEL_PROCESSOR_TRACE_MAIN_LEAF,
&Eax, &Ebx.Uint32, &Ecx.Uint32, NULL
);
@endcode
**/
#define CPUID_INTEL_PROCESSOR_TRACE_MAIN_LEAF 0x00
/**
CPUID Intel Processor Trace EBX for CPUID leaf #CPUID_INTEL_PROCESSOR_TRACE,
sub-leaf #CPUID_INTEL_PROCESSOR_TRACE_MAIN_LEAF.
**/
typedef union {
///
/// Individual bit fields
///
struct {
///
/// [Bit 0] If 1, indicates that IA32_RTIT_CTL.CR3Filter can be set to 1,
/// and that IA32_RTIT_CR3_MATCH MSR can be accessed.
///
UINT32 Cr3Filter:1;
///
/// [Bit 1] If 1, indicates support of Configurable PSB and Cycle-Accurate
/// Mode.
///
UINT32 ConfigurablePsb:1;
///
/// [Bit 2] If 1, indicates support of IP Filtering, TraceStop filtering,
/// and preservation of Intel PT MSRs across warm reset.
///
UINT32 IpTraceStopFiltering:1;
///
/// [Bit 3] If 1, indicates support of MTC timing packet and suppression of
/// COFI-based packets.
///
UINT32 Mtc:1;
///
/// [Bit 4] If 1, indicates support of PTWRITE. Writes can set
/// IA32_RTIT_CTL[12] (PTWEn) and IA32_RTIT_CTL[5] (FUPonPTW), and PTWRITE
/// can generate packets.
///
UINT32 PTWrite:1;
///
/// [Bit 5] If 1, indicates support of Power Event Trace. Writes can set
/// IA32_RTIT_CTL[4] (PwrEvtEn), enabling Power Event Trace packet
/// generation.
///
UINT32 PowerEventTrace:1;
UINT32 Reserved:26;
} Bits;
///
/// All bit fields as a 32-bit value
///
UINT32 Uint32;
} CPUID_INTEL_PROCESSOR_TRACE_MAIN_LEAF_EBX;
/**
CPUID Intel Processor Trace ECX for CPUID leaf #CPUID_INTEL_PROCESSOR_TRACE,
sub-leaf #CPUID_INTEL_PROCESSOR_TRACE_MAIN_LEAF.
**/
typedef union {
///
/// Individual bit fields
///
struct {
///
/// [Bit 0] If 1, Tracing can be enabled with IA32_RTIT_CTL.ToPA = 1, hence
/// utilizing the ToPA output scheme; IA32_RTIT_OUTPUT_BASE and
/// IA32_RTIT_OUTPUT_MASK_PTRS MSRs can be accessed.
///
UINT32 RTIT:1;
///
/// [Bit 1] If 1, ToPA tables can hold any number of output entries, up to
/// the maximum allowed by the MaskOrTableOffset field of
/// IA32_RTIT_OUTPUT_MASK_PTRS.
///
UINT32 ToPA:1;
///
/// [Bit 2] If 1, indicates support of Single-Range Output scheme.
///
UINT32 SingleRangeOutput:1;
///
/// [Bit 3] If 1, indicates support of output to Trace Transport subsystem.
///
UINT32 TraceTransportSubsystem:1;
UINT32 Reserved:27;
///
/// [Bit 31] If 1, generated packets which contain IP payloads have LIP
/// values, which include the CS base component.
///
UINT32 LIP:1;
} Bits;
///
/// All bit fields as a 32-bit value
///
UINT32 Uint32;
} CPUID_INTEL_PROCESSOR_TRACE_MAIN_LEAF_ECX;
/**
CPUID Intel Processor Trace Information Sub-leaf
@param EAX CPUID_INTEL_PROCEDSSOR_TRACE (0x14)
@param ECX CPUID_INTEL_PROCESSOR_TRACE_SUB_LEAF (0x01)
@retval EAX Returns Intel processor trace information described by the
type CPUID_INTEL_PROCESSOR_TRACE_SUB_LEAF_EAX.
@retval EBX Returns Intel processor trace information described by the
type CPUID_INTEL_PROCESSOR_TRACE_SUB_LEAF_EBX.
@retval ECX Reserved.
@retval EDX Reserved.
<b>Example usage</b>
@code
UINT32 MaximumSubLeaf;
UINT32 SubLeaf;
CPUID_INTEL_PROCESSOR_TRACE_SUB_LEAF_EAX Eax;
CPUID_INTEL_PROCESSOR_TRACE_SUB_LEAF_EBX Ebx;
AsmCpuidEx (
CPUID_INTEL_PROCESSOR_TRACE, CPUID_INTEL_PROCESSOR_TRACE_MAIN_LEAF,
&MaximumSubLeaf, NULL, NULL, NULL
);
for (SubLeaf = CPUID_INTEL_PROCESSOR_TRACE_SUB_LEAF; SubLeaf <= MaximumSubLeaf; SubLeaf++) {
AsmCpuidEx (
CPUID_INTEL_PROCESSOR_TRACE, SubLeaf,
&Eax.Uint32, &Ebx.Uint32, NULL, NULL
);
}
@endcode
**/
#define CPUID_INTEL_PROCESSOR_TRACE_SUB_LEAF 0x01
/**
CPUID Intel Processor Trace EAX for CPUID leaf #CPUID_INTEL_PROCESSOR_TRACE,
sub-leaf #CPUID_INTEL_PROCESSOR_TRACE_SUB_LEAF.
**/
typedef union {
///
/// Individual bit fields
///
struct {
///
/// [Bits 2:0] Number of configurable Address Ranges for filtering.
///
UINT32 ConfigurableAddressRanges:3;
UINT32 Reserved:13;
///
/// [Bits 31:16] Bitmap of supported MTC period encodings
///
UINT32 MtcPeriodEncodings:16;
} Bits;
///
/// All bit fields as a 32-bit value
///
UINT32 Uint32;
} CPUID_INTEL_PROCESSOR_TRACE_SUB_LEAF_EAX;
/**
CPUID Intel Processor Trace EBX for CPUID leaf #CPUID_INTEL_PROCESSOR_TRACE,
sub-leaf #CPUID_INTEL_PROCESSOR_TRACE_SUB_LEAF.
**/
typedef union {
///
/// Individual bit fields
///
struct {
///
/// [Bits 15:0] Bitmap of supported Cycle Threshold value encodings.
///
UINT32 CycleThresholdEncodings:16;
///
/// [Bits 31:16] Bitmap of supported Configurable PSB frequency encodings.
///
UINT32 PsbFrequencyEncodings:16;
} Bits;
///
/// All bit fields as a 32-bit value
///
UINT32 Uint32;
} CPUID_INTEL_PROCESSOR_TRACE_SUB_LEAF_EBX;
/**
CPUID Time Stamp Counter and Nominal Core Crystal Clock Information
@note
If EBX[31:0] is 0, the TSC/"core crystal clock" ratio is not enumerated.
EBX[31:0]/EAX[31:0] indicates the ratio of the TSC frequency and the core
crystal clock frequency.
If ECX is 0, the nominal core crystal clock frequency is not enumerated.
"TSC frequency" = "core crystal clock frequency" * EBX/EAX.
The core crystal clock may differ from the reference clock, bus clock, or core
clock frequencies.
@param EAX CPUID_TIME_STAMP_COUNTER (0x15)
@retval EAX An unsigned integer which is the denominator of the
TSC/"core crystal clock" ratio
@retval EBX An unsigned integer which is the numerator of the
TSC/"core crystal clock" ratio.
@retval ECX An unsigned integer which is the nominal frequency
of the core crystal clock in Hz.
@retval EDX Reserved.
<b>Example usage</b>
@code
UINT32 Eax;
UINT32 Ebx;
UINT32 Ecx;
AsmCpuid (CPUID_TIME_STAMP_COUNTER, &Eax, &Ebx, &Ecx, NULL);
@endcode
**/
#define CPUID_TIME_STAMP_COUNTER 0x15
/**
CPUID Processor Frequency Information
@note
Data is returned from this interface in accordance with the processor's
specification and does not reflect actual values. Suitable use of this data
includes the display of processor information in like manner to the processor
brand string and for determining the appropriate range to use when displaying
processor information e.g. frequency history graphs. The returned information
should not be used for any other purpose as the returned information does not
accurately correlate to information / counters returned by other processor
interfaces. While a processor may support the Processor Frequency Information
leaf, fields that return a value of zero are not supported.
@param EAX CPUID_TIME_STAMP_COUNTER (0x16)
@retval EAX Returns processor base frequency information described by the
type CPUID_PROCESSOR_FREQUENCY_EAX.
@retval EBX Returns maximum frequency information described by the type
CPUID_PROCESSOR_FREQUENCY_EBX.
@retval ECX Returns bus frequency information described by the type
CPUID_PROCESSOR_FREQUENCY_ECX.
@retval EDX Reserved.
<b>Example usage</b>
@code
CPUID_PROCESSOR_FREQUENCY_EAX Eax;
CPUID_PROCESSOR_FREQUENCY_EBX Ebx;
CPUID_PROCESSOR_FREQUENCY_ECX Ecx;
AsmCpuid (CPUID_PROCESSOR_FREQUENCY, &Eax.Uint32, &Ebx.Uint32, &Ecx.Uint32, NULL);
@endcode
**/
#define CPUID_PROCESSOR_FREQUENCY 0x16
/**
CPUID Processor Frequency Information EAX for CPUID leaf
#CPUID_PROCESSOR_FREQUENCY.
**/
typedef union {
///
/// Individual bit fields
///
struct {
///
/// [Bits 15:0] Processor Base Frequency (in MHz).
///
UINT32 ProcessorBaseFrequency:16;
UINT32 Reserved:16;
} Bits;
///
/// All bit fields as a 32-bit value
///
UINT32 Uint32;
} CPUID_PROCESSOR_FREQUENCY_EAX;
/**
CPUID Processor Frequency Information EBX for CPUID leaf
#CPUID_PROCESSOR_FREQUENCY.
**/
typedef union {
///
/// Individual bit fields
///
struct {
///
/// [Bits 15:0] Maximum Frequency (in MHz).
///
UINT32 MaximumFrequency:16;
UINT32 Reserved:16;
} Bits;
///
/// All bit fields as a 32-bit value
///
UINT32 Uint32;
} CPUID_PROCESSOR_FREQUENCY_EBX;
/**
CPUID Processor Frequency Information ECX for CPUID leaf
#CPUID_PROCESSOR_FREQUENCY.
**/
typedef union {
///
/// Individual bit fields
///
struct {
///
/// [Bits 15:0] Bus (Reference) Frequency (in MHz).
///
UINT32 BusFrequency:16;
UINT32 Reserved:16;
} Bits;
///
/// All bit fields as a 32-bit value
///
UINT32 Uint32;
} CPUID_PROCESSOR_FREQUENCY_ECX;
/**
CPUID SoC Vendor Information
@param EAX CPUID_SOC_VENDOR (0x17)
@param ECX CPUID_SOC_VENDOR_MAIN_LEAF (0x00)
CPUID_SOC_VENDOR_BRAND_STRING1 (0x01)
CPUID_SOC_VENDOR_BRAND_STRING1 (0x02)
CPUID_SOC_VENDOR_BRAND_STRING1 (0x03)
@note
Leaf 17H output depends on the initial value in ECX. SOC Vendor Brand String
is a UTF-8 encoded string padded with trailing bytes of 00H. The complete SOC
Vendor Brand String is constructed by concatenating in ascending order of
EAX:EBX:ECX:EDX and from the sub-leaf 1 fragment towards sub-leaf 3.
**/
#define CPUID_SOC_VENDOR 0x17
/**
CPUID SoC Vendor Information
@param EAX CPUID_SOC_VENDOR (0x17)
@param ECX CPUID_SOC_VENDOR_MAIN_LEAF (0x00)
@retval EAX MaxSOCID_Index. Reports the maximum input value of supported
sub-leaf in leaf 17H.
@retval EBX Returns SoC Vendor information described by the type
CPUID_SOC_VENDOR_MAIN_LEAF_EBX.
@retval ECX Project ID. A unique number an SOC vendor assigns to its SOC
projects.
@retval EDX Stepping ID. A unique number within an SOC project that an SOC
vendor assigns.
<b>Example usage</b>
@code
UINT32 Eax;
CPUID_SOC_VENDOR_MAIN_LEAF_EBX Ebx;
UINT32 Ecx;
UINT32 Edx;
AsmCpuidEx (
CPUID_SOC_VENDOR, CPUID_SOC_VENDOR_MAIN_LEAF,
&Eax, &Ebx.Uint32, &Ecx, &Edx
);
@endcode
**/
#define CPUID_SOC_VENDOR_MAIN_LEAF 0x00
/**
CPUID SoC Vendor Information EBX for CPUID leaf #CPUID_SOC_VENDOR sub-leaf
#CPUID_SOC_VENDOR_MAIN_LEAF.
**/
typedef union {
///
/// Individual bit fields
///
struct {
///
/// [Bits 15:0] SOC Vendor ID.
///
UINT32 SocVendorId:16;
///
/// [Bit 16] If 1, the SOC Vendor ID field is assigned via an industry
/// standard enumeration scheme. Otherwise, the SOC Vendor ID field is
/// assigned by Intel.
///
UINT32 IsVendorScheme:1;
UINT32 Reserved:15;
} Bits;
///
/// All bit fields as a 32-bit value
///
UINT32 Uint32;
} CPUID_SOC_VENDOR_MAIN_LEAF_EBX;
/**
CPUID SoC Vendor Information
@param EAX CPUID_SOC_VENDOR (0x17)
@param ECX CPUID_SOC_VENDOR_BRAND_STRING1 (0x01)
@retval EAX SOC Vendor Brand String. UTF-8 encoded string of type
CPUID_SOC_VENDOR_BRAND_STRING_DATA.
@retval EBX SOC Vendor Brand String. UTF-8 encoded string of type
CPUID_SOC_VENDOR_BRAND_STRING_DATA.
@retval ECX SOC Vendor Brand String. UTF-8 encoded string of type
CPUID_SOC_VENDOR_BRAND_STRING_DATA.
@retval EDX SOC Vendor Brand String. UTF-8 encoded string of type
CPUID_SOC_VENDOR_BRAND_STRING_DATA.
<b>Example usage</b>
@code
CPUID_SOC_VENDOR_BRAND_STRING_DATA Eax;
CPUID_SOC_VENDOR_BRAND_STRING_DATA Ebx;
CPUID_SOC_VENDOR_BRAND_STRING_DATA Ecx;
CPUID_SOC_VENDOR_BRAND_STRING_DATA Edx;
AsmCpuidEx (
CPUID_SOC_VENDOR, CPUID_SOC_VENDOR_BRAND_STRING1,
&Eax.Uint32, &Ebx.Uint32, &Ecx.Uint32, &Edx.Uint32
);
@endcode
**/
#define CPUID_SOC_VENDOR_BRAND_STRING1 0x01
/**
CPUID SoC Vendor Brand String for CPUID leafs #CPUID_SOC_VENDOR_BRAND_STRING1,
#CPUID_SOC_VENDOR_BRAND_STRING2, and #CPUID_SOC_VENDOR_BRAND_STRING3.
**/
typedef union {
///
/// 4 UTF-8 characters of Soc Vendor Brand String
///
CHAR8 BrandString[4];
///
/// All fields as a 32-bit value
///
UINT32 Uint32;
} CPUID_SOC_VENDOR_BRAND_STRING_DATA;
/**
CPUID SoC Vendor Information
@param EAX CPUID_SOC_VENDOR (0x17)
@param ECX CPUID_SOC_VENDOR_BRAND_STRING2 (0x02)
@retval EAX SOC Vendor Brand String. UTF-8 encoded string of type
CPUID_SOC_VENDOR_BRAND_STRING_DATA.
@retval EBX SOC Vendor Brand String. UTF-8 encoded string of type
CPUID_SOC_VENDOR_BRAND_STRING_DATA.
@retval ECX SOC Vendor Brand String. UTF-8 encoded string of type
CPUID_SOC_VENDOR_BRAND_STRING_DATA.
@retval EDX SOC Vendor Brand String. UTF-8 encoded string of type
CPUID_SOC_VENDOR_BRAND_STRING_DATA.
<b>Example usage</b>
@code
CPUID_SOC_VENDOR_BRAND_STRING_DATA Eax;
CPUID_SOC_VENDOR_BRAND_STRING_DATA Ebx;
CPUID_SOC_VENDOR_BRAND_STRING_DATA Ecx;
CPUID_SOC_VENDOR_BRAND_STRING_DATA Edx;
AsmCpuidEx (
CPUID_SOC_VENDOR, CPUID_SOC_VENDOR_BRAND_STRING2,
&Eax.Uint32, &Ebx.Uint32, &Ecx.Uint32, &Edx.Uint32
);
@endcode
**/
#define CPUID_SOC_VENDOR_BRAND_STRING2 0x02
/**
CPUID SoC Vendor Information
@param EAX CPUID_SOC_VENDOR (0x17)
@param ECX CPUID_SOC_VENDOR_BRAND_STRING3 (0x03)
@retval EAX SOC Vendor Brand String. UTF-8 encoded string of type
CPUID_SOC_VENDOR_BRAND_STRING_DATA.
@retval EBX SOC Vendor Brand String. UTF-8 encoded string of type
CPUID_SOC_VENDOR_BRAND_STRING_DATA.
@retval ECX SOC Vendor Brand String. UTF-8 encoded string of type
CPUID_SOC_VENDOR_BRAND_STRING_DATA.
@retval EDX SOC Vendor Brand String. UTF-8 encoded string of type
CPUID_SOC_VENDOR_BRAND_STRING_DATA.
<b>Example usage</b>
@code
CPUID_SOC_VENDOR_BRAND_STRING_DATA Eax;
CPUID_SOC_VENDOR_BRAND_STRING_DATA Ebx;
CPUID_SOC_VENDOR_BRAND_STRING_DATA Ecx;
CPUID_SOC_VENDOR_BRAND_STRING_DATA Edx;
AsmCpuidEx (
CPUID_SOC_VENDOR, CPUID_SOC_VENDOR_BRAND_STRING3,
&Eax.Uint32, &Ebx.Uint32, &Ecx.Uint32, &Edx.Uint32
);
@endcode
**/
#define CPUID_SOC_VENDOR_BRAND_STRING3 0x03
/**
CPUID Deterministic Address Translation Parameters
@note
Each sub-leaf enumerates a different address translation structure.
If ECX contains an invalid sub-leaf index, EAX/EBX/ECX/EDX return 0. Sub-leaf
index n is invalid if n exceeds the value that sub-leaf 0 returns in EAX. A
sub-leaf index is also invalid if EDX[4:0] returns 0.
Valid sub-leaves do not need to be contiguous or in any particular order. A
valid sub-leaf may be in a higher input ECX value than an invalid sub-leaf or
than a valid sub-leaf of a higher or lower-level structure.
* Some unified TLBs will allow a single TLB entry to satisfy data read/write
and instruction fetches. Others will require separate entries (e.g., one
loaded on data read/write and another loaded on an instruction fetch).
Please see the Intel 64 and IA-32 Architectures Optimization Reference Manual
for details of a particular product.
** Add one to the return value to get the result.
@param EAX CPUID_DETERMINISTIC_ADDRESS_TRANSLATION_PARAMETERS (0x18)
@param ECX CPUID_DETERMINISTIC_ADDRESS_TRANSLATION_PARAMETERS_MAIN_LEAF (0x00)
CPUID_DETERMINISTIC_ADDRESS_TRANSLATION_PARAMETERS_SUB_LEAF (0x*)
**/
#define CPUID_DETERMINISTIC_ADDRESS_TRANSLATION_PARAMETERS 0x18
/**
CPUID Deterministic Address Translation Parameters
@param EAX CPUID_DETERMINISTIC_ADDRESS_TRANSLATION_PARAMETERS (0x18)
@param ECX CPUID_DETERMINISTIC_ADDRESS_TRANSLATION_PARAMETERS_MAIN_LEAF (0x00)
@retval EAX Reports the maximum input value of supported sub-leaf in leaf 18H.
@retval EBX Returns Deterministic Address Translation Parameters described by
the type CPUID_DETERMINISTIC_ADDRESS_TRANSLATION_PARAMETERS_EBX.
@retval ECX Number of Sets.
@retval EDX Returns Deterministic Address Translation Parameters described by
the type CPUID_DETERMINISTIC_ADDRESS_TRANSLATION_PARAMETERS_EDX.
<b>Example usage</b>
@code
UINT32 Eax;
CPUID_DETERMINISTIC_ADDRESS_TRANSLATION_PARAMETERS_EBX Ebx;
UINT32 Ecx;
CPUID_DETERMINISTIC_ADDRESS_TRANSLATION_PARAMETERS_EDX Edx;
AsmCpuidEx (
CPUID_DETERMINISTIC_ADDRESS_TRANSLATION_PARAMETERS,
CPUID_DETERMINISTIC_ADDRESS_TRANSLATION_PARAMETERS_MAIN_LEAF,
&Eax, &Ebx.Uint32, &Ecx, &Edx.Uint32
);
@endcode
**/
#define CPUID_DETERMINISTIC_ADDRESS_TRANSLATION_PARAMETERS_MAIN_LEAF 0x00
/**
CPUID Deterministic Address Translation Parameters EBX for CPUID leafs.
**/
typedef union {
///
/// Individual bit fields
///
struct {
///
/// [Bits 0] 4K page size entries supported by this structure.
///
UINT32 Page4K:1;
///
/// [Bits 1] 2MB page size entries supported by this structure.
///
UINT32 Page2M:1;
///
/// [Bits 2] 4MB page size entries supported by this structure.
///
UINT32 Page4M:1;
///
/// [Bits 3] 1 GB page size entries supported by this structure.
///
UINT32 Page1G:1;
///
/// [Bits 7:4] Reserved.
///
UINT32 Reserved1:4;
///
/// [Bits 10:8] Partitioning (0: Soft partitioning between the logical
/// processors sharing this structure)
///
UINT32 Partitioning:3;
///
/// [Bits 15:11] Reserved.
///
UINT32 Reserved2:5;
///
/// [Bits 31:16] W = Ways of associativity.
///
UINT32 Way:16;
} Bits;
///
/// All bit fields as a 32-bit value
///
UINT32 Uint32;
} CPUID_DETERMINISTIC_ADDRESS_TRANSLATION_PARAMETERS_EBX;
/**
CPUID Deterministic Address Translation Parameters EDX for CPUID leafs.
**/
typedef union {
///
/// Individual bit fields
///
struct {
///
/// [Bits 4:0] Translation cache type field.
///
UINT32 TranslationCacheType:5;
///
/// [Bits 7:5] Translation cache level (starts at 1).
///
UINT32 TranslationCacheLevel:3;
///
/// [Bits 8] Fully associative structure.
///
UINT32 FullyAssociative:1;
///
/// [Bits 13:9] Reserved.
///
UINT32 Reserved1:5;
///
/// [Bits 25:14] Maximum number of addressable IDs for logical
/// processors sharing this translation cache.
///
UINT32 MaximumNum:12;
///
/// [Bits 31:26] Reserved.
///
UINT32 Reserved2:6;
} Bits;
///
/// All bit fields as a 32-bit value
///
UINT32 Uint32;
} CPUID_DETERMINISTIC_ADDRESS_TRANSLATION_PARAMETERS_EDX;
///
/// @{ Define value for CPUID_DETERMINISTIC_ADDRESS_TRANSLATION_PARAMETERS_EDX.TranslationCacheType
///
#define CPUID_DETERMINISTIC_ADDRESS_TRANSLATION_PARAMETERS_TRANSLATION_CACHE_TYPE_INVALID 0x00
#define CPUID_DETERMINISTIC_ADDRESS_TRANSLATION_PARAMETERS_TRANSLATION_CACHE_TYPE_DATA_TLB 0x01
#define CPUID_DETERMINISTIC_ADDRESS_TRANSLATION_PARAMETERS_TRANSLATION_CACHE_TYPE_INSTRUCTION_TLB 0x02
#define CPUID_DETERMINISTIC_ADDRESS_TRANSLATION_PARAMETERS_TRANSLATION_CACHE_TYPE_UNIFIED_TLB 0x03
///
/// @}
///
/**
CPUID V2 Extended Topology Enumeration Leaf
@note
CPUID leaf 1FH is a preferred superset to leaf 0BH. Intel recommends first checking
for the existence of Leaf 1FH and using this if available.
Most of Leaf 1FH output depends on the initial value in ECX. The EDX output of leaf
1FH is always valid and does not vary with input value in ECX. Output value in ECX[7:0]
always equals input value in ECX[7:0]. Sub-leaf index 0 enumerates SMT level. Each
subsequent higher sub-leaf index enumerates a higher-level topological entity in
hierarchical order. For sub-leaves that return an invalid level-type of 0 in ECX[15:8];
EAX and EBX will return 0. If an input value n in ECX returns the invalid level-type of
0 in ECX[15:8], other input values with ECX > n also return 0 in ECX[15:8].
Software should use this field (EAX[4:0]) to enumerate processor topology of the system.
Software must not use EBX[15:0] to enumerate processor topology of the system. This value
in this field (EBX[15:0]) is only intended for display/diagnostic purposes. The actual
number of logical processors available to BIOS/OS/Applications may be different from the
value of EBX[15:0], depending on software and platform hardware configurations.
@param EAX CPUID_V2_EXTENDED_TOPOLOGY_ENUMERATION (0x1F)
@param ECX CPUID_V2_EXTENDED_TOPOLOGY_ENUMERATION_MAIN_LEAF (0x0)
**/
#define CPUID_V2_EXTENDED_TOPOLOGY_ENUMERATION 0x1F
/**
CPUID V2 Extended Topology Enumeration Leaf
@param EAX CPUID_V2_EXTENDED_TOPOLOGY_ENUMERATION (0x1F)
@param ECX CPUID_V2_EXTENDED_TOPOLOGY_ENUMERATION_MAIN_LEAF (0x00)
@retval EAX Returns V2 Extended Topology Enumeration Leaf described by
the type CPUID_V2_EXTENDED_TOPOLOGY_ENUMERATION_EAX.
@retval EBX Returns V2 Extended Topology Enumeration Leaf described by
the type CPUID_V2_EXTENDED_TOPOLOGY_ENUMERATION_EBX.
@retval ECX Returns V2 Extended Topology Enumeration Leaf described by
the type CPUID_V2_EXTENDED_TOPOLOGY_ENUMERATION_ECX.
@retval EDX Returns x2APIC ID the current logical processor.
<b>Example usage</b>
@code
CPUID_V2_EXTENDED_TOPOLOGY_ENUMERATION_EAX Eax;
CPUID_V2_EXTENDED_TOPOLOGY_ENUMERATION_EBX Ebx;
CPUID_V2_EXTENDED_TOPOLOGY_ENUMERATION_ECX Ecx;
UINT32 Edx;
AsmCpuidEx (
CPUID_V2_EXTENDED_TOPOLOGY_ENUMERATION,
CPUID_V2_EXTENDED_TOPOLOGY_ENUMERATION_MAIN_LEAF,
&Eax.Uint32, &Ebx.Uint32, &Ecx.Uint32, &Edx
);
@endcode
**/
#define CPUID_V2_EXTENDED_TOPOLOGY_ENUMERATION_MAIN_LEAF 0x00
/**
CPUID V2 Extended Topology Enumeration Leaf EAX for CPUID leafs.
**/
typedef union {
///
/// Individual bit fields
///
struct {
///
/// [Bits 4:0] Number of bits to shift right on x2APIC ID to get a unique
/// topology ID of the next level type. All logical processors with the
/// same next level ID share current level.
///
UINT32 BitsNum:5;
///
/// [Bits 31:5] Reserved.
///
UINT32 Reserved:27;
} Bits;
///
/// All bit fields as a 32-bit value
///
UINT32 Uint32;
} CPUID_V2_EXTENDED_TOPOLOGY_ENUMERATION_EAX;
/**
CPUID V2 Extended Topology Enumeration Leaf EBX for CPUID leafs.
**/
typedef union {
///
/// Individual bit fields
///
struct {
///
/// [Bits 15:0] Number of logical processors at this level type. The number
/// reflects configuration as shipped by Intel.
///
UINT32 ProcessorsNum:16;
///
/// [Bits 31:5] Reserved.
///
UINT32 Reserved:16;
} Bits;
///
/// All bit fields as a 32-bit value
///
UINT32 Uint32;
} CPUID_V2_EXTENDED_TOPOLOGY_ENUMERATION_EBX;
/**
CPUID V2 Extended Topology Enumeration Leaf ECX for CPUID leafs.
**/
typedef union {
///
/// Individual bit fields
///
struct {
///
/// [Bits 7:0] Level number. Same value in ECX input.
///
UINT32 LevelNum:8;
///
/// [Bits 7:0] Level type.
///
UINT32 LevelType:8;
///
/// [Bits 31:5] Reserved.
///
UINT32 Reserved:16;
} Bits;
///
/// All bit fields as a 32-bit value
///
UINT32 Uint32;
} CPUID_V2_EXTENDED_TOPOLOGY_ENUMERATION_ECX;
///
/// @{ Define value for CPUID_V2_EXTENDED_TOPOLOGY_ENUMERATION_ECX.LevelType
/// The value of the "level type" field is not related to level numbers in
/// any way, higher "level type" values do not mean higher levels.
///
#define CPUID_V2_EXTENDED_TOPOLOGY_ENUMERATION_LEVEL_TYPE_INVALID 0x00
#define CPUID_V2_EXTENDED_TOPOLOGY_ENUMERATION_LEVEL_TYPE_SMT 0x01
#define CPUID_V2_EXTENDED_TOPOLOGY_ENUMERATION_LEVEL_TYPE_CORE 0x02
#define CPUID_V2_EXTENDED_TOPOLOGY_ENUMERATION_LEVEL_TYPE_MODULE 0x03
#define CPUID_V2_EXTENDED_TOPOLOGY_ENUMERATION_LEVEL_TYPE_TILE 0x04
#define CPUID_V2_EXTENDED_TOPOLOGY_ENUMERATION_LEVEL_TYPE_DIE 0x05
///
/// @}
///
/**
CPUID Extended Function
@param EAX CPUID_EXTENDED_FUNCTION (0x80000000)
@retval EAX Maximum Input Value for Extended Function CPUID Information.
@retval EBX Reserved.
@retval ECX Reserved.
@retval EDX Reserved.
<b>Example usage</b>
@code
UINT32 Eax;
AsmCpuid (CPUID_EXTENDED_FUNCTION, &Eax, NULL, NULL, NULL);
@endcode
**/
#define CPUID_EXTENDED_FUNCTION 0x80000000
/**
CPUID Extended Processor Signature and Feature Bits
@param EAX CPUID_EXTENDED_CPU_SIG (0x80000001)
@retval EAX CPUID_EXTENDED_CPU_SIG.
@retval EBX Reserved.
@retval ECX Extended Processor Signature and Feature Bits information
described by the type CPUID_EXTENDED_CPU_SIG_ECX.
@retval EDX Extended Processor Signature and Feature Bits information
described by the type CPUID_EXTENDED_CPU_SIG_EDX.
<b>Example usage</b>
@code
UINT32 Eax;
CPUID_EXTENDED_CPU_SIG_ECX Ecx;
CPUID_EXTENDED_CPU_SIG_EDX Edx;
AsmCpuid (CPUID_EXTENDED_CPU_SIG, &Eax, NULL, &Ecx.Uint32, &Edx.Uint32);
@endcode
**/
#define CPUID_EXTENDED_CPU_SIG 0x80000001
/**
CPUID Extended Processor Signature and Feature Bits ECX for CPUID leaf
#CPUID_EXTENDED_CPU_SIG.
**/
typedef union {
///
/// Individual bit fields
///
struct {
///
/// [Bit 0] LAHF/SAHF available in 64-bit mode.
///
UINT32 LAHF_SAHF:1;
UINT32 Reserved1:4;
///
/// [Bit 5] LZCNT.
///
UINT32 LZCNT:1;
UINT32 Reserved2:2;
///
/// [Bit 8] PREFETCHW.
///
UINT32 PREFETCHW:1;
UINT32 Reserved3:23;
} Bits;
///
/// All bit fields as a 32-bit value
///
UINT32 Uint32;
} CPUID_EXTENDED_CPU_SIG_ECX;
/**
CPUID Extended Processor Signature and Feature Bits EDX for CPUID leaf
#CPUID_EXTENDED_CPU_SIG.
**/
typedef union {
///
/// Individual bit fields
///
struct {
UINT32 Reserved1:11;
///
/// [Bit 11] SYSCALL/SYSRET available in 64-bit mode.
///
UINT32 SYSCALL_SYSRET:1;
UINT32 Reserved2:8;
///
/// [Bit 20] Execute Disable Bit available.
///
UINT32 NX:1;
UINT32 Reserved3:5;
///
/// [Bit 26] 1-GByte pages are available if 1.
///
UINT32 Page1GB:1;
///
/// [Bit 27] RDTSCP and IA32_TSC_AUX are available if 1.
///
UINT32 RDTSCP:1;
UINT32 Reserved4:1;
///
/// [Bit 29] Intel(R) 64 Architecture available if 1.
///
UINT32 LM:1;
UINT32 Reserved5:2;
} Bits;
///
/// All bit fields as a 32-bit value
///
UINT32 Uint32;
} CPUID_EXTENDED_CPU_SIG_EDX;
/**
CPUID Processor Brand String
@param EAX CPUID_BRAND_STRING1 (0x80000002)
@retval EAX Processor Brand String in type CPUID_BRAND_STRING_DATA.
@retval EBX Processor Brand String Continued in type CPUID_BRAND_STRING_DATA.
@retval ECX Processor Brand String Continued in type CPUID_BRAND_STRING_DATA.
@retval EDX Processor Brand String Continued in type CPUID_BRAND_STRING_DATA.
<b>Example usage</b>
@code
CPUID_BRAND_STRING_DATA Eax;
CPUID_BRAND_STRING_DATA Ebx;
CPUID_BRAND_STRING_DATA Ecx;
CPUID_BRAND_STRING_DATA Edx;
AsmCpuid (CPUID_BRAND_STRING1, &Eax.Uint32, &Ebx.Uint32, &Ecx.Uint32, &Edx.Uint32);
@endcode
**/
#define CPUID_BRAND_STRING1 0x80000002
/**
CPUID Processor Brand String for CPUID leafs #CPUID_BRAND_STRING1,
#CPUID_BRAND_STRING2, and #CPUID_BRAND_STRING3.
**/
typedef union {
///
/// 4 ASCII characters of Processor Brand String
///
CHAR8 BrandString[4];
///
/// All fields as a 32-bit value
///
UINT32 Uint32;
} CPUID_BRAND_STRING_DATA;
/**
CPUID Processor Brand String
@param EAX CPUID_BRAND_STRING2 (0x80000003)
@retval EAX Processor Brand String Continued in type CPUID_BRAND_STRING_DATA.
@retval EBX Processor Brand String Continued in type CPUID_BRAND_STRING_DATA.
@retval ECX Processor Brand String Continued in type CPUID_BRAND_STRING_DATA.
@retval EDX Processor Brand String Continued in type CPUID_BRAND_STRING_DATA.
<b>Example usage</b>
@code
CPUID_BRAND_STRING_DATA Eax;
CPUID_BRAND_STRING_DATA Ebx;
CPUID_BRAND_STRING_DATA Ecx;
CPUID_BRAND_STRING_DATA Edx;
AsmCpuid (CPUID_BRAND_STRING2, &Eax.Uint32, &Ebx.Uint32, &Ecx.Uint32, &Edx.Uint32);
@endcode
**/
#define CPUID_BRAND_STRING2 0x80000003
/**
CPUID Processor Brand String
@param EAX CPUID_BRAND_STRING3 (0x80000004)
@retval EAX Processor Brand String Continued in type CPUID_BRAND_STRING_DATA.
@retval EBX Processor Brand String Continued in type CPUID_BRAND_STRING_DATA.
@retval ECX Processor Brand String Continued in type CPUID_BRAND_STRING_DATA.
@retval EDX Processor Brand String Continued in type CPUID_BRAND_STRING_DATA.
<b>Example usage</b>
@code
CPUID_BRAND_STRING_DATA Eax;
CPUID_BRAND_STRING_DATA Ebx;
CPUID_BRAND_STRING_DATA Ecx;
CPUID_BRAND_STRING_DATA Edx;
AsmCpuid (CPUID_BRAND_STRING3, &Eax.Uint32, &Ebx.Uint32, &Ecx.Uint32, &Edx.Uint32);
@endcode
**/
#define CPUID_BRAND_STRING3 0x80000004
/**
CPUID Extended Cache information
@param EAX CPUID_EXTENDED_CACHE_INFO (0x80000006)
@retval EAX Reserved.
@retval EBX Reserved.
@retval ECX Extended cache information described by the type
CPUID_EXTENDED_CACHE_INFO_ECX.
@retval EDX Reserved.
<b>Example usage</b>
@code
CPUID_EXTENDED_CACHE_INFO_ECX Ecx;
AsmCpuid (CPUID_EXTENDED_CACHE_INFO, NULL, NULL, &Ecx.Uint32, NULL);
@endcode
**/
#define CPUID_EXTENDED_CACHE_INFO 0x80000006
/**
CPUID Extended Cache information ECX for CPUID leaf #CPUID_EXTENDED_CACHE_INFO.
**/
typedef union {
///
/// Individual bit fields
///
struct {
///
/// [Bits 7:0] Cache line size in bytes.
///
UINT32 CacheLineSize:8;
UINT32 Reserved:4;
///
/// [Bits 15:12] L2 Associativity field. Supported values are in the range
/// #CPUID_EXTENDED_CACHE_INFO_ECX_L2_ASSOCIATIVITY_DISABLED to
/// #CPUID_EXTENDED_CACHE_INFO_ECX_L2_ASSOCIATIVITY_FULL
///
UINT32 L2Associativity:4;
///
/// [Bits 31:16] Cache size in 1K units.
///
UINT32 CacheSize:16;
} Bits;
///
/// All bit fields as a 32-bit value
///
UINT32 Uint32;
} CPUID_EXTENDED_CACHE_INFO_ECX;
///
/// @{ Define value for bit field CPUID_EXTENDED_CACHE_INFO_ECX.L2Associativity
///
#define CPUID_EXTENDED_CACHE_INFO_ECX_L2_ASSOCIATIVITY_DISABLED 0x00
#define CPUID_EXTENDED_CACHE_INFO_ECX_L2_ASSOCIATIVITY_DIRECT_MAPPED 0x01
#define CPUID_EXTENDED_CACHE_INFO_ECX_L2_ASSOCIATIVITY_2_WAY 0x02
#define CPUID_EXTENDED_CACHE_INFO_ECX_L2_ASSOCIATIVITY_4_WAY 0x04
#define CPUID_EXTENDED_CACHE_INFO_ECX_L2_ASSOCIATIVITY_8_WAY 0x06
#define CPUID_EXTENDED_CACHE_INFO_ECX_L2_ASSOCIATIVITY_16_WAY 0x08
#define CPUID_EXTENDED_CACHE_INFO_ECX_L2_ASSOCIATIVITY_32_WAY 0x0A
#define CPUID_EXTENDED_CACHE_INFO_ECX_L2_ASSOCIATIVITY_48_WAY 0x0B
#define CPUID_EXTENDED_CACHE_INFO_ECX_L2_ASSOCIATIVITY_64_WAY 0x0C
#define CPUID_EXTENDED_CACHE_INFO_ECX_L2_ASSOCIATIVITY_96_WAY 0x0D
#define CPUID_EXTENDED_CACHE_INFO_ECX_L2_ASSOCIATIVITY_128_WAY 0x0E
#define CPUID_EXTENDED_CACHE_INFO_ECX_L2_ASSOCIATIVITY_FULL 0x0F
///
/// @}
///
/**
CPUID Extended Time Stamp Counter information
@param EAX CPUID_EXTENDED_TIME_STAMP_COUNTER (0x80000007)
@retval EAX Reserved.
@retval EBX Reserved.
@retval ECX Reserved.
@retval EDX Extended time stamp counter (TSC) information described by the
type CPUID_EXTENDED_TIME_STAMP_COUNTER_EDX.
<b>Example usage</b>
@code
CPUID_EXTENDED_TIME_STAMP_COUNTER_EDX Edx;
AsmCpuid (CPUID_EXTENDED_TIME_STAMP_COUNTER, NULL, NULL, NULL, &Edx.Uint32);
@endcode
**/
#define CPUID_EXTENDED_TIME_STAMP_COUNTER 0x80000007
/**
CPUID Extended Time Stamp Counter information EDX for CPUID leaf
#CPUID_EXTENDED_TIME_STAMP_COUNTER.
**/
typedef union {
///
/// Individual bit fields
///
struct {
UINT32 Reserved1:8;
///
/// [Bit 8] Invariant TSC available if 1.
///
UINT32 InvariantTsc:1;
UINT32 Reserved2:23;
} Bits;
///
/// All bit fields as a 32-bit value
///
UINT32 Uint32;
} CPUID_EXTENDED_TIME_STAMP_COUNTER_EDX;
/**
CPUID Linear Physical Address Size
@param EAX CPUID_VIR_PHY_ADDRESS_SIZE (0x80000008)
@retval EAX Linear/Physical Address Size described by the type
CPUID_VIR_PHY_ADDRESS_SIZE_EAX.
@retval EBX Reserved.
@retval ECX Reserved.
@retval EDX Reserved.
<b>Example usage</b>
@code
CPUID_VIR_PHY_ADDRESS_SIZE_EAX Eax;
AsmCpuid (CPUID_VIR_PHY_ADDRESS_SIZE, &Eax.Uint32, NULL, NULL, NULL);
@endcode
**/
#define CPUID_VIR_PHY_ADDRESS_SIZE 0x80000008
/**
CPUID Linear Physical Address Size EAX for CPUID leaf
#CPUID_VIR_PHY_ADDRESS_SIZE.
**/
typedef union {
///
/// Individual bit fields
///
struct {
///
/// [Bits 7:0] Number of physical address bits.
///
/// @note
/// If CPUID.80000008H:EAX[7:0] is supported, the maximum physical address
/// number supported should come from this field.
///
UINT32 PhysicalAddressBits:8;
///
/// [Bits 15:8] Number of linear address bits.
///
UINT32 LinearAddressBits:8;
UINT32 Reserved:16;
} Bits;
///
/// All bit fields as a 32-bit value
///
UINT32 Uint32;
} CPUID_VIR_PHY_ADDRESS_SIZE_EAX;
#endif
|