]> git.proxmox.com Git - mirror_edk2.git/blob - EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiServicesTablePointerLib/PeiServicesTablePointer.c
Add in the 1st version of ECP.
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Library / EdkIIGlueLib / Library / PeiServicesTablePointerLib / PeiServicesTablePointer.c
1 /*++
2
3 Copyright (c) 2004 - 2006, Intel Corporation
4 All rights reserved. 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 Module Name:
14
15 PeiServicesTablePointer.c
16
17 Abstract:
18
19 PEI Services Table Pointer Library.
20
21 --*/
22
23 #include "EdkIIGluePeim.h"
24
25 static EFI_PEI_SERVICES **gPeiServices;
26
27 /**
28 The function returns the pointer to PEI services.
29
30 The function returns the pointer to PEI services.
31 It will ASSERT() if the pointer to PEI services is NULL.
32
33 @retval The pointer to PeiServices.
34
35 **/
36 EFI_PEI_SERVICES **
37 GetPeiServicesTablePointer (
38 VOID
39 )
40 {
41 ASSERT (gPeiServices != NULL);
42 return gPeiServices;
43 }
44
45
46 /**
47 The constructor function caches the pointer to PEI services.
48
49 The constructor function caches the pointer to PEI services.
50 It will always return EFI_SUCCESS.
51
52 @param FfsHeader Pointer to FFS header the loaded driver.
53 @param PeiServices Pointer to the PEI services.
54
55 @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.
56
57 **/
58 EFI_STATUS
59 EFIAPI
60 PeiServicesTablePointerLibConstructor (
61 IN EFI_FFS_FILE_HEADER *FfsHeader,
62 IN EFI_PEI_SERVICES **PeiServices
63 )
64 {
65 gPeiServices = PeiServices;
66 return EFI_SUCCESS;
67 }