4 typedef unsigned int UInt
;
5 typedef unsigned long long int ULong
;
7 void cpuid ( UInt
* eax
, UInt
* ebx
, UInt
* ecx
, UInt
* edx
,
8 UInt index
, UInt ecx_in
)
12 : "=a" (a
), "=b" (b
), "=c" (c
), "=d" (d
) \
13 : "0" (index
), "2"(ecx_in
) );
14 *eax
= a
; *ebx
= b
; *ecx
= c
; *edx
= d
;
15 printf("%08x %08x -> %08x %08x %08x %08x\n",
16 index
,ecx_in
, a
,b
,c
,d
);
21 UInt eax
, ebx
, ecx
, edx
;
22 UInt maxidx
, maxextidx
, i
,ecx_in
;
25 cpuid(&eax
,&ebx
,&ecx
,&edx
, 0,0);
27 for (i
= 1; i
<= maxidx
+5; i
++) {
31 if (i
== 4) subleaf
= 10;
32 if (i
== 7) subleaf
= 10;
33 if (i
== 0xB) subleaf
= 10;
34 if (i
== 0xD) subleaf
= 10;
36 if (subleaf
> 0) printf("\n");
38 cpuid(&eax
,&ebx
,&ecx
,&edx
, i
,0);
40 for (ecx_in
= 1; ecx_in
< subleaf
; ecx_in
++) {
41 cpuid(&eax
,&ebx
,&ecx
,&edx
, i
,ecx_in
);
44 if (subleaf
> 0) printf("\n");
50 cpuid(&eax
,&ebx
,&ecx
,&edx
, 0x80000000,0);
52 for (i
= 0x80000001; i
<= maxextidx
+5; i
++) {
53 cpuid(&eax
,&ebx
,&ecx
,&edx
, i
,0);
57 cpuid(&eax
,&ebx
,&ecx
,&edx
, 1234,0);
58 cpuid(&eax
,&ebx
,&ecx
,&edx
, 0x800004d3,0);