]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointer.c
Synchronize interface function comment from declaration in library class header file...
[mirror_edk2.git] / MdePkg / Library / PeiServicesTablePointerLib / PeiServicesTablePointer.c
1 /** @file
2 PEI Services Table Pointer Library.
3
4 This library is used for PEIM which does executed from flash device directly but
5 executed in memory.
6
7 Copyright (c) 2006 - 2008, Intel Corporation<BR>
8 All rights reserved. This program and the accompanying materials
9 are licensed and made available under the terms and conditions of the BSD License
10 which accompanies this distribution. The full text of the license may be found at
11 http://opensource.org/licenses/bsd-license.php
12
13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15
16 **/
17
18 #include <PiPei.h>
19 #include <Library/PeiServicesTablePointerLib.h>
20 #include <Library/DebugLib.h>
21
22 CONST EFI_PEI_SERVICES **gPeiServices;
23
24 /**
25 The function set the pointer of PEI services immediately preceding the IDT table
26 according to PI specification.
27
28 @param PeiServicesTablePointer The address of PeiServices pointer.
29 **/
30 VOID
31 EFIAPI
32 SetPeiServicesTablePointer (
33 IN CONST EFI_PEI_SERVICES ** PeiServicesTablePointer
34 )
35 {
36 gPeiServices = PeiServicesTablePointer;
37 }
38
39 /**
40 The function returns the pointer to PEI services.
41
42 The function returns the pointer to PEI services.
43 It will ASSERT() if the pointer to PEI services is NULL.
44
45 @retval The pointer to PeiServices.
46
47 **/
48 CONST EFI_PEI_SERVICES **
49 EFIAPI
50 GetPeiServicesTablePointer (
51 VOID
52 )
53 {
54 ASSERT (gPeiServices != NULL);
55 return gPeiServices;
56 }
57
58
59 /**
60 The constructor function caches the pointer to PEI services.
61
62 The constructor function caches the pointer to PEI services.
63 It will always return EFI_SUCCESS.
64
65 @param FileHandle Handle of FFS header the loaded driver.
66 @param PeiServices Pointer to the PEI services.
67
68 @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.
69
70 **/
71 EFI_STATUS
72 EFIAPI
73 PeiServicesTablePointerLibConstructor (
74 IN EFI_PEI_FILE_HANDLE FileHandle,
75 IN CONST EFI_PEI_SERVICES **PeiServices
76 )
77 {
78 gPeiServices = PeiServices;
79 return EFI_SUCCESS;
80 }
81
82