TianoCore EDK2 master
BaseUefiCpuLib.c
Go to the documentation of this file.
1
13#include <Register/Amd/Cpuid.h>
14
15#include <Library/BaseLib.h>
16#include <Library/UefiCpuLib.h>
17
25BOOLEAN
26EFIAPI
28 VOID
29 )
30{
31 UINT32 RegEbx;
32 UINT32 RegEcx;
33 UINT32 RegEdx;
34
35 AsmCpuid (CPUID_SIGNATURE, NULL, &RegEbx, &RegEcx, &RegEdx);
36 return (RegEbx == CPUID_SIGNATURE_AUTHENTIC_AMD_EBX &&
37 RegEcx == CPUID_SIGNATURE_AUTHENTIC_AMD_ECX &&
38 RegEdx == CPUID_SIGNATURE_AUTHENTIC_AMD_EDX);
39}
40
46UINT32
47EFIAPI
49 VOID
50 )
51{
53
54 AsmCpuid (CPUID_VERSION_INFO, &Eax.Uint32, NULL, NULL, NULL);
55
56 //
57 // Mask other fields than Family and Model.
58 //
59 Eax.Bits.SteppingId = 0;
60 Eax.Bits.ProcessorType = 0;
61 Eax.Bits.Reserved1 = 0;
62 Eax.Bits.Reserved2 = 0;
63 return Eax.Uint32;
64}
65
70UINT8
71EFIAPI
73 VOID
74 )
75{
77
78 AsmCpuid (CPUID_VERSION_INFO, &Eax.Uint32, NULL, NULL, NULL);
79
80 return (UINT8)Eax.Bits.SteppingId;
81}
#define NULL
Definition: Base.h:312
UINT8 EFIAPI GetCpuSteppingId(VOID)
BOOLEAN EFIAPI StandardSignatureIsAuthenticAMD(VOID)
UINT32 EFIAPI GetCpuFamilyModel(VOID)
#define CPUID_SIGNATURE_AUTHENTIC_AMD_EBX
Definition: Cpuid.h:38
#define CPUID_SIGNATURE
Definition: Cpuid.h:45
#define CPUID_VERSION_INFO
Definition: Cpuid.h:81
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