VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointer.c@ 58459

最後變更 在這個檔案從58459是 58459,由 vboxsync 提交於 9 年 前

EFI/Firmware: 'svn merge /vendor/edk2/UDK2010.SR1 /vendor/edk2/current .', reverting and removing files+dirs listed in ReadMe.vbox, resolving conflicts with help from ../UDK2014.SP1/. This is a raw untested merge.

  • 屬性 svn:eol-style 設為 native
檔案大小: 3.3 KB
 
1/** @file
2 PEI Services Table Pointer Library.
3
4 This library is used for PEIM which does executed from flash device directly but
5 executed in memory.
6
7 Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
8 This program and the accompanying materials
9 are licensed and made available under the terms and conditions of the BSD License
10 which accompanies this distribution. The full text of the license may be found at
11 http://opensource.org/licenses/bsd-license.php.
12
13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15
16**/
17
18#include <PiPei.h>
19#include <Library/PeiServicesTablePointerLib.h>
20#include <Library/DebugLib.h>
21
22CONST EFI_PEI_SERVICES **gPeiServices;
23
24/**
25 Caches a pointer PEI Services Table.
26
27 Caches the pointer to the PEI Services Table specified by PeiServicesTablePointer
28 in a CPU specific manner as specified in the CPU binding section of the Platform Initialization
29 Pre-EFI Initialization Core Interface Specification.
30
31 If PeiServicesTablePointer is NULL, then ASSERT().
32
33 @param PeiServicesTablePointer The address of PeiServices pointer.
34**/
35VOID
36EFIAPI
37SetPeiServicesTablePointer (
38 IN CONST EFI_PEI_SERVICES ** PeiServicesTablePointer
39 )
40{
41 ASSERT (PeiServicesTablePointer != NULL);
42 gPeiServices = PeiServicesTablePointer;
43}
44
45/**
46 Retrieves the cached value of the PEI Services Table pointer.
47
48 Returns the cached value of the PEI Services Table pointer in a CPU specific manner
49 as specified in the CPU binding section of the Platform Initialization Pre-EFI
50 Initialization Core Interface Specification.
51
52 If the cached PEI Services Table pointer is NULL, then ASSERT().
53
54 @return The pointer to PeiServices.
55
56**/
57CONST EFI_PEI_SERVICES **
58EFIAPI
59GetPeiServicesTablePointer (
60 VOID
61 )
62{
63 ASSERT (gPeiServices != NULL);
64 return gPeiServices;
65}
66
67
68/**
69 The constructor function caches the pointer to PEI services.
70
71 The constructor function caches the pointer to PEI services.
72 It will always return EFI_SUCCESS.
73
74 @param FileHandle The handle of FFS header the loaded driver.
75 @param PeiServices The pointer to the PEI services.
76
77 @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.
78
79**/
80EFI_STATUS
81EFIAPI
82PeiServicesTablePointerLibConstructor (
83 IN EFI_PEI_FILE_HANDLE FileHandle,
84 IN CONST EFI_PEI_SERVICES **PeiServices
85 )
86{
87 gPeiServices = PeiServices;
88 return EFI_SUCCESS;
89}
90
91/**
92 Perform CPU specific actions required to migrate the PEI Services Table
93 pointer from temporary RAM to permanent RAM.
94
95 For IA32 CPUs, the PEI Services Table pointer is stored in the 4 bytes
96 immediately preceding the Interrupt Descriptor Table (IDT) in memory.
97 For X64 CPUs, the PEI Services Table pointer is stored in the 8 bytes
98 immediately preceding the Interrupt Descriptor Table (IDT) in memory.
99 For Itanium and ARM CPUs, a the PEI Services Table Pointer is stored in
100 a dedicated CPU register. This means that there is no memory storage
101 associated with storing the PEI Services Table pointer, so no additional
102 migration actions are required for Itanium or ARM CPUs.
103
104**/
105VOID
106EFIAPI
107MigratePeiServicesTablePointer (
108 VOID
109 )
110{
111 //
112 // PEI Services Table pointer is cached in the global variable. No additional
113 // migration actions are required.
114 //
115 return;
116}
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette