]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/PeiServicesTablePointerLibKr7/PeiServicesTablePointer.c
Add SetPeiServicesTablePointer() interface implement in PeiServicesTablePointerLibKr7
[mirror_edk2.git] / MdePkg / Library / PeiServicesTablePointerLibKr7 / PeiServicesTablePointer.c
1 /** @file
2 PEI Services Table Pointer Library implementation for IPF that uses Kernel
3 Register 7 to store the pointer.
4
5 Copyright (c) 2006 - 2007, Intel Corporation.<BR>
6 All rights reserved. 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
10
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.
13
14 **/
15
16 #include <PiPei.h>
17 #include <Library/BaseLib.h>
18 #include <Library/DebugLib.h>
19
20 /**
21 The function returns the pointer to PeiServices.
22
23 The function returns the pointer to PeiServices.
24 It will ASSERT() if the pointer to PeiServices is NULL.
25
26 @retval The pointer to PeiServices.
27
28 **/
29 EFI_PEI_SERVICES **
30 EFIAPI
31 GetPeiServicesTablePointer (
32 VOID
33 )
34 {
35 EFI_PEI_SERVICES **PeiServices;
36
37 PeiServices = (EFI_PEI_SERVICES **)(UINTN)AsmReadKr7 ();
38 ASSERT (PeiServices != NULL);
39 return PeiServices;
40 }
41
42 /**
43 The constructor function caches the pointer to PEI services.
44
45 The constructor function caches the pointer to PEI services.
46 It will always return EFI_SUCCESS.
47
48 @param FfsHeader Pointer to FFS header the loaded driver.
49 @param PeiServices Pointer to the PEI services.
50
51 @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.
52
53 **/
54 EFI_STATUS
55 EFIAPI
56 PeiServicesTablePointerLibConstructor (
57 IN EFI_PEI_FILE_HANDLE *FfsHeader,
58 IN EFI_PEI_SERVICES **PeiServices
59 )
60 {
61 AsmWriteKr7 ((UINT64)(UINTN)PeiServices);
62 return EFI_SUCCESS;
63 }
64
65 /**
66 The function set the pointer of PEI services immediately preceding the IDT table
67 according to PI specification.
68
69 @param PeiServices The address of PeiServices pointer.
70 **/
71 VOID
72 EFIAPI
73 SetPeiServicesTablePointer (
74 EFI_PEI_SERVICES ** PeiServicesTablePointer
75 )
76 {
77 }
78
79 /**
80 After memory initialization in PEI phase, the IDT table in temporary memory should
81 be migrated to memory, and the address of PeiServicesPointer also need to be updated
82 immediately preceding the new IDT table.
83
84 @param PeiServices The address of PeiServices pointer.
85 **/
86 VOID
87 MigrateIdtTable (
88 IN EFI_PEI_SERVICES **PeiServices
89 )
90 {
91 }
92
93