]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFsp2WrapperPkg/Library/PeiFspWrapperApiTestLib/FspWrapperApiTest.c
IntelFsp2WrapperPkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / IntelFsp2WrapperPkg / Library / PeiFspWrapperApiTestLib / FspWrapperApiTest.c
CommitLineData
cf1d4549
JY
1/** @file\r
2 Provide FSP wrapper API test related function.\r
3\r
4 Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>\r
512e23a3 5 SPDX-License-Identifier: BSD-2-Clause-Patent\r
cf1d4549
JY
6\r
7**/\r
8\r
9#include <PiPei.h>\r
10#include <Library/BaseMemoryLib.h>\r
11#include <Library/DebugLib.h>\r
12#include <Library/HobLib.h>\r
13#include <Guid/GuidHobFspEas.h>\r
14\r
15/**\r
16 Test the output of FSP API - FspMemoryInit.\r
17\r
18 @param[in] FspmUpdDataPtr Address pointer to the FSP_MEMORY_INIT_PARAMS structure.\r
19 @param[in] HobListPtr Address of the HobList pointer.\r
20\r
21 @return test result on output of FspMemoryInit API.\r
22**/\r
23EFI_STATUS\r
24EFIAPI\r
25TestFspMemoryInitApiOutput (\r
26 IN VOID *FspmUpdDataPtr,\r
27 IN VOID **HobListPtr\r
28 )\r
29{\r
30 DEBUG_CODE_BEGIN ();\r
31 EFI_PEI_HOB_POINTERS Hob;\r
32\r
33 Hob.Raw = (UINT8 *)(*(HobListPtr));\r
34 while (TRUE) {\r
35 if (END_OF_HOB_LIST(Hob) == TRUE) {\r
36 DEBUG((DEBUG_INFO, "gFspBootLoaderTolumHobGuid not Found\n"));\r
37 break;\r
38 }\r
39 if ((CompareGuid (&Hob.ResourceDescriptor->Owner, &gFspBootLoaderTolumHobGuid))) {\r
40 DEBUG ((DEBUG_INFO, "gFspBootLoaderTolumHobGuid Found\n"));\r
41 DEBUG ((DEBUG_INFO, "Fill Boot Loader reserved memory range with 0x5A for testing purpose\n"));\r
42 SetMem ((VOID *)(UINTN)Hob.ResourceDescriptor->PhysicalStart, (UINTN)Hob.ResourceDescriptor->ResourceLength, 0x5A);\r
43 break;\r
44 }\r
45 Hob.Raw = GET_NEXT_HOB (Hob);\r
46 }\r
47 DEBUG_CODE_END ();\r
48\r
49 return RETURN_SUCCESS;\r
50}\r
51\r
52/**\r
53 Test the output of FSP API - TempRamExit.\r
54\r
55 @param[in] TempRamExitParam Address pointer to the TempRamExit parameters structure.\r
56\r
57 @return test result on output of TempRamExit API.\r
58**/\r
59EFI_STATUS\r
60EFIAPI\r
61TestFspTempRamExitApiOutput (\r
62 IN VOID *TempRamExitParam\r
63 )\r
64{\r
65 return RETURN_SUCCESS;\r
66}\r
67\r
68/**\r
69 Test the output of FSP API - FspSiliconInit.\r
70\r
71 @param[in] FspsUpdDataPtr Address pointer to the Silicon Init parameters structure.\r
72\r
73 @return test result on output of FspSiliconInit API.\r
74**/\r
75EFI_STATUS\r
76EFIAPI\r
77TestFspSiliconInitApiOutput (\r
78 IN VOID *FspsUpdDataPtr\r
79 )\r
80{\r
81 return RETURN_SUCCESS;\r
82}\r