]> git.proxmox.com Git - mirror_edk2.git/blame - Vlv2TbltDevicePkg/PlatformCpuInfoDxe/PlatformCpuInfoDxe.c
UefiCpuPkg/PiSmmCpuDxeSmm: patch "gSmiCr3" with PatchInstructionX86()
[mirror_edk2.git] / Vlv2TbltDevicePkg / PlatformCpuInfoDxe / PlatformCpuInfoDxe.c
CommitLineData
3cbfba02
DW
1/** @file\r
2\r
3 Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>\r
4 \r\r
5 This program and the accompanying materials are licensed and made available under\r\r
6 the terms and conditions of the BSD License that accompanies this distribution. \r\r
7 The full text of the license may be found at \r\r
8 http://opensource.org/licenses/bsd-license.php. \r\r
9 \r\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r\r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r\r
12 \r\r
13\r
14Module Name:\r
15\r
16 PlatformCpuInfoDxe.c\r
17\r
18Abstract:\r
19 Platform Cpu Info driver to public platform related HOB data\r
20\r
21--*/\r
22\r
23#include "PlatformCpuInfoDxe.h"\r
24\r
25CHAR16 EfiPlatformCpuInfoVariable[] = L"PlatformCpuInfo";\r
26\r
27EFI_STATUS\r
28EFIAPI\r
29PlatformCpuInfoInit (\r
30 IN EFI_HANDLE ImageHandle,\r
31 IN EFI_SYSTEM_TABLE *SystemTable\r
32 )\r
33{\r
34 EFI_STATUS Status;\r
35 EFI_PLATFORM_CPU_INFO *PlatformCpuInfoPtr;\r
36 EFI_PEI_HOB_POINTERS GuidHob;\r
37\r
38 //\r
39 // Get Platform Cpu Info HOB\r
40 //\r
41 GuidHob.Raw = GetHobList ();\r
42 while ((GuidHob.Raw = GetNextGuidHob (&gEfiPlatformCpuInfoGuid, GuidHob.Raw)) != NULL) {\r
43 PlatformCpuInfoPtr = GET_GUID_HOB_DATA (GuidHob.Guid);\r
44 GuidHob.Raw = GET_NEXT_HOB (GuidHob);\r
45\r
46 //\r
47 // Write the Platform CPU Info to volatile memory for runtime purposes.\r
48 // This must be done in its own driver because SetVariable protocol is dependent on chipset,\r
49 // which is dependent on CpuIo, PlatformInfo, and Metronome.\r
50 //\r
51 Status = gRT->SetVariable(\r
52 EfiPlatformCpuInfoVariable,\r
53 &gEfiVlv2VariableGuid,\r
54 EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,\r
55 sizeof(EFI_PLATFORM_CPU_INFO),\r
56 PlatformCpuInfoPtr\r
57 );\r
58 if (EFI_ERROR(Status)) {\r
59 return Status;\r
60 }\r
61 }\r
62\r
63 return EFI_SUCCESS;\r
64}\r
65\r