]> git.proxmox.com Git - mirror_edk2.git/blob - EdkModulePkg/Core/DxeIplPeim/Ipf/DxeLoadFunc.c
1. Added Non-existing.c in BaseLib to assert no invocations of SwitchStack() on IPF.
[mirror_edk2.git] / EdkModulePkg / Core / DxeIplPeim / Ipf / DxeLoadFunc.c
1 /*++
2
3 Copyright (c) 2006, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
8
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12 Module Name:
13
14 IpfDxeLoad.c
15
16 Abstract:
17
18 Ipf-specifc functionality for DxeLoad.
19
20 --*/
21
22 #include <DxeIpl.h>
23
24 EFI_STATUS
25 CreateArchSpecificHobs (
26 OUT EFI_PHYSICAL_ADDRESS *BspStore
27 )
28 /*++
29
30 Routine Description:
31
32 Creates architecture-specific HOBs.
33
34 Note: New parameters should NOT be added for any HOBs that are added to this
35 function. BspStore is a special case because it is required for the
36 call to SwitchStacks() in DxeLoad().
37
38 Arguments:
39
40 BspStore - The address of the BSP Store for those architectures that need
41 it. Otherwise 0.
42
43 Returns:
44
45 EFI_SUCCESS - The HOBs were created successfully.
46
47 --*/
48 {
49 EFI_STATUS Status;
50
51 Status = EFI_SUCCESS;
52
53 ASSERT (NULL != BspStore);
54
55 //
56 // Allocate 16KB for the BspStore
57 //
58 Status = PeiServicesAllocatePages (EfiBootServicesData, EFI_SIZE_TO_PAGES (BSP_STORE_SIZE), BspStore);
59 if (EFI_ERROR (Status)) {
60 return Status;
61 }
62
63 BuildBspStoreHob (
64 *BspStore,
65 BSP_STORE_SIZE,
66 EfiBootServicesData
67 );
68
69 return EFI_SUCCESS;
70 }
71
72 /**
73 Transfers control to a function starting with a new stack.
74
75 Transfers control to the function specified by EntryPoint using the new stack
76 specified by NewStack and passing in the parameters specified by Context1 and
77 Context2. Context1 and Context2 are optional and may be NULL. The function
78 EntryPoint must never return.
79
80 If EntryPoint is NULL, then ASSERT().
81 If NewStack is NULL, then ASSERT().
82
83 @param EntryPoint A pointer to function to call with the new stack.
84 @param Context1 A pointer to the context to pass into the EntryPoint
85 function.
86 @param Context2 A pointer to the context to pass into the EntryPoint
87 function.
88 @param NewStack A pointer to the new stack to use for the EntryPoint
89 function.
90 @param NewBsp A pointer to the new BSP for the EntryPoint on IPF. It's
91 Reserved on other architectures.
92
93 **/
94 VOID
95 EFIAPI
96 SwitchIplStacks (
97 IN SWITCH_STACK_ENTRY_POINT EntryPoint,
98 IN VOID *Context1, OPTIONAL
99 IN VOID *Context2, OPTIONAL
100 IN VOID *NewStack,
101 IN VOID *NewBsp
102 )
103 {
104 AsmSwitchStackAndBackingStore (
105 EntryPoint,
106 Context1,
107 Context2,
108 NewStack,
109 NewBsp
110 );
111 }