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