]>
Commit | Line | Data |
---|---|---|
96226baa | 1 | /** @file\r |
2 | Ia32-specifc 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 | |
17 | VOID\r | |
18 | HandOffToDxeCore (\r | |
19 | IN EFI_PHYSICAL_ADDRESS DxeCoreEntryPoint,\r | |
20 | IN EFI_PEI_HOB_POINTERS HobList,\r | |
21 | IN EFI_PEI_PPI_DESCRIPTOR *EndOfPeiSignal\r | |
22 | )\r | |
23 | {\r | |
24 | VOID *BaseOfStack;\r | |
25 | VOID *TopOfStack;\r | |
26 | EFI_STATUS Status;\r | |
27 | \r | |
28 | //\r | |
29 | // Allocate 128KB for the Stack\r | |
30 | //\r | |
31 | BaseOfStack = AllocatePages (EFI_SIZE_TO_PAGES (STACK_SIZE));\r | |
32 | ASSERT (BaseOfStack != NULL);\r | |
33 | \r | |
34 | //\r | |
35 | // Compute the top of the stack we were allocated. Pre-allocate a UINTN\r | |
36 | // for safety.\r | |
37 | //\r | |
38 | TopOfStack = (VOID *) ((UINTN) BaseOfStack + EFI_SIZE_TO_PAGES (STACK_SIZE) * EFI_PAGE_SIZE - CPU_STACK_ALIGNMENT);\r | |
39 | TopOfStack = ALIGN_POINTER (TopOfStack, CPU_STACK_ALIGNMENT);\r | |
40 | \r | |
41 | //\r | |
42 | // End of PEI phase singal\r | |
43 | //\r | |
44 | Status = PeiServicesInstallPpi (EndOfPeiSignal);\r | |
45 | ASSERT_EFI_ERROR (Status);\r | |
46 | \r | |
30c8f861 | 47 | //\r |
48 | // Update the contents of BSP stack HOB to reflect the real stack info passed to DxeCore.\r | |
49 | // \r | |
189575e8 | 50 | UpdateStackHob ((EFI_PHYSICAL_ADDRESS)(UINTN) BaseOfStack, STACK_SIZE);\r |
30c8f861 | 51 | \r |
95276127 | 52 | SwitchStack (\r |
53 | (SWITCH_STACK_ENTRY_POINT)(UINTN)DxeCoreEntryPoint,\r | |
54 | HobList.Raw,\r | |
55 | NULL,\r | |
56 | TopOfStack\r | |
57 | );\r | |
58 | }\r |