TianoCore EDK2 master
Loading...
Searching...
No Matches
SmmMemLib.c
Go to the documentation of this file.
1
14#include <PiSmm.h>
15
16#include <Library/BaseLib.h>
18#include <Library/DebugLib.h>
23#include <Library/UefiLib.h>
24#include <Library/HobLib.h>
25#include <Protocol/SmmAccess2.h>
29
30//
31// attributes for reserved memory before it is promoted to system memory
32//
33#define EFI_MEMORY_PRESENT 0x0100000000000000ULL
34#define EFI_MEMORY_INITIALIZED 0x0200000000000000ULL
35#define EFI_MEMORY_TESTED 0x0400000000000000ULL
36
37EFI_SMRAM_DESCRIPTOR *mSmmMemLibInternalSmramRanges;
38UINTN mSmmMemLibInternalSmramCount;
39
40//
41// Maximum support address used to check input buffer
42//
43EFI_PHYSICAL_ADDRESS mSmmMemLibInternalMaximumSupportAddress = 0;
44
45UINTN mMemoryMapEntryCount;
46EFI_MEMORY_DESCRIPTOR *mMemoryMap;
47UINTN mDescriptorSize;
48
49EFI_GCD_MEMORY_SPACE_DESCRIPTOR *mSmmMemLibGcdMemSpace = NULL;
50UINTN mSmmMemLibGcdMemNumberOfDesc = 0;
51
52EFI_MEMORY_ATTRIBUTES_TABLE *mSmmMemLibMemoryAttributesTable = NULL;
53
54VOID *mRegistrationEndOfDxe;
55VOID *mRegistrationReadyToLock;
56
57BOOLEAN mSmmMemLibSmmReadyToLock = FALSE;
58
63VOID
65 VOID
66 )
67{
68 VOID *Hob;
69 UINT32 RegEax;
70 UINT8 PhysicalAddressBits;
71
72 //
73 // Get physical address bits supported.
74 //
75 Hob = GetFirstHob (EFI_HOB_TYPE_CPU);
76 if (Hob != NULL) {
77 PhysicalAddressBits = ((EFI_HOB_CPU *)Hob)->SizeOfMemorySpace;
78 } else {
79 AsmCpuid (0x80000000, &RegEax, NULL, NULL, NULL);
80 if (RegEax >= 0x80000008) {
81 AsmCpuid (0x80000008, &RegEax, NULL, NULL, NULL);
82 PhysicalAddressBits = (UINT8)RegEax;
83 } else {
84 PhysicalAddressBits = 36;
85 }
86 }
87
88 //
89 // IA-32e paging translates 48-bit linear addresses to 52-bit physical addresses.
90 //
91 ASSERT (PhysicalAddressBits <= 52);
92 if (PhysicalAddressBits > 48) {
93 PhysicalAddressBits = 48;
94 }
95
96 //
97 // Save the maximum support address in one global variable
98 //
99 mSmmMemLibInternalMaximumSupportAddress = (EFI_PHYSICAL_ADDRESS)(UINTN)(LShiftU64 (1, PhysicalAddressBits) - 1);
100 DEBUG ((DEBUG_INFO, "mSmmMemLibInternalMaximumSupportAddress = 0x%lx\n", mSmmMemLibInternalMaximumSupportAddress));
101}
102
112BOOLEAN
113EFIAPI
116 IN UINT64 Length
117 )
118{
119 UINTN Index;
120
121 //
122 // Check override.
123 // NOTE: (B:0->L:4G) is invalid for IA32, but (B:1->L:4G-1)/(B:4G-1->L:1) is valid.
124 //
125 if ((Length > mSmmMemLibInternalMaximumSupportAddress) ||
126 (Buffer > mSmmMemLibInternalMaximumSupportAddress) ||
127 ((Length != 0) && (Buffer > (mSmmMemLibInternalMaximumSupportAddress - (Length - 1)))))
128 {
129 //
130 // Overflow happen
131 //
132 DEBUG ((
133 DEBUG_ERROR,
134 "SmmIsBufferOutsideSmmValid: Overflow: Buffer (0x%lx) - Length (0x%lx), MaximumSupportAddress (0x%lx)\n",
135 Buffer,
136 Length,
137 mSmmMemLibInternalMaximumSupportAddress
138 ));
139 return FALSE;
140 }
141
142 for (Index = 0; Index < mSmmMemLibInternalSmramCount; Index++) {
143 if (((Buffer >= mSmmMemLibInternalSmramRanges[Index].CpuStart) && (Buffer < mSmmMemLibInternalSmramRanges[Index].CpuStart + mSmmMemLibInternalSmramRanges[Index].PhysicalSize)) ||
144 ((mSmmMemLibInternalSmramRanges[Index].CpuStart >= Buffer) && (mSmmMemLibInternalSmramRanges[Index].CpuStart < Buffer + Length)))
145 {
146 DEBUG ((
147 DEBUG_ERROR,
148 "SmmIsBufferOutsideSmmValid: Overlap: Buffer (0x%lx) - Length (0x%lx), ",
149 Buffer,
150 Length
151 ));
152 DEBUG ((
153 DEBUG_ERROR,
154 "CpuStart (0x%lx) - PhysicalSize (0x%lx)\n",
155 mSmmMemLibInternalSmramRanges[Index].CpuStart,
156 mSmmMemLibInternalSmramRanges[Index].PhysicalSize
157 ));
158 return FALSE;
159 }
160 }
161
162 //
163 // Check override for Valid Communication Region
164 //
165 if (mSmmMemLibSmmReadyToLock) {
166 EFI_MEMORY_DESCRIPTOR *MemoryMap;
167 BOOLEAN InValidCommunicationRegion;
168
169 InValidCommunicationRegion = FALSE;
170 MemoryMap = mMemoryMap;
171 for (Index = 0; Index < mMemoryMapEntryCount; Index++) {
172 if ((Buffer >= MemoryMap->PhysicalStart) &&
173 (Buffer + Length <= MemoryMap->PhysicalStart + LShiftU64 (MemoryMap->NumberOfPages, EFI_PAGE_SHIFT)))
174 {
175 InValidCommunicationRegion = TRUE;
176 }
177
178 MemoryMap = NEXT_MEMORY_DESCRIPTOR (MemoryMap, mDescriptorSize);
179 }
180
181 if (!InValidCommunicationRegion) {
182 DEBUG ((
183 DEBUG_ERROR,
184 "SmmIsBufferOutsideSmmValid: Not in ValidCommunicationRegion: Buffer (0x%lx) - Length (0x%lx)\n",
185 Buffer,
186 Length
187 ));
188 return FALSE;
189 }
190
191 //
192 // Check untested memory as invalid communication buffer.
193 //
194 for (Index = 0; Index < mSmmMemLibGcdMemNumberOfDesc; Index++) {
195 if (((Buffer >= mSmmMemLibGcdMemSpace[Index].BaseAddress) && (Buffer < mSmmMemLibGcdMemSpace[Index].BaseAddress + mSmmMemLibGcdMemSpace[Index].Length)) ||
196 ((mSmmMemLibGcdMemSpace[Index].BaseAddress >= Buffer) && (mSmmMemLibGcdMemSpace[Index].BaseAddress < Buffer + Length)))
197 {
198 DEBUG ((
199 DEBUG_ERROR,
200 "SmmIsBufferOutsideSmmValid: In Untested Memory Region: Buffer (0x%lx) - Length (0x%lx)\n",
201 Buffer,
202 Length
203 ));
204 return FALSE;
205 }
206 }
207
208 //
209 // Check UEFI runtime memory with EFI_MEMORY_RO as invalid communication buffer.
210 //
211 if (mSmmMemLibMemoryAttributesTable != NULL) {
213
214 Entry = (EFI_MEMORY_DESCRIPTOR *)(mSmmMemLibMemoryAttributesTable + 1);
215 for (Index = 0; Index < mSmmMemLibMemoryAttributesTable->NumberOfEntries; Index++) {
216 if ((Entry->Type == EfiRuntimeServicesCode) || (Entry->Type == EfiRuntimeServicesData)) {
217 if ((Entry->Attribute & EFI_MEMORY_RO) != 0) {
218 if (((Buffer >= Entry->PhysicalStart) && (Buffer < Entry->PhysicalStart + LShiftU64 (Entry->NumberOfPages, EFI_PAGE_SHIFT))) ||
219 ((Entry->PhysicalStart >= Buffer) && (Entry->PhysicalStart < Buffer + Length)))
220 {
221 DEBUG ((
222 DEBUG_ERROR,
223 "SmmIsBufferOutsideSmmValid: In RuntimeCode Region: Buffer (0x%lx) - Length (0x%lx)\n",
224 Buffer,
225 Length
226 ));
227 return FALSE;
228 }
229 }
230 }
231
232 Entry = NEXT_MEMORY_DESCRIPTOR (Entry, mSmmMemLibMemoryAttributesTable->DescriptorSize);
233 }
234 }
235 }
236
237 return TRUE;
238}
239
258EFIAPI
260 OUT VOID *DestinationBuffer,
261 IN CONST VOID *SourceBuffer,
262 IN UINTN Length
263 )
264{
265 if (!SmmIsBufferOutsideSmmValid ((EFI_PHYSICAL_ADDRESS)(UINTN)SourceBuffer, Length)) {
266 DEBUG ((DEBUG_ERROR, "SmmCopyMemToSmram: Security Violation: Source (0x%x), Length (0x%x)\n", SourceBuffer, Length));
267 return EFI_SECURITY_VIOLATION;
268 }
269
270 CopyMem (DestinationBuffer, SourceBuffer, Length);
271 return EFI_SUCCESS;
272}
273
292EFIAPI
294 OUT VOID *DestinationBuffer,
295 IN CONST VOID *SourceBuffer,
296 IN UINTN Length
297 )
298{
299 if (!SmmIsBufferOutsideSmmValid ((EFI_PHYSICAL_ADDRESS)(UINTN)DestinationBuffer, Length)) {
300 DEBUG ((DEBUG_ERROR, "SmmCopyMemFromSmram: Security Violation: Destination (0x%x), Length (0x%x)\n", DestinationBuffer, Length));
301 return EFI_SECURITY_VIOLATION;
302 }
303
304 CopyMem (DestinationBuffer, SourceBuffer, Length);
305 return EFI_SUCCESS;
306}
307
327EFIAPI
329 OUT VOID *DestinationBuffer,
330 IN CONST VOID *SourceBuffer,
331 IN UINTN Length
332 )
333{
334 if (!SmmIsBufferOutsideSmmValid ((EFI_PHYSICAL_ADDRESS)(UINTN)DestinationBuffer, Length)) {
335 DEBUG ((DEBUG_ERROR, "SmmCopyMem: Security Violation: Destination (0x%x), Length (0x%x)\n", DestinationBuffer, Length));
336 return EFI_SECURITY_VIOLATION;
337 }
338
339 if (!SmmIsBufferOutsideSmmValid ((EFI_PHYSICAL_ADDRESS)(UINTN)SourceBuffer, Length)) {
340 DEBUG ((DEBUG_ERROR, "SmmCopyMem: Security Violation: Source (0x%x), Length (0x%x)\n", SourceBuffer, Length));
341 return EFI_SECURITY_VIOLATION;
342 }
343
344 CopyMem (DestinationBuffer, SourceBuffer, Length);
345 return EFI_SUCCESS;
346}
347
365EFIAPI
367 OUT VOID *Buffer,
368 IN UINTN Length,
369 IN UINT8 Value
370 )
371{
372 if (!SmmIsBufferOutsideSmmValid ((EFI_PHYSICAL_ADDRESS)(UINTN)Buffer, Length)) {
373 DEBUG ((DEBUG_ERROR, "SmmSetMem: Security Violation: Source (0x%x), Length (0x%x)\n", Buffer, Length));
374 return EFI_SECURITY_VIOLATION;
375 }
376
377 SetMem (Buffer, Length, Value);
378 return EFI_SUCCESS;
379}
380
385VOID
387 VOID
388 )
389{
390 UINTN NumberOfDescriptors;
392 EFI_STATUS Status;
393 UINTN Index;
394
395 Status = gDS->GetMemorySpaceMap (&NumberOfDescriptors, &MemSpaceMap);
396 if (EFI_ERROR (Status)) {
397 return;
398 }
399
400 mSmmMemLibGcdMemNumberOfDesc = 0;
401 for (Index = 0; Index < NumberOfDescriptors; Index++) {
402 if ((MemSpaceMap[Index].GcdMemoryType == EfiGcdMemoryTypeReserved) &&
403 ((MemSpaceMap[Index].Capabilities & (EFI_MEMORY_PRESENT | EFI_MEMORY_INITIALIZED | EFI_MEMORY_TESTED)) ==
404 (EFI_MEMORY_PRESENT | EFI_MEMORY_INITIALIZED))
405 )
406 {
407 mSmmMemLibGcdMemNumberOfDesc++;
408 }
409 }
410
411 mSmmMemLibGcdMemSpace = AllocateZeroPool (mSmmMemLibGcdMemNumberOfDesc * sizeof (EFI_GCD_MEMORY_SPACE_DESCRIPTOR));
412 ASSERT (mSmmMemLibGcdMemSpace != NULL);
413 if (mSmmMemLibGcdMemSpace == NULL) {
414 mSmmMemLibGcdMemNumberOfDesc = 0;
415 gBS->FreePool (MemSpaceMap);
416 return;
417 }
418
419 mSmmMemLibGcdMemNumberOfDesc = 0;
420 for (Index = 0; Index < NumberOfDescriptors; Index++) {
421 if ((MemSpaceMap[Index].GcdMemoryType == EfiGcdMemoryTypeReserved) &&
422 ((MemSpaceMap[Index].Capabilities & (EFI_MEMORY_PRESENT | EFI_MEMORY_INITIALIZED | EFI_MEMORY_TESTED)) ==
423 (EFI_MEMORY_PRESENT | EFI_MEMORY_INITIALIZED))
424 )
425 {
426 CopyMem (
427 &mSmmMemLibGcdMemSpace[mSmmMemLibGcdMemNumberOfDesc],
428 &MemSpaceMap[Index],
430 );
431 mSmmMemLibGcdMemNumberOfDesc++;
432 }
433 }
434
435 gBS->FreePool (MemSpaceMap);
436}
437
441VOID
443 VOID
444 )
445{
446 EFI_STATUS Status;
447 EFI_MEMORY_ATTRIBUTES_TABLE *MemoryAttributesTable;
448 UINTN MemoryAttributesTableSize;
449
450 Status = EfiGetSystemConfigurationTable (&gEfiMemoryAttributesTableGuid, (VOID **)&MemoryAttributesTable);
451 if (!EFI_ERROR (Status) && (MemoryAttributesTable != NULL)) {
452 MemoryAttributesTableSize = sizeof (EFI_MEMORY_ATTRIBUTES_TABLE) + MemoryAttributesTable->DescriptorSize * MemoryAttributesTable->NumberOfEntries;
453 mSmmMemLibMemoryAttributesTable = AllocateCopyPool (MemoryAttributesTableSize, MemoryAttributesTable);
454 ASSERT (mSmmMemLibMemoryAttributesTable != NULL);
455 }
456}
457
468EFIAPI
470 IN CONST EFI_GUID *Protocol,
471 IN VOID *Interface,
472 IN EFI_HANDLE Handle
473 )
474{
475 EFI_STATUS Status;
476 UINTN MapKey;
477 UINTN MemoryMapSize;
478 EFI_MEMORY_DESCRIPTOR *MemoryMap;
479 EFI_MEMORY_DESCRIPTOR *MemoryMapStart;
480 EFI_MEMORY_DESCRIPTOR *SmmMemoryMapStart;
481 UINTN MemoryMapEntryCount;
482 UINTN DescriptorSize;
483 UINT32 DescriptorVersion;
484 UINTN Index;
485
486 MemoryMapSize = 0;
487 MemoryMap = NULL;
488 Status = gBS->GetMemoryMap (
489 &MemoryMapSize,
490 MemoryMap,
491 &MapKey,
492 &DescriptorSize,
493 &DescriptorVersion
494 );
495 ASSERT (Status == EFI_BUFFER_TOO_SMALL);
496
497 do {
498 Status = gBS->AllocatePool (EfiBootServicesData, MemoryMapSize, (VOID **)&MemoryMap);
499 ASSERT (MemoryMap != NULL);
500
501 Status = gBS->GetMemoryMap (
502 &MemoryMapSize,
503 MemoryMap,
504 &MapKey,
505 &DescriptorSize,
506 &DescriptorVersion
507 );
508 if (EFI_ERROR (Status)) {
509 gBS->FreePool (MemoryMap);
510 }
511 } while (Status == EFI_BUFFER_TOO_SMALL);
512
513 //
514 // Get Count
515 //
516 mDescriptorSize = DescriptorSize;
517 MemoryMapEntryCount = MemoryMapSize/DescriptorSize;
518 MemoryMapStart = MemoryMap;
519 mMemoryMapEntryCount = 0;
520 for (Index = 0; Index < MemoryMapEntryCount; Index++) {
521 switch (MemoryMap->Type) {
525 case EfiACPIMemoryNVS:
526 mMemoryMapEntryCount++;
527 break;
528 }
529
530 MemoryMap = NEXT_MEMORY_DESCRIPTOR (MemoryMap, DescriptorSize);
531 }
532
533 MemoryMap = MemoryMapStart;
534
535 //
536 // Get Data
537 //
538 mMemoryMap = AllocatePool (mMemoryMapEntryCount*DescriptorSize);
539 ASSERT (mMemoryMap != NULL);
540 SmmMemoryMapStart = mMemoryMap;
541 for (Index = 0; Index < MemoryMapEntryCount; Index++) {
542 switch (MemoryMap->Type) {
546 case EfiACPIMemoryNVS:
547 CopyMem (mMemoryMap, MemoryMap, DescriptorSize);
548 mMemoryMap = NEXT_MEMORY_DESCRIPTOR (mMemoryMap, DescriptorSize);
549 break;
550 }
551
552 MemoryMap = NEXT_MEMORY_DESCRIPTOR (MemoryMap, DescriptorSize);
553 }
554
555 mMemoryMap = SmmMemoryMapStart;
556 MemoryMap = MemoryMapStart;
557
558 gBS->FreePool (MemoryMap);
559
560 //
561 // Get additional information from GCD memory map.
562 //
564
565 //
566 // Get UEFI memory attributes table.
567 //
569
570 return EFI_SUCCESS;
571}
572
583EFIAPI
585 IN CONST EFI_GUID *Protocol,
586 IN VOID *Interface,
587 IN EFI_HANDLE Handle
588 )
589{
590 mSmmMemLibSmmReadyToLock = TRUE;
591 return EFI_SUCCESS;
592}
593
604EFIAPI
606 IN EFI_HANDLE ImageHandle,
607 IN EFI_SYSTEM_TABLE *SystemTable
608 )
609{
610 EFI_STATUS Status;
611 EFI_SMM_ACCESS2_PROTOCOL *SmmAccess;
612 UINTN Size;
613
614 //
615 // Get SMRAM information
616 //
617 Status = gBS->LocateProtocol (&gEfiSmmAccess2ProtocolGuid, NULL, (VOID **)&SmmAccess);
618 ASSERT_EFI_ERROR (Status);
619
620 Size = 0;
621 Status = SmmAccess->GetCapabilities (SmmAccess, &Size, NULL);
622 ASSERT (Status == EFI_BUFFER_TOO_SMALL);
623
624 mSmmMemLibInternalSmramRanges = AllocatePool (Size);
625 ASSERT (mSmmMemLibInternalSmramRanges != NULL);
626
627 Status = SmmAccess->GetCapabilities (SmmAccess, &Size, mSmmMemLibInternalSmramRanges);
628 ASSERT_EFI_ERROR (Status);
629
630 mSmmMemLibInternalSmramCount = Size / sizeof (EFI_SMRAM_DESCRIPTOR);
631
632 //
633 // Calculate and save maximum support address
634 //
636
637 //
638 // Register EndOfDxe to get UEFI memory map
639 //
640 Status = gSmst->SmmRegisterProtocolNotify (&gEfiSmmEndOfDxeProtocolGuid, SmmLibInternalEndOfDxeNotify, &mRegistrationEndOfDxe);
641 ASSERT_EFI_ERROR (Status);
642
643 //
644 // Register ready to lock so that we can know when to check valid SMRAM region
645 //
646 Status = gSmst->SmmRegisterProtocolNotify (&gEfiSmmReadyToLockProtocolGuid, SmmLibInternalReadyToLockNotify, &mRegistrationReadyToLock);
647 ASSERT_EFI_ERROR (Status);
648
649 return EFI_SUCCESS;
650}
651
661EFIAPI
663 IN EFI_HANDLE ImageHandle,
664 IN EFI_SYSTEM_TABLE *SystemTable
665 )
666{
667 FreePool (mSmmMemLibInternalSmramRanges);
668
669 gSmst->SmmRegisterProtocolNotify (&gEfiSmmEndOfDxeProtocolGuid, NULL, &mRegistrationEndOfDxe);
670 gSmst->SmmRegisterProtocolNotify (&gEfiSmmReadyToLockProtocolGuid, NULL, &mRegistrationReadyToLock);
671 return EFI_SUCCESS;
672}
UINT64 UINTN
VOID *EFIAPI GetFirstHob(IN UINT16 Type)
Definition: HobLib.c:142
UINT64 EFIAPI LShiftU64(IN UINT64 Operand, IN UINTN Count)
Definition: LShiftU64.c:28
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
VOID *EFIAPI SetMem(OUT VOID *Buffer, IN UINTN Length, IN UINT8 Value)
Definition: SetMemWrapper.c:38
EFI_DXE_SERVICES * gDS
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
VOID *EFIAPI AllocateCopyPool(IN UINTN AllocationSize, IN CONST VOID *Buffer)
#define NULL
Definition: Base.h:319
#define CONST
Definition: Base.h:259
#define TRUE
Definition: Base.h:301
#define FALSE
Definition: Base.h:307
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
#define ASSERT_EFI_ERROR(StatusParameter)
Definition: DebugLib.h:462
#define DEBUG(Expression)
Definition: DebugLib.h:434
UINT32 EFIAPI AsmCpuid(IN UINT32 Index, OUT UINT32 *RegisterEax OPTIONAL, OUT UINT32 *RegisterEbx OPTIONAL, OUT UINT32 *RegisterEcx OPTIONAL, OUT UINT32 *RegisterEdx OPTIONAL)
Definition: CpuId.c:36
@ EfiGcdMemoryTypeReserved
Definition: PiDxeCis.h:32
EFI_SMM_SYSTEM_TABLE2 * gSmst
VOID *EFIAPI AllocatePool(IN UINTN AllocationSize)
VOID SmmMemLibInternalGetGcdMemoryMap(VOID)
Definition: SmmMemLib.c:386
EFI_STATUS EFIAPI SmmLibInternalReadyToLockNotify(IN CONST EFI_GUID *Protocol, IN VOID *Interface, IN EFI_HANDLE Handle)
Definition: SmmMemLib.c:584
EFI_STATUS EFIAPI SmmLibInternalEndOfDxeNotify(IN CONST EFI_GUID *Protocol, IN VOID *Interface, IN EFI_HANDLE Handle)
Definition: SmmMemLib.c:469
EFI_STATUS EFIAPI SmmCopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
Definition: SmmMemLib.c:328
EFI_STATUS EFIAPI SmmSetMem(OUT VOID *Buffer, IN UINTN Length, IN UINT8 Value)
Definition: SmmMemLib.c:366
VOID SmmMemLibInternalGetUefiMemoryAttributesTable(VOID)
Definition: SmmMemLib.c:442
EFI_STATUS EFIAPI SmmMemLibConstructor(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
Definition: SmmMemLib.c:605
VOID SmmMemLibInternalCalculateMaximumSupportAddress(VOID)
Definition: SmmMemLib.c:64
EFI_STATUS EFIAPI SmmCopyMemFromSmram(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
Definition: SmmMemLib.c:293
EFI_STATUS EFIAPI SmmMemLibDestructor(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
Definition: SmmMemLib.c:662
BOOLEAN EFIAPI SmmIsBufferOutsideSmmValid(IN EFI_PHYSICAL_ADDRESS Buffer, IN UINT64 Length)
Definition: SmmMemLib.c:114
EFI_STATUS EFIAPI SmmCopyMemToSmram(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
Definition: SmmMemLib.c:259
UINT64 EFI_PHYSICAL_ADDRESS
Definition: UefiBaseType.h:50
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_HANDLE
Definition: UefiBaseType.h:33
#define EFI_SUCCESS
Definition: UefiBaseType.h:112
EFI_BOOT_SERVICES * gBS
EFI_STATUS EFIAPI EfiGetSystemConfigurationTable(IN EFI_GUID *TableGuid, OUT VOID **Table)
Definition: UefiLib.c:82
@ EfiBootServicesData
@ EfiReservedMemoryType
@ EfiACPIMemoryNVS
@ EfiRuntimeServicesCode
@ EfiRuntimeServicesData
EFI_PHYSICAL_ADDRESS PhysicalStart
Definition: UefiSpec.h:155
Definition: Base.h:213