13cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei/** @file 23cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei 33cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR> 43cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei 53cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei 63cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei This program and the accompanying materials are licensed and made available under 73cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei 83cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei the terms and conditions of the BSD License that accompanies this distribution. 93cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei 103cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei The full text of the license may be found at 113cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei 123cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei http://opensource.org/licenses/bsd-license.php. 133cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei 143cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei 153cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei 163cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 173cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei 183cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 193cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei 203cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei 213cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei 223cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei 233cbfba02fef9dae07a041fdbf2e89611d72d6f90David WeiModule Name: 243cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei 253cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei PlatformCpuInfoDxe.c 263cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei 273cbfba02fef9dae07a041fdbf2e89611d72d6f90David WeiAbstract: 283cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei Platform Cpu Info driver to public platform related HOB data 293cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei 303cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei--*/ 313cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei 323cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei#include "PlatformCpuInfoDxe.h" 333cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei 343cbfba02fef9dae07a041fdbf2e89611d72d6f90David WeiCHAR16 EfiPlatformCpuInfoVariable[] = L"PlatformCpuInfo"; 353cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei 363cbfba02fef9dae07a041fdbf2e89611d72d6f90David WeiEFI_STATUS 373cbfba02fef9dae07a041fdbf2e89611d72d6f90David WeiEFIAPI 383cbfba02fef9dae07a041fdbf2e89611d72d6f90David WeiPlatformCpuInfoInit ( 393cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei IN EFI_HANDLE ImageHandle, 403cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei IN EFI_SYSTEM_TABLE *SystemTable 413cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei ) 423cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei{ 433cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei EFI_STATUS Status; 443cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei EFI_PLATFORM_CPU_INFO *PlatformCpuInfoPtr; 453cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei EFI_PEI_HOB_POINTERS GuidHob; 463cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei 473cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei // 483cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei // Get Platform Cpu Info HOB 493cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei // 503cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei GuidHob.Raw = GetHobList (); 513cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei while ((GuidHob.Raw = GetNextGuidHob (&gEfiPlatformCpuInfoGuid, GuidHob.Raw)) != NULL) { 523cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei PlatformCpuInfoPtr = GET_GUID_HOB_DATA (GuidHob.Guid); 533cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei GuidHob.Raw = GET_NEXT_HOB (GuidHob); 543cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei 553cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei // 563cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei // Write the Platform CPU Info to volatile memory for runtime purposes. 573cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei // This must be done in its own driver because SetVariable protocol is dependent on chipset, 583cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei // which is dependent on CpuIo, PlatformInfo, and Metronome. 593cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei // 603cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei Status = gRT->SetVariable( 613cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei EfiPlatformCpuInfoVariable, 623cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei &gEfiVlv2VariableGuid, 633cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS, 643cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei sizeof(EFI_PLATFORM_CPU_INFO), 653cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei PlatformCpuInfoPtr 66 ); 67 if (EFI_ERROR(Status)) { 68 return Status; 69 } 70 } 71 72 return EFI_SUCCESS; 73} 74 75