]>
Commit | Line | Data |
---|---|---|
949f388f | 1 | /** @file\r |
65e3f333 | 2 | PEI Services Table Pointer Library.\r |
d18d8a1d | 3 | \r |
65e3f333 | 4 | This library is used for PEIM which does executed from flash device directly but\r |
5 | executed in memory.\r | |
949f388f | 6 | \r |
7 | Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r | |
949f388f | 8 | 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 | |
16 | **/\r | |
17 | \r | |
18 | #include <PiPei.h>\r | |
19 | #include <Library/PeiServicesTablePointerLib.h>\r | |
20 | #include <Library/DebugLib.h>\r | |
21 | \r | |
65e3f333 | 22 | CONST EFI_PEI_SERVICES **gPeiServices;\r |
949f388f | 23 | \r |
24 | /**\r | |
d18d8a1d | 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 | |
949f388f | 31 | If PeiServicesTablePointer is NULL, then ASSERT().\r |
d18d8a1d | 32 | \r |
949f388f | 33 | @param PeiServicesTablePointer The address of PeiServices pointer.\r |
34 | **/\r | |
35 | VOID\r | |
36 | EFIAPI\r | |
37 | SetPeiServicesTablePointer (\r | |
65e3f333 | 38 | IN CONST EFI_PEI_SERVICES ** PeiServicesTablePointer\r |
949f388f | 39 | )\r |
40 | {\r | |
65e3f333 | 41 | ASSERT (PeiServicesTablePointer != NULL);\r |
42 | gPeiServices = PeiServicesTablePointer;\r | |
949f388f | 43 | }\r |
44 | \r | |
45 | /**\r | |
46 | Retrieves the cached value of the PEI Services Table pointer.\r | |
47 | \r | |
d18d8a1d | 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 | |
949f388f | 50 | Initialization Core Interface Specification.\r |
d18d8a1d | 51 | \r |
949f388f | 52 | If the cached PEI Services Table pointer is NULL, then ASSERT().\r |
53 | \r | |
54 | @return The pointer to PeiServices.\r | |
55 | \r | |
56 | **/\r | |
57 | CONST EFI_PEI_SERVICES **\r | |
58 | EFIAPI\r | |
59 | GetPeiServicesTablePointer (\r | |
60 | VOID\r | |
61 | )\r | |
62 | {\r | |
63 | ASSERT (gPeiServices != NULL);\r | |
949f388f | 64 | return gPeiServices;\r |
65 | }\r | |
66 | \r | |
67 | \r | |
65e3f333 | 68 | /**\r |
69 | The constructor function caches the pointer to PEI services.\r | |
d18d8a1d | 70 | \r |
65e3f333 | 71 | The constructor function caches the pointer to PEI services.\r |
72 | It will always return EFI_SUCCESS.\r | |
73 | \r | |
74 | @param FileHandle The handle of FFS header the loaded driver.\r | |
75 | @param PeiServices The 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 | |
83 | IN EFI_PEI_FILE_HANDLE FileHandle,\r | |
84 | IN CONST EFI_PEI_SERVICES **PeiServices\r | |
85 | )\r | |
86 | {\r | |
87 | gPeiServices = PeiServices;\r | |
88 | return EFI_SUCCESS;\r | |
89 | }\r | |
90 | \r | |
91 | \r |