1 /** @file 2 Provides a service to retrieve a pointer to the PEI Services Table. 3 4 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR> 5 SPDX-License-Identifier: BSD-2-Clause-Patent 6 7 **/ 8 9 #ifndef __PEI_SERVICES_TABLE_POINTER_LIB_H__ 10 #define __PEI_SERVICES_TABLE_POINTER_LIB_H__ 11 12 /** 13 Retrieves the cached value of the PEI Services Table pointer. 14 15 Returns the cached value of the PEI Services Table pointer in a CPU specific manner 16 as specified in the CPU binding section of the Platform Initialization Pre-EFI 17 Initialization Core Interface Specification. 18 19 If the cached PEI Services Table pointer is NULL, then ASSERT(). 20 21 @return The pointer to PeiServices. 22 23 **/ 24 CONST EFI_PEI_SERVICES ** 25 EFIAPI 26 GetPeiServicesTablePointer ( 27 VOID 28 ); 29 30 /** 31 Caches a pointer PEI Services Table. 32 33 Caches the pointer to the PEI Services Table specified by PeiServicesTablePointer 34 in a CPU specific manner as specified in the CPU binding section of the Platform Initialization 35 Pre-EFI Initialization Core Interface Specification. 36 37 If PeiServicesTablePointer is NULL, then ASSERT(). 38 39 @param PeiServicesTablePointer The address of PeiServices pointer. 40 **/ 41 VOID 42 EFIAPI 43 SetPeiServicesTablePointer ( 44 IN CONST EFI_PEI_SERVICES ** PeiServicesTablePointer 45 ); 46 47 /** 48 Perform CPU specific actions required to migrate the PEI Services Table 49 pointer from temporary RAM to permanent RAM. 50 51 For IA32 CPUs, the PEI Services Table pointer is stored in the 4 bytes 52 immediately preceding the Interrupt Descriptor Table (IDT) in memory. 53 For X64 CPUs, the PEI Services Table pointer is stored in the 8 bytes 54 immediately preceding the Interrupt Descriptor Table (IDT) in memory. 55 For Itanium and ARM CPUs, a the PEI Services Table Pointer is stored in 56 a dedicated CPU register. This means that there is no memory storage 57 associated with storing the PEI Services Table pointer, so no additional 58 migration actions are required for Itanium or ARM CPUs. 59 60 **/ 61 VOID 62 EFIAPI 63 MigratePeiServicesTablePointer ( 64 VOID 65 ); 66 67 #endif 68 69