1 /** @file 2 3 Copyright (c) 2014 - 2016, 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 first parameter passed by the bootlaoder. 44 45 @retval ApiParameter FSP API first parameter passed by the bootlaoder. 46 **/ 47 UINT32 48 EFIAPI 49 GetFspApiParameter ( 50 VOID 51 ); 52 53 /** 54 This function gets back the FSP API second parameter passed by the bootlaoder. 55 56 @retval ApiParameter FSP API second parameter passed by the bootlaoder. 57 **/ 58 UINT32 59 EFIAPI 60 GetFspApiParameter2 ( 61 VOID 62 ); 63 64 /** 65 This function sets the FSP API parameter in the stack. 66 67 @param[in] Value New parameter value. 68 69 **/ 70 VOID 71 EFIAPI 72 SetFspApiParameter ( 73 IN UINT32 Value 74 ); 75 76 /** 77 This function set the API status code returned to the BootLoader. 78 79 @param[in] ReturnStatus Status code to return. 80 81 **/ 82 VOID 83 EFIAPI 84 SetFspApiReturnStatus ( 85 IN UINT32 ReturnStatus 86 ); 87 88 /** 89 This function sets the context switching stack to a new stack frame. 90 91 @param[in] NewStackTop New core stack to be set. 92 93 **/ 94 VOID 95 EFIAPI 96 SetFspCoreStackPointer ( 97 IN VOID *NewStackTop 98 ); 99 100 /** 101 This function sets the platform specific data pointer. 102 103 @param[in] PlatformData Fsp platform specific data pointer. 104 105 **/ 106 VOID 107 EFIAPI 108 SetFspPlatformDataPointer ( 109 IN VOID *PlatformData 110 ); 111 112 /** 113 This function gets the platform specific data pointer. 114 115 @param[in] PlatformData Fsp platform specific data pointer. 116 117 **/ 118 VOID * 119 EFIAPI 120 GetFspPlatformDataPointer ( 121 VOID 122 ); 123 124 /** 125 This function sets the UPD data pointer. 126 127 @param[in] UpdDataPtr UPD data pointer. 128 **/ 129 VOID 130 EFIAPI 131 SetFspUpdDataPointer ( 132 IN VOID *UpdDataPtr 133 ); 134 135 /** 136 This function gets the UPD data pointer. 137 138 @return UpdDataPtr UPD data pointer. 139 **/ 140 VOID * 141 EFIAPI 142 GetFspUpdDataPointer ( 143 VOID 144 ); 145 146 /** 147 This function sets the memory init UPD data pointer. 148 149 @param[in] MemoryInitUpdPtr memory init UPD data pointer. 150 **/ 151 VOID 152 EFIAPI 153 SetFspMemoryInitUpdDataPointer ( 154 IN VOID *MemoryInitUpdPtr 155 ); 156 157 /** 158 This function gets the memory init UPD data pointer. 159 160 @return memory init UPD data pointer. 161 **/ 162 VOID * 163 EFIAPI 164 GetFspMemoryInitUpdDataPointer ( 165 VOID 166 ); 167 168 /** 169 This function sets the silicon init UPD data pointer. 170 171 @param[in] SiliconInitUpdPtr silicon init UPD data pointer. 172 **/ 173 VOID 174 EFIAPI 175 SetFspSiliconInitUpdDataPointer ( 176 IN VOID *SiliconInitUpdPtr 177 ); 178 179 /** 180 This function gets the silicon init UPD data pointer. 181 182 @return silicon init UPD data pointer. 183 **/ 184 VOID * 185 EFIAPI 186 GetFspSiliconInitUpdDataPointer ( 187 VOID 188 ); 189 190 /** 191 Set FSP measurement point timestamp. 192 193 @param[in] Id Measurement point ID. 194 195 @return performance timestamp. 196 **/ 197 UINT64 198 EFIAPI 199 SetFspMeasurePoint ( 200 IN UINT8 Id 201 ); 202 203 /** 204 This function gets the FSP info header pointer. 205 206 @retval FspInfoHeader FSP info header pointer 207 **/ 208 FSP_INFO_HEADER * 209 EFIAPI 210 GetFspInfoHeader ( 211 VOID 212 ); 213 214 /** 215 This function sets the FSP info header pointer. 216 217 @param[in] FspInfoHeader FSP info header pointer 218 **/ 219 VOID 220 EFIAPI 221 SetFspInfoHeader ( 222 FSP_INFO_HEADER *FspInfoHeader 223 ); 224 225 /** 226 This function gets the FSP info header pointer from the API context. 227 228 @retval FspInfoHeader FSP info header pointer 229 **/ 230 FSP_INFO_HEADER * 231 EFIAPI 232 GetFspInfoHeaderFromApiContext ( 233 VOID 234 ); 235 236 /** 237 This function gets the CfgRegion data pointer. 238 239 @return CfgRegion data pointer. 240 **/ 241 VOID * 242 EFIAPI 243 GetFspCfgRegionDataPointer ( 244 VOID 245 ); 246 247 /** 248 This function gets FSP API calling mode. 249 250 @retval API calling mode 251 **/ 252 UINT8 253 EFIAPI 254 GetFspApiCallingIndex ( 255 VOID 256 ); 257 258 /** 259 This function sets FSP API calling mode. 260 261 @param[in] Index API calling index 262 **/ 263 VOID 264 EFIAPI 265 SetFspApiCallingIndex ( 266 UINT8 Index 267 ); 268 269 /** 270 This function gets FSP Phase StatusCode. 271 272 @retval StatusCode 273 **/ 274 UINT32 275 EFIAPI 276 GetPhaseStatusCode ( 277 VOID 278 ); 279 280 281 /** 282 This function sets FSP Phase StatusCode. 283 284 @param[in] Mode Phase StatusCode 285 **/ 286 VOID 287 EFIAPI 288 SetPhaseStatusCode ( 289 UINT32 StatusCode 290 ); 291 292 /** 293 This function updates the return status of the FSP API with requested reset type and returns to Boot Loader. 294 295 @param[in] FspResetType Reset type that needs to returned as API return status 296 297 **/ 298 VOID 299 EFIAPI 300 FspApiReturnStatusReset ( 301 IN UINT32 FspResetType 302 ); 303 #endif 304