]>
Commit | Line | Data |
---|---|---|
96226baa | 1 | /** @file\r |
48557c65 | 2 | Ipf-specific functionality for DxeLoad.\r |
95276127 | 3 | \r |
96226baa | 4 | Copyright (c) 2006 - 2008, Intel Corporation. <BR>\r |
95276127 | 5 | All rights reserved. This program and the accompanying materials\r |
6 | are licensed and made available under the terms and conditions of the BSD License\r | |
7 | which accompanies this distribution. The full text of the license may be found at\r | |
8 | http://opensource.org/licenses/bsd-license.php\r | |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
12 | \r | |
96226baa | 13 | **/\r |
95276127 | 14 | \r |
95276127 | 15 | #include "DxeIpl.h"\r |
16 | \r | |
91d92e25 | 17 | \r |
18 | \r | |
19 | /**\r | |
20 | Transfers control to DxeCore.\r | |
21 | \r | |
22 | This function performs a CPU architecture specific operations to execute\r | |
23 | the entry point of DxeCore with the parameters of HobList.\r | |
48557c65 | 24 | It also installs EFI_END_OF_PEI_PPI to signal the end of PEI phase.\r |
91d92e25 | 25 | \r |
48557c65 | 26 | @param DxeCoreEntryPoint The entry point of DxeCore.\r |
91d92e25 | 27 | @param HobList The start of HobList passed to DxeCore.\r |
91d92e25 | 28 | \r |
29 | **/\r | |
95276127 | 30 | VOID\r |
31 | HandOffToDxeCore (\r | |
32 | IN EFI_PHYSICAL_ADDRESS DxeCoreEntryPoint,\r | |
9b937a73 | 33 | IN EFI_PEI_HOB_POINTERS HobList\r |
95276127 | 34 | )\r |
35 | {\r | |
36 | VOID *BaseOfStack;\r | |
37 | VOID *TopOfStack;\r | |
38 | VOID *BspStore;\r | |
39 | EFI_STATUS Status;\r | |
40 | \r | |
41 | //\r | |
42 | // Allocate 128KB for the Stack\r | |
43 | //\r | |
44 | BaseOfStack = AllocatePages (EFI_SIZE_TO_PAGES (STACK_SIZE));\r | |
45 | ASSERT (BaseOfStack != NULL);\r | |
46 | \r | |
47 | //\r | |
48 | // Allocate 16KB for the BspStore\r | |
49 | //\r | |
50 | BspStore = AllocatePages (EFI_SIZE_TO_PAGES (BSP_STORE_SIZE));\r | |
51 | ASSERT (BspStore != NULL);\r | |
52 | //\r | |
53 | // Build BspStoreHob\r | |
54 | //\r | |
55 | BuildBspStoreHob ((EFI_PHYSICAL_ADDRESS) (UINTN) BspStore, BSP_STORE_SIZE, EfiBootServicesData);\r | |
56 | \r | |
57 | //\r | |
58 | // Compute the top of the stack we were allocated. Pre-allocate a UINTN\r | |
59 | // for safety.\r | |
60 | //\r | |
61 | TopOfStack = (VOID *) ((UINTN) BaseOfStack + EFI_SIZE_TO_PAGES (STACK_SIZE) * EFI_PAGE_SIZE - CPU_STACK_ALIGNMENT);\r | |
62 | TopOfStack = ALIGN_POINTER (TopOfStack, CPU_STACK_ALIGNMENT);\r | |
63 | \r | |
64 | //\r | |
48557c65 | 65 | // End of PEI phase signal\r |
95276127 | 66 | //\r |
9b937a73 | 67 | Status = PeiServicesInstallPpi (&gEndOfPeiSignalPpi);\r |
95276127 | 68 | ASSERT_EFI_ERROR (Status);\r |
69 | \r | |
30c8f861 | 70 | //\r |
71 | // Update the contents of BSP stack HOB to reflect the real stack info passed to DxeCore.\r | |
72 | //\r | |
73 | UpdateStackHob ((EFI_PHYSICAL_ADDRESS)(UINTN) BaseOfStack, STACK_SIZE);\r | |
74 | \r | |
b98da1b1 | 75 | //\r |
76 | // Transfer the control to the entry point of DxeCore.\r | |
77 | //\r | |
95276127 | 78 | SwitchStack (\r |
79 | (SWITCH_STACK_ENTRY_POINT)(UINTN)DxeCoreEntryPoint,\r | |
80 | HobList.Raw,\r | |
81 | NULL,\r | |
82 | TopOfStack,\r | |
83 | BspStore\r | |
84 | );\r | |
85 | }\r |