Changeset 90904 in vbox
- Timestamp:
- Aug 26, 2021 9:49:06 AM (3 years ago)
- Location:
- trunk/src/VBox/Devices/Security
- Files:
-
- 2 edited
-
DevTpm.cpp (modified) (2 diffs)
-
DrvTpmEmu.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Security/DevTpm.cpp
r90903 r90904 1129 1129 RT_NOREF(pvUser); 1130 1130 1131 Assert(!(off & (cb - 1))); 1131 RTGCPHYS offAligned = off & ~UINT64_C(0x3); 1132 uint8_t cBitsShift = (off & 0x3) * 8; 1132 1133 1133 1134 VBOXSTRICTRC rc = VINF_SUCCESS; 1134 uint32_t uReg = tpmGetRegisterFromOffset(off );1135 uint8_t bLoc = tpmGetLocalityFromOffset(off );1135 uint32_t uReg = tpmGetRegisterFromOffset(offAligned); 1136 uint8_t bLoc = tpmGetLocalityFromOffset(offAligned); 1136 1137 PDEVTPMLOCALITY pLoc = &pThis->aLoc[bLoc]; 1137 1138 … … 1148 1149 switch (cb) 1149 1150 { 1150 case 1: *(uint8_t *)pv = (uint8_t) u64; break;1151 case 2: *(uint16_t *)pv = (uint16_t) u64; break;1152 case 4: *(uint32_t *)pv = (uint32_t) u64; break;1151 case 1: *(uint8_t *)pv = (uint8_t)(u64 >> cBitsShift); break; 1152 case 2: *(uint16_t *)pv = (uint16_t)(u64 >> cBitsShift); break; 1153 case 4: *(uint32_t *)pv = (uint32_t)(u64 >> cBitsShift); break; 1153 1154 case 8: *(uint64_t *)pv = u64; break; 1154 1155 default: AssertFailedBreakStmt(rc = VERR_INTERNAL_ERROR); -
trunk/src/VBox/Devices/Security/DrvTpmEmu.cpp
r90587 r90904 617 617 618 618 619 /** @interface_method_impl{PDMITPMCONNECTOR,pfn GetEstablishedFlag} */619 /** @interface_method_impl{PDMITPMCONNECTOR,pfnResetEstablishedFlag} */ 620 620 static DECLCALLBACK(int) drvTpmEmuResetEstablishedFlag(PPDMITPMCONNECTOR pInterface, uint8_t bLoc) 621 621 {
Note:
See TracChangeset
for help on using the changeset viewer.

