Changeset 107874 in vbox for trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseMemoryLib/CopyMem.c
- Timestamp:
- Jan 21, 2025 2:53:44 PM (2 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note:
See TracChangeset
for help on using the changeset viewer.