]>
Commit | Line | Data |
---|---|---|
946bfba2 | 1 | /** @file\r |
2 | PEI Services Table Pointer Library.\r | |
3 | \r | |
4 | Store PEI Services Table pointer via gInOsEmuPkgTokenSpaceGuid.PcdPeiServicesTablePage.\r | |
5 | This emulates a platform SRAM. The PI mechaism does not work in the emulator due to\r | |
6 | lack of privledge.\r | |
7 | \r | |
8 | Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r | |
9 | Portiions copyrigth (c) 2011, Apple Inc. All rights reserved. \r | |
10 | This program and the accompanying materials\r | |
11 | are licensed and made available under the terms and conditions of the BSD License\r | |
12 | which accompanies this distribution. The full text of the license may be found at\r | |
13 | http://opensource.org/licenses/bsd-license.php.\r | |
14 | \r | |
15 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
16 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
17 | \r | |
18 | **/\r | |
19 | \r | |
20 | #include <PiPei.h>\r | |
21 | #include <Library/PeiServicesTablePointerLib.h>\r | |
22 | #include <Library/DebugLib.h>\r | |
23 | #include <Library/EmuMagicPageLib.h>\r | |
24 | \r | |
25 | \r | |
26 | /**\r | |
27 | Caches a pointer PEI Services Table. \r | |
28 | \r | |
29 | Caches the pointer to the PEI Services Table specified by PeiServicesTablePointer \r | |
30 | in a CPU specific manner as specified in the CPU binding section of the Platform Initialization \r | |
31 | Pre-EFI Initialization Core Interface Specification. \r | |
32 | \r | |
33 | If PeiServicesTablePointer is NULL, then ASSERT().\r | |
34 | \r | |
35 | @param PeiServicesTablePointer The address of PeiServices pointer.\r | |
36 | **/\r | |
37 | VOID\r | |
38 | EFIAPI\r | |
39 | SetPeiServicesTablePointer (\r | |
40 | IN CONST EFI_PEI_SERVICES ** PeiServicesTablePointer\r | |
41 | )\r | |
42 | {\r | |
43 | ASSERT (PeiServicesTablePointer != NULL);\r | |
44 | ASSERT (*PeiServicesTablePointer != NULL);\r | |
45 | EMU_MAGIC_PAGE()->PeiServicesTablePointer = PeiServicesTablePointer;\r | |
46 | }\r | |
47 | \r | |
48 | /**\r | |
49 | Retrieves the cached value of the PEI Services Table pointer.\r | |
50 | \r | |
51 | Returns the cached value of the PEI Services Table pointer in a CPU specific manner \r | |
52 | as specified in the CPU binding section of the Platform Initialization Pre-EFI \r | |
53 | Initialization Core Interface Specification.\r | |
54 | \r | |
55 | If the cached PEI Services Table pointer is NULL, then ASSERT().\r | |
56 | \r | |
57 | @return The pointer to PeiServices.\r | |
58 | \r | |
59 | **/\r | |
60 | CONST EFI_PEI_SERVICES **\r | |
61 | EFIAPI\r | |
62 | GetPeiServicesTablePointer (\r | |
63 | VOID\r | |
64 | )\r | |
65 | {\r | |
66 | CONST EFI_PEI_SERVICES **PeiServicesTablePointer;\r | |
67 | \r | |
68 | PeiServicesTablePointer = EMU_MAGIC_PAGE()->PeiServicesTablePointer;\r | |
69 | ASSERT (PeiServicesTablePointer != NULL);\r | |
70 | ASSERT (*PeiServicesTablePointer != NULL);\r | |
71 | return PeiServicesTablePointer;\r | |
72 | }\r | |
73 | \r | |
74 | \r | |
75 | \r |