]>
Commit | Line | Data |
---|---|---|
878ddf1f | 1 | /*++\r |
2 | \r | |
eeb1cd5a | 3 | Copyright (c) 2006, Intel Corporation\r |
4 | All rights reserved. This program and the accompanying materials\r | |
5 | are licensed and made available under the terms and conditions of the BSD License\r | |
6 | which accompanies this distribution. The full text of the license may be found at\r | |
7 | http://opensource.org/licenses/bsd-license.php\r | |
8 | \r | |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
10 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
878ddf1f | 11 | \r |
12 | Module Name:\r | |
13 | \r | |
14 | IpfDxeLoad.c\r | |
15 | \r | |
16 | Abstract:\r | |
17 | \r | |
18 | Ipf-specifc functionality for DxeLoad.\r | |
19 | \r | |
20 | --*/\r | |
21 | \r | |
abb26634 | 22 | #include "DxeIpl.h"\r |
878ddf1f | 23 | \r |
657d3918 | 24 | VOID\r |
25 | HandOffToDxeCore (\r | |
26 | IN EFI_PHYSICAL_ADDRESS DxeCoreEntryPoint,\r | |
27 | IN EFI_PEI_HOB_POINTERS HobList\r | |
878ddf1f | 28 | )\r |
878ddf1f | 29 | {\r |
657d3918 | 30 | VOID *BaseOfStack;\r |
31 | VOID *TopOfStack;\r | |
32 | VOID *BspStore;\r | |
878ddf1f | 33 | \r |
657d3918 | 34 | //\r |
35 | // Allocate 128KB for the Stack\r | |
36 | //\r | |
37 | BaseOfStack = AllocatePages (EFI_SIZE_TO_PAGES (STACK_SIZE));\r | |
38 | ASSERT (BaseOfStack != NULL);\r | |
878ddf1f | 39 | \r |
40 | //\r | |
41 | // Allocate 16KB for the BspStore\r | |
42 | //\r | |
657d3918 | 43 | BspStore = AllocatePages (EFI_SIZE_TO_PAGES (BSP_STORE_SIZE));\r |
44 | ASSERT (BspStore != NULL);\r | |
45 | //\r | |
46 | // Build BspStoreHob\r | |
47 | //\r | |
48 | BuildBspStoreHob ((EFI_PHYSICAL_ADDRESS) (UINTN) BspStore, BSP_STORE_SIZE, EfiBootServicesData);\r | |
eeb1cd5a | 49 | \r |
657d3918 | 50 | //\r |
51 | // Compute the top of the stack we were allocated. Pre-allocate a UINTN\r | |
52 | // for safety.\r | |
53 | //\r | |
54 | TopOfStack = (VOID *) ((UINTN) BaseOfStack + EFI_SIZE_TO_PAGES (STACK_SIZE) * EFI_PAGE_SIZE - CPU_STACK_ALIGNMENT);\r | |
55 | TopOfStack = ALIGN_POINTER (TopOfStack, CPU_STACK_ALIGNMENT);\r | |
eeb1cd5a | 56 | \r |
eeb1cd5a | 57 | AsmSwitchStackAndBackingStore (\r |
657d3918 | 58 | (SWITCH_STACK_ENTRY_POINT)(UINTN)DxeCoreEntryPoint,\r |
59 | HobList.Raw,\r | |
60 | NULL,\r | |
61 | TopOfStack,\r | |
62 | BspStore\r | |
eeb1cd5a | 63 | );\r |
64 | }\r |