TianoCore EDK2 master
Loading...
Searching...
No Matches
SmmAccess2Dxe.c
Go to the documentation of this file.
1
15#include <Library/DebugLib.h>
16#include <Library/PcdLib.h>
18#include <Protocol/SmmAccess2.h>
19
20#include "SmramInternal.h"
21
40EFIAPI
43 )
44{
45 return SmramAccessOpen (&This->LockState, &This->OpenState);
46}
47
64EFIAPI
67 )
68{
69 return SmramAccessClose (&This->LockState, &This->OpenState);
70}
71
85EFIAPI
88 )
89{
90 return SmramAccessLock (&This->LockState, &This->OpenState);
91}
92
108STATIC
110EFIAPI
113 IN OUT UINTN *SmramMapSize,
114 IN OUT EFI_SMRAM_DESCRIPTOR *SmramMap
115 )
116{
117 return SmramAccessGetCapabilities (
118 SmramMapSize,
119 SmramMap
120 );
121}
122
123//
124// LockState and OpenState will be filled in by the entry point.
125//
131};
132
133//
134// Entry point of this driver.
135//
137EFIAPI
138SmmAccess2DxeEntryPoint (
139 IN EFI_HANDLE ImageHandle,
140 IN EFI_SYSTEM_TABLE *SystemTable
141 )
142{
143 //
144 // This module should only be included if SMRAM support is required.
145 //
146 ASSERT (FeaturePcdGet (PcdSmmSmramRequire));
147
149 GetStates (&mAccess2.LockState, &mAccess2.OpenState);
150
151 //
152 // SmramAccessLock() depends on "mQ35SmramAtDefaultSmbase"; init the latter
153 // just before exposing the former via EFI_SMM_ACCESS2_PROTOCOL.Lock().
154 //
156
157 return gBS->InstallMultipleProtocolInterfaces (
158 &ImageHandle,
159 &gEfiSmmAccess2ProtocolGuid,
160 &mAccess2,
161 NULL
162 );
163}
UINT64 UINTN
#define NULL
Definition: Base.h:319
#define CONST
Definition: Base.h:259
#define STATIC
Definition: Base.h:264
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
#define FeaturePcdGet(TokenName)
Definition: PcdLib.h:50
STATIC EFI_STATUS EFIAPI SmmAccess2DxeGetCapabilities(IN CONST EFI_SMM_ACCESS2_PROTOCOL *This, IN OUT UINTN *SmramMapSize, IN OUT EFI_SMRAM_DESCRIPTOR *SmramMap)
STATIC EFI_STATUS EFIAPI SmmAccess2DxeLock(IN EFI_SMM_ACCESS2_PROTOCOL *This)
Definition: SmmAccess2Dxe.c:86
STATIC EFI_STATUS EFIAPI SmmAccess2DxeOpen(IN EFI_SMM_ACCESS2_PROTOCOL *This)
Definition: SmmAccess2Dxe.c:41
STATIC EFI_STATUS EFIAPI SmmAccess2DxeClose(IN EFI_SMM_ACCESS2_PROTOCOL *This)
Definition: SmmAccess2Dxe.c:65
VOID InitQ35SmramAtDefaultSmbase(VOID)
Definition: SmramInternal.c:44
VOID GetStates(OUT BOOLEAN *LockState, OUT BOOLEAN *OpenState)
Definition: SmramInternal.c:66
VOID InitQ35TsegMbytes(VOID)
Definition: SmramInternal.c:33
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_HANDLE
Definition: UefiBaseType.h:33
EFI_BOOT_SERVICES * gBS