The library routines are UEFI specification compliant.\r
\r
Copyright (c) 2020, AMD Inc. All rights reserved.<BR>\r
+ Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>\r
SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
**/\r
RegEcx == CPUID_SIGNATURE_AUTHENTIC_AMD_ECX &&\r
RegEdx == CPUID_SIGNATURE_AUTHENTIC_AMD_EDX);\r
}\r
+\r
+/**\r
+ Return the 32bit CPU family and model value.\r
+\r
+ @return CPUID[01h].EAX with Processor Type and Stepping ID cleared.\r
+**/\r
+UINT32\r
+EFIAPI\r
+GetCpuFamilyModel (\r
+ VOID\r
+ )\r
+{\r
+ CPUID_VERSION_INFO_EAX Eax;\r
+\r
+ AsmCpuid (CPUID_VERSION_INFO, &Eax.Uint32, NULL, NULL, NULL);\r
+\r
+ //\r
+ // Mask other fields than Family and Model.\r
+ //\r
+ Eax.Bits.SteppingId = 0;\r
+ Eax.Bits.ProcessorType = 0;\r
+ Eax.Bits.Reserved1 = 0;\r
+ Eax.Bits.Reserved2 = 0;\r
+ return Eax.Uint32;\r
+}\r
+\r
+/**\r
+ Return the CPU stepping ID.\r
+ @return CPU stepping ID value in CPUID[01h].EAX.\r
+**/\r
+UINT8\r
+EFIAPI\r
+GetCpuSteppingId (\r
+ VOID\r
+ )\r
+{\r
+ CPUID_VERSION_INFO_EAX Eax;\r
+\r
+ AsmCpuid (CPUID_VERSION_INFO, &Eax.Uint32, NULL, NULL, NULL);\r
+\r
+ return (UINT8) Eax.Bits.SteppingId;\r
+}\r