Changeset 108794 in vbox for trunk/src/VBox/Devices/EFI/FirmwareNew/StandaloneMmPkg/Library/StandaloneMmMemLib/StandaloneMmMemLib.c
- Timestamp:
- Mar 31, 2025 11:31:09 AM (2 weeks ago)
- svn:sync-xref-src-repo-rev:
- 168237
- Location:
- trunk/src/VBox/Devices/EFI/FirmwareNew
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/FirmwareNew
-
Property svn:mergeinfo
changed from (toggle deleted branches)
to (toggle deleted branches)/vendor/edk2/current 103735-103757,103769-103776,129194-164365 /vendor/edk2/current 103735-103757,103769-103776,129194-168232
-
Property svn:mergeinfo
changed from (toggle deleted branches)
-
trunk/src/VBox/Devices/EFI/FirmwareNew/StandaloneMmPkg/Library/StandaloneMmMemLib/StandaloneMmMemLib.c
r99404 r108794 7 7 and MM driver) and/or specific dedicated hardware. 8 8 9 Copyright (c) 2015 , Intel Corporation. All rights reserved.<BR>9 Copyright (c) 2015 - 2024, Intel Corporation. All rights reserved.<BR> 10 10 Copyright (c) 2016 - 2021, Arm Limited. All rights reserved.<BR> 11 11 … … 14 14 **/ 15 15 16 #include <PiMm.h> 17 18 #include <Library/BaseLib.h> 19 #include <Library/BaseMemoryLib.h> 20 #include <Library/DebugLib.h> 21 22 EFI_MMRAM_DESCRIPTOR *mMmMemLibInternalMmramRanges; 23 UINTN mMmMemLibInternalMmramCount; 16 #include "StandaloneMmMemLibInternal.h" 24 17 25 18 // … … 29 22 30 23 /** 31 Calculate and save the maximum support address.32 33 **/34 VOID35 MmMemLibInternalCalculateMaximumSupportAddress (36 VOID37 );38 39 /**40 Initialize cached Mmram Ranges from HOB.41 42 @retval EFI_UNSUPPORTED The routine is unable to extract MMRAM information.43 @retval EFI_SUCCESS MmRanges are populated successfully.44 45 **/46 EFI_STATUS47 MmMemLibInternalPopulateMmramRanges (48 VOID49 );50 51 /**52 Deinitialize cached Mmram Ranges.53 54 **/55 VOID56 MmMemLibInternalFreeMmramRanges (57 VOID58 );59 60 /**61 24 This function check if the buffer is valid per processor architecture and not overlap with MMRAM. 62 25 … … 74 37 ) 75 38 { 76 UINTN Index;77 78 39 // 79 40 // Check override. … … 97 58 } 98 59 99 for (Index = 0; Index < mMmMemLibInternalMmramCount; Index++) { 100 if (((Buffer >= mMmMemLibInternalMmramRanges[Index].CpuStart) && 101 (Buffer < mMmMemLibInternalMmramRanges[Index].CpuStart + mMmMemLibInternalMmramRanges[Index].PhysicalSize)) || 102 ((mMmMemLibInternalMmramRanges[Index].CpuStart >= Buffer) && 103 (mMmMemLibInternalMmramRanges[Index].CpuStart < Buffer + Length))) 104 { 105 DEBUG (( 106 DEBUG_ERROR, 107 "MmIsBufferOutsideMmValid: Overlap: Buffer (0x%lx) - Length (0x%lx), ", 108 Buffer, 109 Length 110 )); 111 DEBUG (( 112 DEBUG_ERROR, 113 "CpuStart (0x%lx) - PhysicalSize (0x%lx)\n", 114 mMmMemLibInternalMmramRanges[Index].CpuStart, 115 mMmMemLibInternalMmramRanges[Index].PhysicalSize 116 )); 117 return FALSE; 118 } 119 } 120 121 return TRUE; 60 return MmMemLibIsValidNonMmramRange (Buffer, Length); 122 61 } 123 62 … … 289 228 ) 290 229 { 291 EFI_STATUS Status;292 293 230 // 294 231 // Calculate and save maximum support address 295 232 // 296 MmMemLib InternalCalculateMaximumSupportAddress ();297 298 // 299 // Initialize cached Mmram Ranges fromHOB.300 // 301 Status = MmMemLibInternalPopulateMmramRanges ();302 303 return Status;233 MmMemLibCalculateMaximumSupportAddress (); 234 235 // 236 // Initialize valid non-Mmram Ranges from Resource HOB. 237 // 238 MmMemLibInitializeValidNonMmramRanges (); 239 240 return EFI_SUCCESS; 304 241 } 305 242 … … 321 258 { 322 259 // 323 // Deinitialize cached Mmram Ranges. 324 // 325 MmMemLibInternalFreeMmramRanges (); 326 327 return EFI_SUCCESS; 328 } 260 // Deinitialize cached non-Mmram Ranges. 261 // 262 MmMemLibFreeValidNonMmramRanges (); 263 return EFI_SUCCESS; 264 }
Note:
See TracChangeset
for help on using the changeset viewer.