]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - ArmPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointer.c
ArmPkg: Apply uncrustify changes
[mirror_edk2.git] / ArmPkg / Library / PeiServicesTablePointerLib / PeiServicesTablePointer.c
... / ...
CommitLineData
1/** @file\r
2 PEI Services Table Pointer Library.\r
3\r
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 SPDX-License-Identifier: BSD-2-Clause-Patent\r
10\r
11**/\r
12\r
13#include <PiPei.h>\r
14#include <Library/PeiServicesTablePointerLib.h>\r
15#include <Library/ArmLib.h>\r
16#include <Library/DebugLib.h>\r
17\r
18/**\r
19 Caches a pointer PEI Services Table.\r
20\r
21 Caches the pointer to the PEI Services Table specified by PeiServicesTablePointer\r
22 in a platform specific manner.\r
23\r
24 If PeiServicesTablePointer is NULL, then ASSERT().\r
25\r
26 @param PeiServicesTablePointer The address of PeiServices pointer.\r
27**/\r
28VOID\r
29EFIAPI\r
30SetPeiServicesTablePointer (\r
31 IN CONST EFI_PEI_SERVICES **PeiServicesTablePointer\r
32 )\r
33{\r
34 ArmWriteTpidrurw ((UINTN)PeiServicesTablePointer);\r
35}\r
36\r
37/**\r
38 Retrieves the cached value of the PEI Services Table pointer.\r
39\r
40 Returns the cached value of the PEI Services Table pointer in a CPU specific manner\r
41 as specified in the CPU binding section of the Platform Initialization Pre-EFI\r
42 Initialization Core Interface Specification.\r
43\r
44 If the cached PEI Services Table pointer is NULL, then ASSERT().\r
45\r
46 @return The pointer to PeiServices.\r
47\r
48**/\r
49CONST EFI_PEI_SERVICES **\r
50EFIAPI\r
51GetPeiServicesTablePointer (\r
52 VOID\r
53 )\r
54{\r
55 return (CONST EFI_PEI_SERVICES **)ArmReadTpidrurw ();\r
56}\r
57\r
58/**\r
59Perform CPU specific actions required to migrate the PEI Services Table\r
60pointer from temporary RAM to permanent RAM.\r
61\r
62For IA32 CPUs, the PEI Services Table pointer is stored in the 4 bytes\r
63immediately preceding the Interrupt Descriptor Table (IDT) in memory.\r
64For X64 CPUs, the PEI Services Table pointer is stored in the 8 bytes\r
65immediately preceding the Interrupt Descriptor Table (IDT) in memory.\r
66For Itanium and ARM CPUs, a the PEI Services Table Pointer is stored in\r
67a dedicated CPU register. This means that there is no memory storage\r
68associated with storing the PEI Services Table pointer, so no additional\r
69migration actions are required for Itanium or ARM CPUs.\r
70\r
71**/\r
72VOID\r
73EFIAPI\r
74MigratePeiServicesTablePointer (\r
75 VOID\r
76 )\r
77{\r
78 return;\r
79}\r