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

Function VmReadMem32

MdeModulePkg/Universal/EbcDxe/EbcExecute.c:5231–5255  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

5229
5230**/
5231UINT32
5232VmReadMem32 (
5233 IN VM_CONTEXT *VmPtr,
5234 IN UINTN Addr
5235 )
5236{
5237 UINT32 Data;
5238
5239 //
5240 // Convert the address if it's in the stack gap
5241 //
5242 Addr = ConvertStackAddr (VmPtr, Addr);
5243 //
5244 // Read direct if aligned
5245 //
5246 if (IS_ALIGNED (Addr, sizeof (UINT32))) {
5247 return * (UINT32 *) Addr;
5248 }
5249 //
5250 // Return unaligned data
5251 //
5252 Data = (UINT32) VmReadMem16 (VmPtr, Addr);
5253 Data |= (VmReadMem16 (VmPtr, Addr + 2) << 16);
5254 return Data;
5255}
5256
5257/**
5258 Reads 64-bit data form the memory address.

Callers 8

ExecuteMOVxxFunction · 0.85
ExecuteBREAKFunction · 0.85
ExecutePUSHFunction · 0.85
ExecutePOPFunction · 0.85
ExecuteCMPFunction · 0.85
ExecuteCMPIFunction · 0.85
ExecuteDataManipFunction · 0.85
VmReadMem64Function · 0.85

Calls 2

ConvertStackAddrFunction · 0.85
VmReadMem16Function · 0.85

Tested by

no test coverage detected