]> git.proxmox.com Git - mirror_edk2.git/blame - ArmPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointer.c
ArmPkg/DebugAgentSymbolsBaseLib: remove exception handling
[mirror_edk2.git] / ArmPkg / Library / PeiServicesTablePointerLib / PeiServicesTablePointer.c
CommitLineData
0530bfe3 1/** @file\r
2 PEI Services Table Pointer Library.\r
3402aac7 3\r
0530bfe3 4 This library is used for PEIM which does executed from flash device directly but\r
5 executed in memory.\r
6\r
7 Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
8 Copyright (c) 2011 Hewlett-Packard Corporation. All rights reserved.<BR>\r
9 This program and the accompanying materials\r
10 are licensed and made available under the terms and conditions of the BSD License\r
11 which accompanies this distribution. The full text of the license may be found at\r
12 http://opensource.org/licenses/bsd-license.php.\r
13\r
14 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
15 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
16\r
17**/\r
18\r
19#include <PiPei.h>\r
20#include <Library/PeiServicesTablePointerLib.h>\r
21#include <Library/ArmLib.h>\r
22#include <Library/DebugLib.h>\r
23\r
24/**\r
3402aac7
RC
25 Caches a pointer PEI Services Table.\r
26\r
27 Caches the pointer to the PEI Services Table specified by PeiServicesTablePointer\r
0530bfe3 28 in a platform specific manner.\r
3402aac7 29\r
0530bfe3 30 If PeiServicesTablePointer is NULL, then ASSERT().\r
3402aac7 31\r
0530bfe3 32 @param PeiServicesTablePointer The address of PeiServices pointer.\r
33**/\r
34VOID\r
35EFIAPI\r
36SetPeiServicesTablePointer (\r
37 IN CONST EFI_PEI_SERVICES ** PeiServicesTablePointer\r
38 )\r
39{\r
40 ArmWriteTpidrurw((UINTN)PeiServicesTablePointer);\r
41}\r
42\r
43/**\r
44 Retrieves the cached value of the PEI Services Table pointer.\r
45\r
3402aac7
RC
46 Returns the cached value of the PEI Services Table pointer in a CPU specific manner\r
47 as specified in the CPU binding section of the Platform Initialization Pre-EFI\r
0530bfe3 48 Initialization Core Interface Specification.\r
3402aac7 49\r
0530bfe3 50 If the cached PEI Services Table pointer is NULL, then ASSERT().\r
51\r
52 @return The pointer to PeiServices.\r
53\r
54**/\r
55CONST EFI_PEI_SERVICES **\r
56EFIAPI\r
57GetPeiServicesTablePointer (\r
58 VOID\r
59 )\r
60{\r
61 return (CONST EFI_PEI_SERVICES **)ArmReadTpidrurw();\r
62}\r
ebe32e89
EC
63\r
64/**\r
65Perform CPU specific actions required to migrate the PEI Services Table\r
66pointer from temporary RAM to permanent RAM.\r
67\r
68For IA32 CPUs, the PEI Services Table pointer is stored in the 4 bytes\r
69immediately preceding the Interrupt Descriptor Table (IDT) in memory.\r
70For X64 CPUs, the PEI Services Table pointer is stored in the 8 bytes\r
71immediately preceding the Interrupt Descriptor Table (IDT) in memory.\r
72For Itanium and ARM CPUs, a the PEI Services Table Pointer is stored in\r
73a dedicated CPU register. This means that there is no memory storage\r
74associated with storing the PEI Services Table pointer, so no additional\r
75migration actions are required for Itanium or ARM CPUs.\r
76\r
77**/\r
78VOID\r
79EFIAPI\r
80MigratePeiServicesTablePointer(\r
81VOID\r
82)\r
83{\r
84 return;\r
85}\r