TianoCore EDK2 master
CpuId.c
Go to the documentation of this file.
1
34UINT32
35EFIAPI
37 IN UINT32 Index,
38 OUT UINT32 *RegisterEax OPTIONAL,
39 OUT UINT32 *RegisterEbx OPTIONAL,
40 OUT UINT32 *RegisterEcx OPTIONAL,
41 OUT UINT32 *RegisterEdx OPTIONAL
42 )
43{
44 _asm {
45 mov eax, Index
46 cpuid
47 push ecx
48 mov ecx, RegisterEax
49 jecxz SkipEax
50 mov [ecx], eax
51SkipEax:
52 mov ecx, RegisterEbx
53 jecxz SkipEbx
54 mov [ecx], ebx
55SkipEbx:
56 pop eax
57 mov ecx, RegisterEcx
58 jecxz SkipEcx
59 mov [ecx], eax
60SkipEcx:
61 mov ecx, RegisterEdx
62 jecxz SkipEdx
63 mov [ecx], edx
64SkipEdx:
65 mov eax, Index
66 }
67}
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
UINT32 EFIAPI AsmCpuid(IN UINT32 Index, OUT UINT32 *RegisterEax OPTIONAL, OUT UINT32 *RegisterEbx OPTIONAL, OUT UINT32 *RegisterEcx OPTIONAL, OUT UINT32 *RegisterEdx OPTIONAL)
Definition: CpuId.c:36