]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointer.c
Checked in part of MDE library instances following PI and UEFI. It includes:
[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
13 Module Name: PeiServicesTablePointer.c\r
14\r
15**/\r
16\r
17\r
18\r
19//\r
c7d265a9 20// The package level header files this module uses\r
e386b444 21//\r
c7d265a9 22#include <PiPei.h>\r
23//\r
24// The protocols, PPI and GUID defintions for this module\r
25//\r
26//\r
27// The Library classes this module consumes\r
28//\r
29#include <Library/PeiServicesTablePointerLib.h>\r
30#include <Library/DebugLib.h>\r
e386b444 31\r
32static EFI_PEI_SERVICES **gPeiServices;\r
33\r
34/**\r
35 The function returns the pointer to PEI services.\r
36\r
37 The function returns the pointer to PEI services.\r
38 It will ASSERT() if the pointer to PEI services is NULL.\r
39\r
40 @retval The pointer to PeiServices.\r
41\r
42**/\r
43EFI_PEI_SERVICES **\r
44GetPeiServicesTablePointer (\r
45 VOID\r
46 )\r
47{\r
48 ASSERT (gPeiServices != NULL);\r
49 return gPeiServices;\r
50}\r
51\r
52\r
53/**\r
54 The constructor function caches the pointer to PEI services.\r
55 \r
56 The constructor function caches the pointer to PEI services.\r
57 It will always return EFI_SUCCESS.\r
58\r
59 @param FfsHeader Pointer to FFS header the loaded driver.\r
60 @param PeiServices Pointer to the PEI services.\r
61\r
62 @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.\r
63\r
64**/\r
65EFI_STATUS\r
66EFIAPI\r
67PeiServicesTablePointerLibConstructor (\r
68 IN EFI_FFS_FILE_HEADER *FfsHeader,\r
69 IN EFI_PEI_SERVICES **PeiServices\r
70 )\r
71{\r
72 gPeiServices = PeiServices;\r
73 return EFI_SUCCESS;\r
74}\r