]>
Commit | Line | Data |
---|---|---|
e386b444 | 1 | /** @file\r |
2 | PEI Services Table Pointer Library.\r | |
3 | \r | |
4 | Copyright (c) 2006, Intel Corporation<BR>\r | |
5 | All rights reserved. This program and the accompanying materials\r | |
6 | are licensed and made available under the terms and conditions of the BSD License\r | |
7 | which accompanies this distribution. The full text of the license may be found at\r | |
8 | http://opensource.org/licenses/bsd-license.php\r | |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
12 | \r | |
e386b444 | 13 | **/\r |
14 | \r | |
c7d265a9 | 15 | #include <PiPei.h>\r |
c7d265a9 | 16 | #include <Library/PeiServicesTablePointerLib.h>\r |
17 | #include <Library/DebugLib.h>\r | |
e386b444 | 18 | \r |
a73480f6 | 19 | #include "PeiServicesTablePointerInternal.h"\r |
f734a10a | 20 | \r |
e386b444 | 21 | static EFI_PEI_SERVICES **gPeiServices;\r |
22 | \r | |
81c7803c | 23 | /**\r |
24 | The function set the pointer of PEI services immediately preceding the IDT table\r | |
25 | according to PI specification.\r | |
26 | \r | |
27 | @param PeiServices The address of PeiServices pointer.\r | |
28 | **/\r | |
b0d803fe | 29 | VOID\r |
30 | EFIAPI\r | |
31 | SetPeiServicesTablePointer (\r | |
32 | EFI_PEI_SERVICES **PeiServices\r | |
33 | )\r | |
34 | {\r | |
35 | gPeiServices = PeiServices;\r | |
36 | }\r | |
37 | \r | |
e386b444 | 38 | /**\r |
39 | The function returns the pointer to PEI services.\r | |
40 | \r | |
41 | The function returns the pointer to PEI services.\r | |
42 | It will ASSERT() if the pointer to PEI services is NULL.\r | |
43 | \r | |
44 | @retval The pointer to PeiServices.\r | |
45 | \r | |
46 | **/\r | |
47 | EFI_PEI_SERVICES **\r | |
48 | GetPeiServicesTablePointer (\r | |
49 | VOID\r | |
50 | )\r | |
51 | {\r | |
52 | ASSERT (gPeiServices != NULL);\r | |
53 | return gPeiServices;\r | |
54 | }\r | |
55 | \r | |
56 | \r | |
57 | /**\r | |
58 | The constructor function caches the pointer to PEI services.\r | |
59 | \r | |
60 | The constructor function caches the pointer to PEI services.\r | |
61 | It will always return EFI_SUCCESS.\r | |
62 | \r | |
63 | @param FfsHeader Pointer to FFS header the loaded driver.\r | |
64 | @param PeiServices Pointer to the PEI services.\r | |
65 | \r | |
66 | @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.\r | |
67 | \r | |
68 | **/\r | |
69 | EFI_STATUS\r | |
70 | EFIAPI\r | |
71 | PeiServicesTablePointerLibConstructor (\r | |
c6f4d4c9 | 72 | IN EFI_PEI_FILE_HANDLE *FfsHeader,\r |
e386b444 | 73 | IN EFI_PEI_SERVICES **PeiServices\r |
74 | )\r | |
75 | {\r | |
76 | gPeiServices = PeiServices;\r | |
77 | return EFI_SUCCESS;\r | |
78 | }\r | |
81c7803c | 79 | \r |
80 | /**\r | |
81 | After memory initialization in PEI phase, the IDT table in temporary memory should \r | |
82 | be migrated to memory, and the address of PeiServicesPointer also need to be updated \r | |
83 | immediately preceding the new IDT table.\r | |
84 | \r | |
85 | @param PeiServices The address of PeiServices pointer.\r | |
86 | **/\r | |
87 | VOID\r | |
88 | MigrateIdtTable (\r | |
89 | IN EFI_PEI_SERVICES **PeiServices\r | |
90 | )\r | |
91 | {\r | |
92 | }\r | |
93 | \r |