c97ee51de3c545bb085f6a85e89cabb64f7d870d
[mirror_edk2.git] / IntelFspPkg / Include / Library / FspCommonLib.h
1 /** @file
2
3 Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.<BR>
4 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 **/
13
14 #ifndef _FSP_COMMON_LIB_H_
15 #define _FSP_COMMON_LIB_H_
16
17 #include <FspGlobalData.h>
18 #include <FspMeasurePointId.h>
19
20 /**
21 This function sets the FSP global data pointer.
22
23 @param[in] FspData Fsp global data pointer.
24
25 **/
26 VOID
27 EFIAPI
28 SetFspGlobalDataPointer (
29 IN FSP_GLOBAL_DATA *FspData
30 );
31
32 /**
33 This function gets the FSP global data pointer.
34
35 **/
36 FSP_GLOBAL_DATA *
37 EFIAPI
38 GetFspGlobalDataPointer (
39 VOID
40 );
41
42 /**
43 This function gets back the FSP API paramter passed by the bootlaoder.
44
45 @retval ApiParameter FSP API paramter passed by the bootlaoder.
46 **/
47 UINT32
48 EFIAPI
49 GetFspApiParameter (
50 VOID
51 );
52
53 /**
54 This function sets the FSP API paramter in the stack.
55
56 @param[in] Value New parameter value.
57
58 **/
59 VOID
60 EFIAPI
61 SetFspApiParameter (
62 IN UINT32 Value
63 );
64
65 /**
66 This function sets the FSP continuation function parameters in the stack.
67
68 @param[in] Value New parameter value to set.
69 @param[in] Index Parameter index.
70 **/
71 VOID
72 EFIAPI
73 SetFspContinuationFuncParameter (
74 IN UINT32 Value,
75 IN UINT32 Index
76 );
77
78 /**
79 This function changes the Bootloader return address in stack.
80
81 @param[in] ReturnAddress Address to return.
82
83 **/
84 VOID
85 EFIAPI
86 SetFspApiReturnAddress (
87 IN UINT32 ReturnAddress
88 );
89
90 /**
91 This function set the API status code returned to the bootloader.
92
93 @param[in] ReturnStatus Status code to return.
94
95 **/
96 VOID
97 EFIAPI
98 SetFspApiReturnStatus (
99 IN UINT32 ReturnStatus
100 );
101
102 /**
103 This function sets the context switching stack to a new stack frame.
104
105 @param[in] NewStackTop New core stack to be set.
106
107 **/
108 VOID
109 EFIAPI
110 SetFspCoreStackPointer (
111 IN VOID *NewStackTop
112 );
113
114 /**
115 This function sets the platform specific data pointer.
116
117 @param[in] PlatformData Fsp platform specific data pointer.
118
119 **/
120 VOID
121 EFIAPI
122 SetFspPlatformDataPointer (
123 IN VOID *PlatformData
124 );
125
126 /**
127 This function gets the platform specific data pointer.
128
129 @param[in] PlatformData Fsp platform specific data pointer.
130
131 **/
132 VOID *
133 EFIAPI
134 GetFspPlatformDataPointer (
135 VOID
136 );
137
138 /**
139 This function sets the UPD data pointer.
140
141 @param[in] UpdDataRgnPtr UPD data pointer.
142 **/
143 VOID
144 EFIAPI
145 SetFspUpdDataPointer (
146 IN VOID *UpdDataRgnPtr
147 );
148
149 /**
150 This function gets the UPD data pointer.
151
152 @return UpdDataRgnPtr UPD data pointer.
153 **/
154 VOID *
155 EFIAPI
156 GetFspUpdDataPointer (
157 VOID
158 );
159
160 /**
161 Set FSP measurement point timestamp.
162
163 @param[in] Id Measurement point ID.
164
165 @return performance timestamp.
166 **/
167 UINT64
168 EFIAPI
169 SetFspMeasurePoint (
170 IN UINT8 Id
171 );
172
173 /**
174 This function gets the FSP info header pointer.
175
176 @retval FspInfoHeader FSP info header pointer
177 **/
178 FSP_INFO_HEADER *
179 EFIAPI
180 GetFspInfoHeader (
181 VOID
182 );
183
184 /**
185 This function gets FSP API calling mode
186
187 @retval API calling mode
188 **/
189 UINT8
190 EFIAPI
191 GetFspApiCallingMode (
192 VOID
193 );
194
195 /**
196 This function sets FSP API calling mode
197
198 @param[in] Mode API calling mode
199 **/
200 VOID
201 EFIAPI
202 SetFspApiCallingMode (
203 UINT8 Mode
204 );
205
206 #endif