Changeset 32213 in vbox for trunk/src/VBox
- Timestamp:
- Sep 2, 2010 3:17:57 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/PGMPhys.cpp
r32121 r32213 94 94 95 95 /** 96 * Write tophysical memory, external users.96 * Read from physical memory, external users. 97 97 * 98 98 * @returns VBox status code. … … 100 100 * 101 101 * @param pVM VM Handle. 102 * @param GCPhys Physical address to write to.103 * @param pvBuf Wh at to write.104 * @param cb Write How many bytes to write.102 * @param GCPhys Physical address to read from. 103 * @param pvBuf Where to read into. 104 * @param cbRead How many bytes to read. 105 105 * 106 106 * @thread Any but EMTs. … … 1128 1128 return rc; 1129 1129 } 1130 1131 1132 /** 1133 * Gets the number of ram ranges. 1134 * 1135 * @returns Number of ram ranges. Returns UINT32_MAX if @a pVM is invalid. 1136 * @param pVM The VM handle. 1137 */ 1138 VMMR3DECL(uint32_t) PGMR3PhysGetRamRangeCount(PVM pVM) 1139 { 1140 VM_ASSERT_VALID_EXT_RETURN(pVM, UINT32_MAX); 1141 1142 pgmLock(pVM); 1143 uint32_t cRamRanges = 0; 1144 for (PPGMRAMRANGE pCur = pVM->pgm.s.CTX_SUFF(pRamRanges); pCur; pCur = pCur->CTX_SUFF(pNext)) 1145 cRamRanges++; 1146 pgmUnlock(pVM); 1147 return cRamRanges; 1148 } 1149 1150 1151 /** 1152 * Get information about a range. 1153 * 1154 * @returns VINF_SUCCESS or VERR_OUT_OF_RANGE. 1155 * @param pVM The VM handle 1156 * @param iRange The ordinal of the range. 1157 * @param pGCPhysStart Where to return the start of the range. Optional. 1158 * @param pGCPhysLast Where to return the address of the last byte in the 1159 * range. Optional. 1160 * @param pfIsMmio Where to indicate that this is a pure MMIO range. 1161 * Optional. 1162 */ 1163 VMMR3DECL(int) PGMR3PhysGetRange(PVM pVM, uint32_t iRange, PRTGCPHYS pGCPhysStart, PRTGCPHYS pGCPhysLast, 1164 const char **ppszDesc, bool *pfIsMmio) 1165 { 1166 VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE); 1167 1168 pgmLock(pVM); 1169 uint32_t iCurRange = 0; 1170 for (PPGMRAMRANGE pCur = pVM->pgm.s.CTX_SUFF(pRamRanges); pCur; pCur = pCur->CTX_SUFF(pNext), iCurRange++) 1171 if (iCurRange == iRange) 1172 { 1173 if (pGCPhysStart) 1174 *pGCPhysStart = pCur->GCPhys; 1175 if (pGCPhysLast) 1176 *pGCPhysLast = pCur->GCPhysLast; 1177 if (pfIsMmio) 1178 *pfIsMmio = !!(pCur->fFlags & PGM_RAM_RANGE_FLAGS_AD_HOC_MMIO); 1179 1180 pgmUnlock(pVM); 1181 return VINF_SUCCESS; 1182 } 1183 pgmUnlock(pVM); 1184 return VERR_OUT_OF_RANGE; 1185 } 1186 1130 1187 1131 1188 /**
Note:
See TracChangeset
for help on using the changeset viewer.