libpeci: Add 64-bit MMIO Read variable
MMIO Reads can support 8 byte reads but the variable used is only 4
bytes. Use new 8 byte variable.
Tested: Can now read 8 byte variables
Before:
>> peci_cmds RdEndpointConfigMMIO <register info> -s 8
cc:0x40 0x0000000001100100
After:
>> peci_cmds RdEndpointConfigMMIO <register info> -s 8
cc:0x40 0x00ff000001100100
Change-Id: Iac4f8b462e2a391188b4bcb749a49e3792fb9af3
Signed-off-by: Matt Simmering <matthew.simmering@intel.com>
diff --git a/peci_cmds.c b/peci_cmds.c
index 1714e6c..e1576eb 100644
--- a/peci_cmds.c
+++ b/peci_cmds.c
@@ -124,6 +124,7 @@
uint8_t domainId = 0; // use default domain ID of 0
uint8_t u8Size = 4; // default to a DWORD
uint32_t u32PciReadVal = 0;
+ uint64_t u64MmioReadVal = 0;
uint8_t u8Seg = 0;
uint8_t u8Bar = 0;
uint8_t u8AddrType = 0;
@@ -973,7 +974,7 @@
clock_gettime(CLOCK_REALTIME, &begin);
ret = peci_RdEndPointConfigMmio_dom(
address, domainId, u8Seg, u8PciBus, u8PciDev, u8PciFunc, u8Bar,
- u8AddrType, u64Offset, u8Size, (uint8_t*)&u32PciReadVal, &cc);
+ u8AddrType, u64Offset, u8Size, (uint8_t*)&u64MmioReadVal, &cc);
timeSpent = getTimeDifference(begin);
if (verbose && measureTime)
{
@@ -993,8 +994,8 @@
}
else
{
- printf(" cc:0x%02x 0x%0*x\n", cc, u8Size * 2,
- u32PciReadVal);
+ printf(" cc:0x%02x 0x%0*" PRIx64 "\n", cc, u8Size * 2,
+ u64MmioReadVal);
}
}
}