Changeset 107874 in vbox
- Timestamp:
- Jan 21, 2025 2:53:44 PM (2 weeks ago)
- Location:
- trunk/src/VBox/Devices/EFI/Firmware
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
r80721 r107874 50 50 DebugLib 51 51 BaseLib 52 IoLib # VBox: Added 52 53 -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLib/CopyMem.c
r107872 r107874 14 14 #include "MemLibInternals.h" 15 15 16 #if defined(VBOX) && defined(_MSC_VER) 17 # pragma optimize("", off) 18 #endif 16 #include <Library/IoLib.h> 17 19 18 20 19 /** … … 54 53 Source64 = (CONST UINT64 *)SourceBuffer; 55 54 while (Length >= 8) { 55 #if !defined(VBOX) || !defined(MDE_CPU_AARCH64) 56 56 *(Destination64++) = *(Source64++); 57 #else 58 MmioWrite64(Destination64, MmioRead64(Source64)); 59 Destination64++; 60 Source64++; 61 #endif 57 62 Length -= 8; 58 63 } … … 62 67 Source8 = (CONST UINT8 *)Source64; 63 68 while (Length-- != 0) { 69 #if !defined(VBOX) || !defined(MDE_CPU_AARCH64) 64 70 *(Destination8++) = *(Source8++); 71 #else 72 MmioWrite8(Destination8, MmioRead8(Source8)); 73 Destination8++; 74 Source8++; 75 #endif 65 76 } 66 77 } else if (SourceBuffer < DestinationBuffer) { … … 78 89 79 90 while (Alignment-- != 0) { 91 #if !defined(VBOX) || !defined(MDE_CPU_AARCH64) 80 92 *(--Destination8) = *(--Source8); 93 #else 94 Destination8--; 95 Source8--; 96 MmioWrite8(Destination8, MmioRead8(Source8)); 97 #endif 81 98 --Length; 82 99 } … … 87 104 88 105 while (Length > 0) { 106 #if !defined(VBOX) || !defined(MDE_CPU_AARCH64) 89 107 *(--Destination64) = *(--Source64); 108 #else 109 Destination64--; 110 Source64--; 111 MmioWrite64(Destination64, MmioRead64(Source64)); 112 #endif 90 113 Length -= 8; 91 114 } … … 96 119 Source32 = (CONST UINT32 *)SourceBuffer; 97 120 while (Length >= 4) { 121 #if !defined(VBOX) || !defined(MDE_CPU_AARCH64) 98 122 *(Destination32++) = *(Source32++); 123 #else 124 MmioWrite32(Destination32, MmioRead32(Source32)); 125 Destination32++; 126 Source32++; 127 #endif 99 128 Length -= 4; 100 129 } … … 104 133 Source8 = (CONST UINT8 *)Source32; 105 134 while (Length-- != 0) { 135 #if !defined(VBOX) || !defined(MDE_CPU_AARCH64) 106 136 *(Destination8++) = *(Source8++); 137 #else 138 MmioWrite8(Destination8, MmioRead8(Source8)); 139 Destination8++; 140 Source8++; 141 #endif 107 142 } 108 143 } else if (SourceBuffer < DestinationBuffer) { … … 120 155 121 156 while (Alignment-- != 0) { 157 #if !defined(VBOX) || !defined(MDE_CPU_AARCH64) 122 158 *(--Destination8) = *(--Source8); 159 #else 160 Destination8--; 161 Source8--; 162 MmioWrite8(Destination8, MmioRead8(Source8)); 163 #endif 123 164 --Length; 124 165 } … … 129 170 130 171 while (Length > 0) { 172 #if !defined(VBOX) || !defined(MDE_CPU_AARCH64) 131 173 *(--Destination32) = *(--Source32); 174 #else 175 Destination32--; 176 Source32--; 177 MmioWrite32(Destination32, MmioRead32(Source32)); 178 #endif 132 179 Length -= 4; 133 180 } … … 138 185 Source8 = (CONST UINT8 *)SourceBuffer; 139 186 while (Length-- != 0) { 187 #if !defined(VBOX) || !defined(MDE_CPU_AARCH64) 140 188 *(Destination8++) = *(Source8++); 189 #else 190 MmioWrite8(Destination8, MmioRead8(Source8)); 191 Destination8++; 192 Source8++; 193 #endif 141 194 } 142 195 } else if (SourceBuffer < DestinationBuffer) { … … 144 197 Source8 = (CONST UINT8 *)SourceBuffer + (Length - 1); 145 198 while (Length-- != 0) { 199 #if !defined(VBOX) || !defined(MDE_CPU_AARCH64) 146 200 *(Destination8--) = *(Source8--); 201 #else 202 MmioWrite8(Destination8, MmioRead8(Source8)); 203 Destination8--; 204 Source8--; 205 #endif 147 206 } 148 207 } … … 151 210 return DestinationBuffer; 152 211 } 153 154 #if defined(VBOX) && defined(_MSC_VER)155 # pragma optimize("", on)156 #endif -
trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/VirtNorFlashDxe/VirtNorFlashFvb.c
r105670 r107874 173 173 } 174 174 175 #if defined(VBOX) && defined(MDE_CPU_AARCH64) 176 static UINT16 NorFlashCalculateSum16 ( 177 IN CONST UINT16 *Buffer, 178 IN UINTN Length 179 ) 180 { 181 UINT16 Sum; 182 UINTN Count; 183 UINTN Total; 184 185 ASSERT (Buffer != NULL); 186 ASSERT (((UINTN)Buffer & 0x1) == 0); 187 ASSERT ((Length & 0x1) == 0); 188 ASSERT (Length <= (MAX_ADDRESS - ((UINTN)Buffer) + 1)); 189 190 Total = Length / sizeof (*Buffer); 191 for (Sum = 0, Count = 0; Count < Total; Count++) { 192 Sum += MmioRead16((volatile UINT16 *)(Buffer + Count)); 193 } 194 195 return Sum; 196 } 197 #endif 198 175 199 /** 176 200 Check the integrity of firmware volume header. … … 228 252 229 253 // Verify the header checksum 254 #if !defined(VBOX) || !defined(MDE_CPU_AARCH64) 230 255 Checksum = CalculateSum16 ((UINT16 *)FwVolHeader, FwVolHeader->HeaderLength); 256 #else 257 Checksum = NorFlashCalculateSum16 ((UINT16 *)FwVolHeader, FwVolHeader->HeaderLength); 258 #endif 231 259 if (Checksum != 0) { 232 260 DEBUG (( … … 383 411 } 384 412 413 #if !defined(VBOX) || !defined(MDE_CPU_AARCH64) /* MSVC/clang generate instructions on arm64 in debug builds not supported by IEM right now. */ 385 414 DEBUG (( 386 415 DEBUG_VERBOSE, … … 394 423 VarState 395 424 )); 425 #endif 396 426 397 427 VarPadding = (4 - (VarEnd & 3)) & 3;
Note:
See TracChangeset
for help on using the changeset viewer.