3 Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials are licensed and made available under
6 the terms and conditions of the BSD License that accompanies this distribution.
7 The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php.
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
21 Provide cpu version extract considering extended family & model ID.
24 #include <Library/CpuIA32.h>
27 Extract CPU detail version infomation
29 @param FamilyId FamilyId, including ExtendedFamilyId
30 @param Model Model, including ExtendedModel
31 @param SteppingId SteppingId
32 @param Processor Processor
38 IN OUT UINT16
*FamilyId
, OPTIONAL
39 IN OUT UINT8
*Model
, OPTIONAL
40 IN OUT UINT8
*SteppingId
, OPTIONAL
41 IN OUT UINT8
*Processor OPTIONAL
45 EFI_CPUID_REGISTER Register
;
48 EfiCpuid (EFI_CPUID_VERSION_INFO
, &Register
);
50 if (SteppingId
!= NULL
) {
51 *SteppingId
= (UINT8
) (Register
.RegEax
& 0xF);
54 if (Processor
!= NULL
) {
55 *Processor
= (UINT8
) ((Register
.RegEax
>> 12) & 0x3);
58 if (Model
!= NULL
|| FamilyId
!= NULL
) {
59 TempFamilyId
= (UINT8
) ((Register
.RegEax
>> 8) & 0xF);
62 *Model
= (UINT8
) ((Register
.RegEax
>> 4) & 0xF);
63 if (TempFamilyId
== 0x6 || TempFamilyId
== 0xF) {
64 *Model
= (UINT8
) (*Model
| ((Register
.RegEax
>> 12) & 0xF0));
68 if (FamilyId
!= NULL
) {
69 *FamilyId
= TempFamilyId
;
70 if (TempFamilyId
== 0xF) {
71 *FamilyId
= (UINT8
) (*FamilyId
+ (UINT16
) ((Register
.RegEax
>> 20) & 0xFF));