From 65ab4e73b66b029b8a8ccdb5212c1bafe2539c53 Mon Sep 17 00:00:00 2001 From: Jeff Fan Date: Tue, 24 May 2016 21:42:19 +0800 Subject: UefiCpuPkg/CpuMpPei: Consume CpuExceptionHandlerLib Cc: Michael Kinney Cc: Jiewen Yao Cc: Feng Tian Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan Reviewed-by: Feng Tian (cherry picked from commit 9bedfb2f5b23c68c600770a9f853092d01eab6d4) --- UefiCpuPkg/CpuMpPei/CpuMpPei.c | 21 +++++++++++++++++++-- UefiCpuPkg/CpuMpPei/CpuMpPei.h | 4 +++- UefiCpuPkg/CpuMpPei/CpuMpPei.inf | 5 ++++- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/UefiCpuPkg/CpuMpPei/CpuMpPei.c b/UefiCpuPkg/CpuMpPei/CpuMpPei.c index 9da1b64732..bccff24cc1 100644 --- a/UefiCpuPkg/CpuMpPei/CpuMpPei.c +++ b/UefiCpuPkg/CpuMpPei/CpuMpPei.c @@ -852,14 +852,31 @@ CpuMpPeimInit ( IN CONST EFI_PEI_SERVICES **PeiServices ) { - EFI_STATUS Status; - PEI_CPU_MP_DATA *PeiCpuMpData; + EFI_STATUS Status; + PEI_CPU_MP_DATA *PeiCpuMpData; + EFI_VECTOR_HANDOFF_INFO *VectorInfo; + EFI_PEI_VECTOR_HANDOFF_INFO_PPI *VectorHandoffInfoPpi; // // Load new GDT table on BSP // AsmInitializeGdt (&mGdt); // + // Get Vector Hand-off Info PPI + // + VectorInfo = NULL; + Status = PeiServicesLocatePpi ( + &gEfiVectorHandoffInfoPpiGuid, + 0, + NULL, + (VOID **)&VectorHandoffInfoPpi + ); + if (Status == EFI_SUCCESS) { + VectorInfo = VectorHandoffInfoPpi->Info; + } + Status = InitializeCpuExceptionHandlers (VectorInfo); + ASSERT_EFI_ERROR (Status); + // // Get wakeup buffer and copy AP reset code in it // PeiCpuMpData = PrepareAPStartupVector (); diff --git a/UefiCpuPkg/CpuMpPei/CpuMpPei.h b/UefiCpuPkg/CpuMpPei/CpuMpPei.h index 88465d2940..5e56934a27 100644 --- a/UefiCpuPkg/CpuMpPei/CpuMpPei.h +++ b/UefiCpuPkg/CpuMpPei/CpuMpPei.h @@ -1,7 +1,7 @@ /** @file Definitions to install Multiple Processor PPI. - Copyright (c) 2015, Intel Corporation. All rights reserved.
+ Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -39,6 +40,7 @@ #include #include #include +#include #include "Microcode.h" diff --git a/UefiCpuPkg/CpuMpPei/CpuMpPei.inf b/UefiCpuPkg/CpuMpPei/CpuMpPei.inf index 70b272e33b..445caf98f2 100644 --- a/UefiCpuPkg/CpuMpPei/CpuMpPei.inf +++ b/UefiCpuPkg/CpuMpPei/CpuMpPei.inf @@ -1,7 +1,7 @@ ## @file # CPU driver installs CPU PI Multi-processor PPI. # -# Copyright (c) 2015, Intel Corporation. All rights reserved.
+# Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.
# This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text of the license may be found at @@ -50,6 +50,7 @@ [Packages] MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec UefiCpuPkg/UefiCpuPkg.dec [LibraryClasses] @@ -67,6 +68,7 @@ TimerLib UefiCpuLib CpuLib + CpuExceptionHandlerLib [Ppis] gEfiPeiMpServicesPpiGuid ## PRODUCES @@ -75,6 +77,7 @@ ## SOMETIMES_CONSUMES ## SOMETIMES_PRODUCES gEfiSecPlatformInformation2PpiGuid + gEfiVectorHandoffInfoPpiGuid ## SOMETIMES_CONSUMES [Pcd] gUefiCpuPkgTokenSpaceGuid.PcdCpuMaxLogicalProcessorNumber ## CONSUMES -- cgit v1.2.3