MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / VmReadMem64

Function VmReadMem64

MdeModulePkg/Universal/EbcDxe/EbcExecute.c:5266–5293  ·  view source on GitHub ↗

Reads 64-bit data form the memory address. @param VmPtr A pointer to VM context. @param Addr The memory address. @return The 64-bit value from the memory address. **/

Source from the content-addressed store, hash-verified

5264
5265**/
5266UINT64
5267VmReadMem64 (
5268 IN VM_CONTEXT *VmPtr,
5269 IN UINTN Addr
5270 )
5271{
5272 UINT64 Data;
5273 UINT32 Data32;
5274
5275 //
5276 // Convert the address if it's in the stack gap
5277 //
5278 Addr = ConvertStackAddr (VmPtr, Addr);
5279
5280 //
5281 // Read direct if aligned
5282 //
5283 if (IS_ALIGNED (Addr, sizeof (UINT64))) {
5284 return * (UINT64 *) Addr;
5285 }
5286 //
5287 // Return unaligned data. Assume little endian.
5288 //
5289 Data32 = VmReadMem32 (VmPtr, Addr);
5290 Data = (UINT64) VmReadMem32 (VmPtr, Addr + sizeof (UINT32));
5291 Data = LShiftU64 (Data, 32) | Data32;
5292 return Data;
5293}
5294
5295
5296/**

Callers 7

ExecuteMOVxxFunction · 0.85
ExecutePUSHFunction · 0.85
ExecutePOPFunction · 0.85
ExecuteRETFunction · 0.85
ExecuteCMPFunction · 0.85
ExecuteCMPIFunction · 0.85
ExecuteDataManipFunction · 0.85

Calls 3

ConvertStackAddrFunction · 0.85
VmReadMem32Function · 0.85
LShiftU64Function · 0.85

Tested by

no test coverage detected