blob: 7ea6cc10c54043589971cd2447298cf7480202a6 [file] [log] [blame]
Vishal Bhoj82c80712015-12-15 21:13:33 +05301/** @file
2 Provides a service to retrieve a pointer to the PEI Services Table.
3
4Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
5This program and the accompanying materials
6are licensed and made available under the terms and conditions of the BSD License
7which accompanies this distribution. The full text of the license may be found at
8http://opensource.org/licenses/bsd-license.php
9
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13**/
14
15#ifndef __PEI_SERVICES_TABLE_POINTER_LIB_H__
16#define __PEI_SERVICES_TABLE_POINTER_LIB_H__
17
18/**
19 Retrieves the cached value of the PEI Services Table pointer.
20
21 Returns the cached value of the PEI Services Table pointer in a CPU specific manner
22 as specified in the CPU binding section of the Platform Initialization Pre-EFI
23 Initialization Core Interface Specification.
24
25 If the cached PEI Services Table pointer is NULL, then ASSERT().
26
27 @return The pointer to PeiServices.
28
29**/
30CONST EFI_PEI_SERVICES **
31EFIAPI
32GetPeiServicesTablePointer (
33 VOID
34 );
35
36/**
37 Caches a pointer PEI Services Table.
38
39 Caches the pointer to the PEI Services Table specified by PeiServicesTablePointer
40 in a CPU specific manner as specified in the CPU binding section of the Platform Initialization
41 Pre-EFI Initialization Core Interface Specification.
42
43 If PeiServicesTablePointer is NULL, then ASSERT().
44
45 @param PeiServicesTablePointer The address of PeiServices pointer.
46**/
47VOID
48EFIAPI
49SetPeiServicesTablePointer (
50 IN CONST EFI_PEI_SERVICES ** PeiServicesTablePointer
51 );
52
53/**
54 Perform CPU specific actions required to migrate the PEI Services Table
55 pointer from temporary RAM to permanent RAM.
56
57 For IA32 CPUs, the PEI Services Table pointer is stored in the 4 bytes
58 immediately preceding the Interrupt Descriptor Table (IDT) in memory.
59 For X64 CPUs, the PEI Services Table pointer is stored in the 8 bytes
60 immediately preceding the Interrupt Descriptor Table (IDT) in memory.
61 For Itanium and ARM CPUs, a the PEI Services Table Pointer is stored in
62 a dedicated CPU register. This means that there is no memory storage
63 associated with storing the PEI Services Table pointer, so no additional
64 migration actions are required for Itanium or ARM CPUs.
65
66**/
67VOID
68EFIAPI
69MigratePeiServicesTablePointer (
70 VOID
71 );
72
73#endif
74