]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointer.c
Merge branch of PI tree to main trunk
[mirror_edk2.git] / MdePkg / Library / PeiServicesTablePointerLib / PeiServicesTablePointer.c
CommitLineData
e386b444 1/** @file\r
2 PEI Services Table Pointer Library.\r
3\r
4 Copyright (c) 2006, Intel Corporation<BR>\r
5 All rights reserved. This program and the accompanying materials\r
6 are licensed and made available under the terms and conditions of the BSD License\r
7 which accompanies this distribution. The full text of the license may be found at\r
8 http://opensource.org/licenses/bsd-license.php\r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
e386b444 13**/\r
14\r
c7d265a9 15#include <PiPei.h>\r
c7d265a9 16#include <Library/PeiServicesTablePointerLib.h>\r
17#include <Library/DebugLib.h>\r
e386b444 18\r
a73480f6 19#include "PeiServicesTablePointerInternal.h"\r
f734a10a 20\r
e386b444 21static EFI_PEI_SERVICES **gPeiServices;\r
22\r
b0d803fe 23VOID\r
24EFIAPI\r
25SetPeiServicesTablePointer (\r
26 EFI_PEI_SERVICES **PeiServices\r
27 )\r
28{\r
29 gPeiServices = PeiServices;\r
30}\r
31\r
e386b444 32/**\r
33 The function returns the pointer to PEI services.\r
34\r
35 The function returns the pointer to PEI services.\r
36 It will ASSERT() if the pointer to PEI services is NULL.\r
37\r
38 @retval The pointer to PeiServices.\r
39\r
40**/\r
41EFI_PEI_SERVICES **\r
42GetPeiServicesTablePointer (\r
43 VOID\r
44 )\r
45{\r
46 ASSERT (gPeiServices != NULL);\r
47 return gPeiServices;\r
48}\r
49\r
50\r
51/**\r
52 The constructor function caches the pointer to PEI services.\r
53 \r
54 The constructor function caches the pointer to PEI services.\r
55 It will always return EFI_SUCCESS.\r
56\r
57 @param FfsHeader Pointer to FFS header the loaded driver.\r
58 @param PeiServices Pointer to the PEI services.\r
59\r
60 @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.\r
61\r
62**/\r
63EFI_STATUS\r
64EFIAPI\r
65PeiServicesTablePointerLibConstructor (\r
c6f4d4c9 66 IN EFI_PEI_FILE_HANDLE *FfsHeader,\r
e386b444 67 IN EFI_PEI_SERVICES **PeiServices\r
68 )\r
69{\r
70 gPeiServices = PeiServices;\r
71 return EFI_SUCCESS;\r
72}\r