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