TianoCore EDK2 master
Loading...
Searching...
No Matches
CpuIdEx.c
Go to the documentation of this file.
1
41UINT32
42EFIAPI
44 IN UINT32 Index,
45 IN UINT32 SubIndex,
46 OUT UINT32 *RegisterEax OPTIONAL,
47 OUT UINT32 *RegisterEbx OPTIONAL,
48 OUT UINT32 *RegisterEcx OPTIONAL,
49 OUT UINT32 *RegisterEdx OPTIONAL
50 )
51{
52 _asm {
53 mov eax, Index
54 mov ecx, SubIndex
55 cpuid
56 push ecx
57 mov ecx, RegisterEax
58 jecxz SkipEax
59 mov [ecx], eax
60SkipEax:
61 mov ecx, RegisterEbx
62 jecxz SkipEbx
63 mov [ecx], ebx
64SkipEbx:
65 pop eax
66 mov ecx, RegisterEcx
67 jecxz SkipEcx
68 mov [ecx], eax
69SkipEcx:
70 mov ecx, RegisterEdx
71 jecxz SkipEdx
72 mov [ecx], edx
73SkipEdx:
74 mov eax, Index
75 }
76}
UINT32 EFIAPI AsmCpuidEx(IN UINT32 Index, IN UINT32 SubIndex, OUT UINT32 *RegisterEax OPTIONAL, OUT UINT32 *RegisterEbx OPTIONAL, OUT UINT32 *RegisterEcx OPTIONAL, OUT UINT32 *RegisterEdx OPTIONAL)
Definition: CpuIdEx.c:43
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284