]>
Commit | Line | Data |
---|---|---|
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 |
19388d29 HT |
7 | Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r |
8 | This program and the accompanying materials\r | |
e386b444 | 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 | 22 | CONST EFI_PEI_SERVICES **gPeiServices;\r |
e386b444 | 23 | \r |
81c7803c | 24 | /**\r |
4b8157f9 | 25 | Caches a pointer PEI Services Table. \r |
26 | \r | |
27 | Caches the pointer to the PEI Services Table specified by PeiServicesTablePointer \r | |
28 | in a CPU specific manner as specified in the CPU binding section of the Platform Initialization \r | |
29 | Pre-EFI Initialization Core Interface Specification. \r | |
30 | \r | |
31 | If PeiServicesTablePointer is NULL, then ASSERT().\r | |
81c7803c | 32 | \r |
f38fdc74 | 33 | @param PeiServicesTablePointer The address of PeiServices pointer.\r |
81c7803c | 34 | **/\r |
b0d803fe | 35 | VOID\r |
36 | EFIAPI\r | |
37 | SetPeiServicesTablePointer (\r | |
f38fdc74 | 38 | IN CONST EFI_PEI_SERVICES ** PeiServicesTablePointer\r |
b0d803fe | 39 | )\r |
40 | {\r | |
4b8157f9 | 41 | ASSERT (PeiServicesTablePointer != NULL);\r |
6c448d5b | 42 | gPeiServices = PeiServicesTablePointer;\r |
b0d803fe | 43 | }\r |
44 | \r | |
e386b444 | 45 | /**\r |
4b8157f9 | 46 | Retrieves the cached value of the PEI Services Table pointer.\r |
e386b444 | 47 | \r |
4b8157f9 | 48 | Returns the cached value of the PEI Services Table pointer in a CPU specific manner \r |
49 | as specified in the CPU binding section of the Platform Initialization Pre-EFI \r | |
50 | Initialization Core Interface Specification.\r | |
51 | \r | |
52 | If the cached PEI Services Table pointer is NULL, then ASSERT().\r | |
e386b444 | 53 | \r |
4b8157f9 | 54 | @return The pointer to PeiServices.\r |
e386b444 | 55 | \r |
56 | **/\r | |
5240b97c | 57 | CONST EFI_PEI_SERVICES **\r |
2884e3df | 58 | EFIAPI\r |
e386b444 | 59 | GetPeiServicesTablePointer (\r |
60 | VOID\r | |
61 | )\r | |
62 | {\r | |
63 | ASSERT (gPeiServices != NULL);\r | |
a86fda43 | 64 | return gPeiServices;\r |
e386b444 | 65 | }\r |
66 | \r | |
67 | \r | |
68 | /**\r | |
69 | The constructor function caches the pointer to PEI services.\r | |
70 | \r | |
71 | The constructor function caches the pointer to PEI services.\r | |
72 | It will always return EFI_SUCCESS.\r | |
73 | \r | |
42eedea9 | 74 | @param FileHandle Handle of FFS header the loaded driver.\r |
e386b444 | 75 | @param PeiServices Pointer to the PEI services.\r |
76 | \r | |
77 | @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.\r | |
78 | \r | |
79 | **/\r | |
80 | EFI_STATUS\r | |
81 | EFIAPI\r | |
82 | PeiServicesTablePointerLibConstructor (\r | |
a86fda43 | 83 | IN EFI_PEI_FILE_HANDLE FileHandle,\r |
84 | IN CONST EFI_PEI_SERVICES **PeiServices\r | |
e386b444 | 85 | )\r |
86 | {\r | |
87 | gPeiServices = PeiServices;\r | |
88 | return EFI_SUCCESS;\r | |
89 | }\r | |
81c7803c | 90 | \r |
81c7803c | 91 | \r |