From 94578ce61a24bf8e2c43005f9d597c60eb409256 Mon Sep 17 00:00:00 2001 From: klu2 Date: Fri, 7 Mar 2008 05:42:04 +0000 Subject: [PATCH] For Itanium platform, the switch CAR action has been moved to SecCore according to PI specification, so I clean up the PeiCore to remove stack related code. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4803 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Core/Pei/Dispatcher/Stack.c | 55 ---------------- MdeModulePkg/Core/Pei/Ipf/IpfCpuCore.s | 52 --------------- MdeModulePkg/Core/Pei/Ipf/IpfPeiMain.h | 53 --------------- MdeModulePkg/Core/Pei/Ipf/Stack.c | 58 ----------------- MdeModulePkg/Core/Pei/Ipf/SwitchToCacheMode.c | 64 ------------------- MdeModulePkg/Core/Pei/PeiMain.h | 64 ------------------- MdeModulePkg/Core/Pei/PeiMain.inf | 15 ----- 7 files changed, 361 deletions(-) delete mode 100644 MdeModulePkg/Core/Pei/Dispatcher/Stack.c delete mode 100644 MdeModulePkg/Core/Pei/Ipf/IpfCpuCore.s delete mode 100644 MdeModulePkg/Core/Pei/Ipf/IpfPeiMain.h delete mode 100644 MdeModulePkg/Core/Pei/Ipf/Stack.c delete mode 100644 MdeModulePkg/Core/Pei/Ipf/SwitchToCacheMode.c diff --git a/MdeModulePkg/Core/Pei/Dispatcher/Stack.c b/MdeModulePkg/Core/Pei/Dispatcher/Stack.c deleted file mode 100644 index 9e74eee587..0000000000 --- a/MdeModulePkg/Core/Pei/Dispatcher/Stack.c +++ /dev/null @@ -1,55 +0,0 @@ -/** @file - PeiSwitchStacks() function for PEI dispatcher. - - Copyright (c) 2006, 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 - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - - Module Name: String.c - -**/ - -// -// Include common header file for this module. -// -#include - -/** - Transfers control to a function starting with a new stack. - - Transfers control to the function specified by EntryPoint using the new stack - specified by NewStack and passing in the parameters specified by Context1 and - Context2. Context1 and Context2 are optional and may be NULL. The function - EntryPoint must never return. - - If EntryPoint is NULL, then ASSERT(). - If NewStack is NULL, then ASSERT(). - - @param EntryPoint A pointer to function to call with the new stack. - @param Context1 A pointer to the context to pass into the EntryPoint - function. - @param Context2 A pointer to the context to pass into the EntryPoint - function. - @param NewStack A pointer to the new stack to use for the EntryPoint - function. - @param NewBsp A pointer to the new BSP for the EntryPoint on IPF. It's - Reserved on other architectures. - -**/ -VOID -EFIAPI -PeiSwitchStacks ( - IN SWITCH_STACK_ENTRY_POINT EntryPoint, - IN VOID *Context1, OPTIONAL - IN VOID *Context2, OPTIONAL - IN VOID *NewStack, - IN VOID *NewBsp - ) -{ - SwitchStack (EntryPoint, Context1, Context2, NewStack); -} diff --git a/MdeModulePkg/Core/Pei/Ipf/IpfCpuCore.s b/MdeModulePkg/Core/Pei/Ipf/IpfCpuCore.s deleted file mode 100644 index d5e9534b89..0000000000 --- a/MdeModulePkg/Core/Pei/Ipf/IpfCpuCore.s +++ /dev/null @@ -1,52 +0,0 @@ -//++ -// Copyright (c) 2006, 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 -// http://opensource.org/licenses/bsd-license.php -// -// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -// -// Module Name: -// -// IpfCpuCore.s -// -// Abstract: -// IPF Specific assembly routines -// -//-- - -.file "IpfCpuCore.s" - -#include "IpfMacro.i" - -//--------------------------------------------------------------------------------- -//++ -// GetHandOffStatus -// -// This routine is called by all processors simultaneously, to get some hand-off -// status that has been captured by IPF dispatcher and recorded in kernel registers. -// -// Arguments : -// -// On Entry : None. -// -// Return Value: Lid, R20Status. -// -//-- -//---------------------------------------------------------------------------------- -PROCEDURE_ENTRY (GetHandOffStatus) - - NESTED_SETUP (0,2+0,0,0) - - mov r8 = ar.k6 // Health Status (Self test params) - mov r9 = ar.k4 // LID bits - mov r10 = ar.k3;; // SAL_E entry state - mov r11 = ar.k1 // Return address to PAL - - NESTED_RETURN -PROCEDURE_EXIT (GetHandOffStatus) -//---------------------------------------------------------------------------------- - - diff --git a/MdeModulePkg/Core/Pei/Ipf/IpfPeiMain.h b/MdeModulePkg/Core/Pei/Ipf/IpfPeiMain.h deleted file mode 100644 index f3d1ff503f..0000000000 --- a/MdeModulePkg/Core/Pei/Ipf/IpfPeiMain.h +++ /dev/null @@ -1,53 +0,0 @@ -/*++ - -Copyright (c) 2006, 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 -http://opensource.org/licenses/bsd-license.php - -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -Module Name: - - IpfPeiMain.h - -Abstract: - - Definition of IPF specific function - -Revision History - ---*/ - -#ifndef _IPF_PEI_MAIN_H_ -#define _IPF_PEI_MAIN_H_ - -#include -#include - -SAL_RETURN_REGS -GetHandOffStatus ( - VOID - ) -/*++ - -Routine Description: - - This routine is called by all processors simultaneously, to get some hand-off - status that has been captured by IPF dispatcher and recorded in kernel registers. - -Arguments : - - On Entry : None. - -Returns: - - Lid, R20Status. - ---*/ - -; - -#endif diff --git a/MdeModulePkg/Core/Pei/Ipf/Stack.c b/MdeModulePkg/Core/Pei/Ipf/Stack.c deleted file mode 100644 index 56a876df15..0000000000 --- a/MdeModulePkg/Core/Pei/Ipf/Stack.c +++ /dev/null @@ -1,58 +0,0 @@ -/** @file - PeiSwitchStacks() function for PEI dispatcher. - - Copyright (c) 2006 - 2007, 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 - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - - Module Name: String.c - -**/ - -#include - -/** - Transfers control to a function starting with a new stack. - - Transfers control to the function specified by EntryPoint using the new stack - specified by NewStack and passing in the parameters specified by Context1 and - Context2. Context1 and Context2 are optional and may be NULL. The function - EntryPoint must never return. - - If EntryPoint is NULL, then ASSERT(). - If NewStack is NULL, then ASSERT(). - - @param EntryPoint A pointer to function to call with the new stack. - @param Context1 A pointer to the context to pass into the EntryPoint - function. - @param Context2 A pointer to the context to pass into the EntryPoint - function. - @param NewStack A pointer to the new stack to use for the EntryPoint - function. - @param NewBsp A pointer to the new BSP for the EntryPoint on IPF. It's - Reserved on other architectures. - -**/ -VOID -EFIAPI -PeiSwitchStacks ( - IN SWITCH_STACK_ENTRY_POINT EntryPoint, - IN VOID *Context1, OPTIONAL - IN VOID *Context2, OPTIONAL - IN VOID *NewStack, - IN VOID *NewBsp - ) -{ - SwitchStack ( - EntryPoint, - Context1, - Context2, - NewStack, - NewBsp - ); -} diff --git a/MdeModulePkg/Core/Pei/Ipf/SwitchToCacheMode.c b/MdeModulePkg/Core/Pei/Ipf/SwitchToCacheMode.c deleted file mode 100644 index 1f261af5cb..0000000000 --- a/MdeModulePkg/Core/Pei/Ipf/SwitchToCacheMode.c +++ /dev/null @@ -1,64 +0,0 @@ -/*++ - -Copyright (c) 2006, 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 -http://opensource.org/licenses/bsd-license.php - -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -Module Name: - - SwitchToCacheMode.c - -Abstract: - - Ipf CAR specific function used to switch to cache mode for the later memory access - -Revision History - ---*/ - -#include "IpfPeiMain.h" -#define RecoveryFn 0x03 - -VOID -SwitchToCacheMode ( - IN PEI_CORE_INSTANCE *CoreData - ) -/*++ - -Routine Description: - - Switch the PHIT pointers to cache mode after InstallPeiMemory in CAR. - -Arguments: - - CoreData - The PEI core Private Data - -Returns: - ---*/ -{ - EFI_HOB_HANDOFF_INFO_TABLE *Phit; - - if ((GetHandOffStatus().r10 & 0xFF) == RecoveryFn) { - CoreData->StackBase = CoreData->StackBase & CACHE_MODE_ADDRESS_MASK; - CoreData->HobList.Raw = (UINT8 *)((UINTN)CoreData->HobList.Raw & CACHE_MODE_ADDRESS_MASK); - - // - // Change the PHIT pointer value to cache mode - // - Phit = CoreData->HobList.HandoffInformationTable; - - Phit->EfiMemoryTop = Phit->EfiMemoryTop & CACHE_MODE_ADDRESS_MASK; - Phit->EfiFreeMemoryTop = Phit->EfiFreeMemoryTop & CACHE_MODE_ADDRESS_MASK; - Phit->EfiMemoryBottom = Phit->EfiMemoryBottom & CACHE_MODE_ADDRESS_MASK; - Phit->EfiFreeMemoryBottom = Phit->EfiFreeMemoryBottom & CACHE_MODE_ADDRESS_MASK; - Phit->EfiEndOfHobList = Phit->EfiEndOfHobList & CACHE_MODE_ADDRESS_MASK; - } - - return; -} diff --git a/MdeModulePkg/Core/Pei/PeiMain.h b/MdeModulePkg/Core/Pei/PeiMain.h index 319bf87711..3579586858 100644 --- a/MdeModulePkg/Core/Pei/PeiMain.h +++ b/MdeModulePkg/Core/Pei/PeiMain.h @@ -412,38 +412,6 @@ Returns: --*/ ; -#if defined (MDE_CPU_IPF) - // - // In Ipf we should make special changes for the PHIT pointers to support - // recovery boot in cache mode. - // -#define SWITCH_TO_CACHE_MODE(CoreData) SwitchToCacheMode(CoreData) -#define CACHE_MODE_ADDRESS_MASK 0x7FFFFFFFFFFFFFFFULL -VOID -SwitchToCacheMode ( - IN PEI_CORE_INSTANCE *CoreData -) -/*++ - -Routine Description: - - Switch the PHIT pointers to cache mode after InstallPeiMemory in CAR. - -Arguments: - - CoreData - The PEI core Private Data - -Returns: - ---*/ -; - -#else - -#define SWITCH_TO_CACHE_MODE(CoreData) - -#endif - // // PPI support functions // @@ -1336,38 +1304,6 @@ PeiRegisterForShadow ( ) ; -/** - Transfers control to a function starting with a new stack. - - Transfers control to the function specified by EntryPoint using the new stack - specified by NewStack and passing in the parameters specified by Context1 and - Context2. Context1 and Context2 are optional and may be NULL. The function - EntryPoint must never return. - - If EntryPoint is NULL, then ASSERT(). - If NewStack is NULL, then ASSERT(). - - @param EntryPoint A pointer to function to call with the new stack. - @param Context1 A pointer to the context to pass into the EntryPoint - function. - @param Context2 A pointer to the context to pass into the EntryPoint - function. - @param NewStack A pointer to the new stack to use for the EntryPoint - function. - @param NewBsp A pointer to the new BSP for the EntryPoint on IPF. It's - Reserved on other architectures. - -**/ -VOID -EFIAPI -PeiSwitchStacks ( - IN SWITCH_STACK_ENTRY_POINT EntryPoint, - IN VOID *Context1, OPTIONAL - IN VOID *Context2, OPTIONAL - IN VOID *NewStack, - IN VOID *NewBsp - ); - EFI_STATUS PeiFindFileEx ( IN CONST EFI_PEI_FV_HANDLE FvHandle, diff --git a/MdeModulePkg/Core/Pei/PeiMain.inf b/MdeModulePkg/Core/Pei/PeiMain.inf index 08d6da475a..1aa5ec823f 100644 --- a/MdeModulePkg/Core/Pei/PeiMain.inf +++ b/MdeModulePkg/Core/Pei/PeiMain.inf @@ -47,21 +47,6 @@ BootMode/BootMode.c PeiMain.h -[Sources.Ia32] - Dispatcher/Stack.c - -[Sources.X64] - Dispatcher/Stack.c - -[Sources.IPF] - Ipf/Stack.c - Ipf/IpfPeiMain.h - Ipf/IpfCpuCore.s - Ipf/SwitchToCacheMode.c - -[Sources.EBC] - Dispatcher/Stack.c - [Packages] MdeModulePkg/MdeModulePkg.dec MdePkg/MdePkg.dec