X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=EdkModulePkg%2FCore%2FDxeIplPeim%2FIpf%2FDxeLoadFunc.c;h=e53f708fd419c56ede18bb09031b0c7ce4c9034c;hb=657d3918fe7831c1a7722869b025478746540657;hp=bcf59f970a8a2bb1193bd71357e7bab44744eadf;hpb=84a99d48f4d59e0cf59b6d55328c35225c00246d;p=mirror_edk2.git diff --git a/EdkModulePkg/Core/DxeIplPeim/Ipf/DxeLoadFunc.c b/EdkModulePkg/Core/DxeIplPeim/Ipf/DxeLoadFunc.c index bcf59f970a..e53f708fd4 100644 --- a/EdkModulePkg/Core/DxeIplPeim/Ipf/DxeLoadFunc.c +++ b/EdkModulePkg/Core/DxeIplPeim/Ipf/DxeLoadFunc.c @@ -1,13 +1,13 @@ /*++ -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. +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: @@ -19,52 +19,46 @@ Abstract: --*/ -#include +#include "DxeIpl.h" -EFI_STATUS -CreateArchSpecificHobs ( - OUT EFI_PHYSICAL_ADDRESS *BspStore +VOID +HandOffToDxeCore ( + IN EFI_PHYSICAL_ADDRESS DxeCoreEntryPoint, + IN EFI_PEI_HOB_POINTERS HobList ) -/*++ - -Routine Description: - - Creates architecture-specific HOBs. - - Note: New parameters should NOT be added for any HOBs that are added to this - function. BspStore is a special case because it is required for the - call to SwitchStacks() in DxeLoad(). - -Arguments: - - BspStore - The address of the BSP Store for those architectures that need - it. Otherwise 0. - -Returns: - - EFI_SUCCESS - The HOBs were created successfully. - ---*/ { - EFI_STATUS Status; + VOID *BaseOfStack; + VOID *TopOfStack; + VOID *BspStore; - Status = EFI_SUCCESS; - - ASSERT (NULL != BspStore); + // + // Allocate 128KB for the Stack + // + BaseOfStack = AllocatePages (EFI_SIZE_TO_PAGES (STACK_SIZE)); + ASSERT (BaseOfStack != NULL); // // Allocate 16KB for the BspStore // - Status = PeiServicesAllocatePages (EfiBootServicesData, EFI_SIZE_TO_PAGES (BSP_STORE_SIZE), BspStore); - if (EFI_ERROR (Status)) { - return Status; - } + BspStore = AllocatePages (EFI_SIZE_TO_PAGES (BSP_STORE_SIZE)); + ASSERT (BspStore != NULL); + // + // Build BspStoreHob + // + BuildBspStoreHob ((EFI_PHYSICAL_ADDRESS) (UINTN) BspStore, BSP_STORE_SIZE, EfiBootServicesData); - BuildBspStoreHob ( - *BspStore, - BSP_STORE_SIZE, - EfiBootServicesData + // + // Compute the top of the stack we were allocated. Pre-allocate a UINTN + // for safety. + // + TopOfStack = (VOID *) ((UINTN) BaseOfStack + EFI_SIZE_TO_PAGES (STACK_SIZE) * EFI_PAGE_SIZE - CPU_STACK_ALIGNMENT); + TopOfStack = ALIGN_POINTER (TopOfStack, CPU_STACK_ALIGNMENT); + + AsmSwitchStackAndBackingStore ( + (SWITCH_STACK_ENTRY_POINT)(UINTN)DxeCoreEntryPoint, + HobList.Raw, + NULL, + TopOfStack, + BspStore ); - - return EFI_SUCCESS; }