]> git.proxmox.com Git - mirror_edk2.git/blame - EdkCompatibilityPkg/Foundation/Cpu/Pentium/CpuIA32Lib/EfiCpuVersion.c
Update the copyright notice format
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Cpu / Pentium / CpuIA32Lib / EfiCpuVersion.c
CommitLineData
3eb9473e 1/*++\r
2\r
f57387d5
HT
3Copyright (c) 2004 - 2006, Intel Corporation. All rights reserved.<BR>\r
4This program and the accompanying materials \r
3eb9473e 5are licensed and made available under the terms and conditions of the BSD License \r
6which accompanies this distribution. The full text of the license may be found at \r
7http://opensource.org/licenses/bsd-license.php \r
8 \r
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
11\r
12Module Name:\r
13\r
14 EfiCpuVersion.c\r
15 \r
16Abstract:\r
17 \r
18 Provide cpu version extract considering extended family & model ID.\r
19--*/\r
20\r
21#include "CpuIA32.h"\r
22\r
23VOID\r
24EfiCpuVersion (\r
25 IN OUT UINT16 *FamilyId, OPTIONAL\r
26 IN OUT UINT8 *Model, OPTIONAL\r
27 IN OUT UINT8 *SteppingId, OPTIONAL\r
28 IN OUT UINT8 *Processor OPTIONAL\r
29 )\r
30/*++\r
31\r
32Routine Description:\r
33 Extract CPU detail version infomation\r
34\r
35Arguments:\r
36 FamilyId - FamilyId, including ExtendedFamilyId\r
37 Model - Model, including ExtendedModel\r
38 SteppingId - SteppingId\r
39 Processor - Processor\r
40\r
41--*/\r
42{\r
43 EFI_CPUID_REGISTER Register;\r
44 UINT8 TempFamilyId;\r
45 \r
46 EfiCpuid (EFI_CPUID_VERSION_INFO, &Register);\r
47 \r
48 if (SteppingId != NULL) {\r
49 *SteppingId = (UINT8) (Register.RegEax & 0xF);\r
50 }\r
51\r
52 if (Processor != NULL) {\r
53 *Processor = (UINT8) ((Register.RegEax >> 12) & 0x3);\r
54 }\r
55\r
56 if (Model != NULL || FamilyId != NULL) {\r
57 TempFamilyId = (UINT8) ((Register.RegEax >> 8) & 0xF);\r
58 \r
59 if (Model != NULL) {\r
60 *Model = (UINT8) ((Register.RegEax >> 4) & 0xF);\r
61 if (TempFamilyId == 0x6 || TempFamilyId == 0xF) {\r
8e35b681 62 *Model = (UINT8) (*Model | ((Register.RegEax >> 12) & 0xF0));\r
3eb9473e 63 }\r
64 }\r
65 \r
66 if (FamilyId != NULL) {\r
67 *FamilyId = TempFamilyId;\r
68 if (TempFamilyId == 0xF) {\r
8e35b681 69 *FamilyId = (UINT8 ) (*FamilyId + (UINT16) ((Register.RegEax >> 20) & 0xFF));\r
3eb9473e 70 }\r
71 }\r
72 } \r
73}\r