2 This library defines some routines that are generic for IA32 family CPU.
4 The library routines are UEFI specification compliant.
6 Copyright (c) 2020, AMD Inc. All rights reserved.<BR>
7 Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
8 SPDX-License-Identifier: BSD-2-Clause-Patent
12 #include <Register/Intel/Cpuid.h>
13 #include <Register/Amd/Cpuid.h>
15 #include <Library/BaseLib.h>
16 #include <Library/UefiCpuLib.h>
19 Determine if the standard CPU signature is "AuthenticAMD".
21 @retval TRUE The CPU signature matches.
22 @retval FALSE The CPU signature does not match.
27 StandardSignatureIsAuthenticAMD (
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
);
42 Return the 32bit CPU family and model value.
44 @return CPUID[01h].EAX with Processor Type and Stepping ID cleared.
52 CPUID_VERSION_INFO_EAX Eax
;
54 AsmCpuid (CPUID_VERSION_INFO
, &Eax
.Uint32
, NULL
, NULL
, NULL
);
57 // Mask other fields than Family and Model.
59 Eax
.Bits
.SteppingId
= 0;
60 Eax
.Bits
.ProcessorType
= 0;
61 Eax
.Bits
.Reserved1
= 0;
62 Eax
.Bits
.Reserved2
= 0;
67 Return the CPU stepping ID.
68 @return CPU stepping ID value in CPUID[01h].EAX.
76 CPUID_VERSION_INFO_EAX Eax
;
78 AsmCpuid (CPUID_VERSION_INFO
, &Eax
.Uint32
, NULL
, NULL
, NULL
);
80 return (UINT8
) Eax
.Bits
.SteppingId
;