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**/
26VOID
27EFIAPI
28SetFspGlobalDataPointer (
29  IN FSP_GLOBAL_DATA   *FspData
30  );
31
32/**
33  This function gets the FSP global data pointer.
34
35**/
36FSP_GLOBAL_DATA *
37EFIAPI
38GetFspGlobalDataPointer (
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**/
47UINT32
48EFIAPI
49GetFspApiParameter (
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**/
59VOID
60EFIAPI
61SetFspApiParameter (
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**/
71VOID
72EFIAPI
73SetFspContinuationFuncParameter (
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**/
84VOID
85EFIAPI
86SetFspApiReturnAddress (
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**/
96VOID
97EFIAPI
98SetFspApiReturnStatus (
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**/
108VOID
109EFIAPI
110SetFspCoreStackPointer (
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**/
120VOID
121EFIAPI
122SetFspPlatformDataPointer (
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**/
132VOID *
133EFIAPI
134GetFspPlatformDataPointer (
135  VOID
136  );
137
138/**
139  This function sets the UPD data pointer.
140
141  @param[in] UpdDataRgnPtr   UPD data pointer.
142**/
143VOID
144EFIAPI
145SetFspUpdDataPointer (
146  IN VOID    *UpdDataRgnPtr
147  );
148
149/**
150  This function gets the UPD data pointer.
151
152  @return UpdDataRgnPtr   UPD data pointer.
153**/
154VOID *
155EFIAPI
156GetFspUpdDataPointer (
157  VOID
158  );
159
160/**
161  This function sets the memory init UPD data pointer.
162
163  @param[in] MemoryInitUpdPtr   memory init UPD data pointer.
164**/
165VOID
166EFIAPI
167SetFspMemoryInitUpdDataPointer (
168  IN VOID    *MemoryInitUpdPtr
169  );
170
171/**
172  This function gets the memory init UPD data pointer.
173
174  @return memory init UPD data pointer.
175**/
176VOID *
177EFIAPI
178GetFspMemoryInitUpdDataPointer (
179  VOID
180  );
181
182/**
183  This function sets the silicon init UPD data pointer.
184
185  @param[in] SiliconInitUpdPtr   silicon init UPD data pointer.
186**/
187VOID
188EFIAPI
189SetFspSiliconInitUpdDataPointer (
190  IN VOID    *SiliconInitUpdPtr
191  );
192
193/**
194  This function gets the silicon init UPD data pointer.
195
196  @return silicon init UPD data pointer.
197**/
198VOID *
199EFIAPI
200GetFspSiliconInitUpdDataPointer (
201  VOID
202  );
203
204/**
205  Set FSP measurement point timestamp.
206
207  @param[in] Id       Measurement point ID.
208
209  @return performance timestamp.
210**/
211UINT64
212EFIAPI
213SetFspMeasurePoint (
214  IN UINT8  Id
215  );
216
217/**
218  This function gets the FSP info header pointer.
219
220  @retval FspInfoHeader   FSP info header pointer
221**/
222FSP_INFO_HEADER *
223EFIAPI
224GetFspInfoHeader (
225  VOID
226  );
227
228/**
229  This function gets the FSP info header pointer from the API context.
230
231  @retval FspInfoHeader   FSP info header pointer
232**/
233FSP_INFO_HEADER *
234EFIAPI
235GetFspInfoHeaderFromApiContext (
236  VOID
237  );
238
239/**
240  This function gets the VPD data pointer.
241
242  @return VpdDataRgnPtr   VPD data pointer.
243**/
244VOID *
245EFIAPI
246GetFspVpdDataPointer (
247  VOID
248  );
249
250/**
251  This function gets FSP API calling mode.
252
253  @retval API calling mode
254**/
255UINT8
256EFIAPI
257GetFspApiCallingMode (
258  VOID
259  );
260
261/**
262  This function sets FSP API calling mode.
263
264  @param[in] Mode     API calling mode
265**/
266VOID
267EFIAPI
268SetFspApiCallingMode (
269  UINT8  Mode
270  );
271
272#endif
273