2 PEI Services Table Pointer Library implementation for IPF that uses Kernel
3 Register 7 to store the pointer.
5 Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
6 This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php.
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
17 #include <Library/BaseLib.h>
18 #include <Library/DebugLib.h>
21 Retrieves the cached value of the PEI Services Table pointer.
23 Returns the cached value of the PEI Services Table pointer in a CPU specific manner
24 as specified in the CPU binding section of the Platform Initialization Pre-EFI
25 Initialization Core Interface Specification.
27 If the cached PEI Services Table pointer is NULL, then ASSERT().
29 @return The pointer to PeiServices.
32 CONST EFI_PEI_SERVICES
**
34 GetPeiServicesTablePointer (
38 CONST EFI_PEI_SERVICES
**PeiServices
;
40 PeiServices
= (CONST EFI_PEI_SERVICES
**)(UINTN
)AsmReadKr7 ();
41 ASSERT (PeiServices
!= NULL
);
47 Caches a pointer PEI Services Table.
49 Caches the pointer to the PEI Services Table specified by PeiServicesTablePointer
50 in a CPU specific manner as specified in the CPU binding section of the Platform Initialization
51 Pre-EFI Initialization Core Interface Specification.
52 The function set the pointer of PEI services in KR7 register
53 according to PI specification.
55 If PeiServicesTablePointer is NULL, then ASSERT().
57 @param PeiServicesTablePointer The address of PeiServices pointer.
61 SetPeiServicesTablePointer (
62 IN CONST EFI_PEI_SERVICES
** PeiServicesTablePointer
65 ASSERT (PeiServicesTablePointer
!= NULL
);
66 AsmWriteKr7 ((UINT64
)(UINTN
)PeiServicesTablePointer
);