Changeset 99492 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Apr 20, 2023 7:21:44 PM (20 months ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/GICAll.cpp
r99385 r99492 148 148 * @callback_method_impl{FNIOMMMIONEWREAD} 149 149 */ 150 DECL CALLBACK(VBOXSTRICTRC) apicReadMmio(PPDMDEVINS pDevIns, void *pvUser, RTGCPHYS off, void *pv, unsigned cb)150 DECL_HIDDEN_CALLBACK(VBOXSTRICTRC) gicDistMmioRead(PPDMDEVINS pDevIns, void *pvUser, RTGCPHYS off, void *pv, unsigned cb) 151 151 { 152 152 NOREF(pvUser); 153 Assert(!(off & 0xf));154 Assert(cb == 4); RT_NOREF_PV(cb);153 //Assert(!(off & 0xf)); 154 //Assert(cb == 4); RT_NOREF_PV(cb); 155 155 156 156 PVMCPUCC pVCpu = PDMDevHlpGetVMCPU(pDevIns); … … 171 171 * @callback_method_impl{FNIOMMMIONEWWRITE} 172 172 */ 173 DECL CALLBACK(VBOXSTRICTRC) gicWriteMmio(PPDMDEVINS pDevIns, void *pvUser, RTGCPHYS off, void const *pv, unsigned cb)173 DECL_HIDDEN_CALLBACK(VBOXSTRICTRC) gicDistMmioWrite(PPDMDEVINS pDevIns, void *pvUser, RTGCPHYS off, void const *pv, unsigned cb) 174 174 { 175 175 NOREF(pvUser); 176 Assert(!(off & 0xf)); 177 Assert(cb == 4); RT_NOREF_PV(cb); 176 //Assert(!(off & 0xf)); 177 //Assert(cb == 4); RT_NOREF_PV(cb); 178 179 PVMCPUCC pVCpu = PDMDevHlpGetVMCPU(pDevIns); 180 uint16_t offReg = off & 0xff0; 181 uint32_t uValue = *(uint32_t *)pv; 182 183 STAM_COUNTER_INC(&pVCpu->gic.s.CTX_SUFF_Z(StatMmioWrite)); 184 185 Log2(("GIC%u: gicWriteMmio: offReg=%#RX16 uValue=%#RX32\n", pVCpu->idCpu, offReg, uValue)); 186 return gicWriteRegister(pDevIns, pVCpu, offReg, uValue); 187 } 188 189 190 /** 191 * @callback_method_impl{FNIOMMMIONEWREAD} 192 */ 193 DECL_HIDDEN_CALLBACK(VBOXSTRICTRC) gicReDistMmioRead(PPDMDEVINS pDevIns, void *pvUser, RTGCPHYS off, void *pv, unsigned cb) 194 { 195 NOREF(pvUser); 196 //Assert(!(off & 0xf)); 197 //Assert(cb == 4); RT_NOREF_PV(cb); 198 199 PVMCPUCC pVCpu = PDMDevHlpGetVMCPU(pDevIns); 200 uint16_t offReg = off & 0xff0; 201 uint32_t uValue = 0; 202 203 STAM_COUNTER_INC(&pVCpu->gic.s.CTX_SUFF_Z(StatMmioRead)); 204 205 VBOXSTRICTRC rc = VBOXSTRICTRC_VAL(gicReadRegister(pDevIns, pVCpu, offReg, &uValue)); 206 *(uint32_t *)pv = uValue; 207 208 Log2(("GIC%u: gicReadMmio: offReg=%#RX16 uValue=%#RX32\n", pVCpu->idCpu, offReg, uValue)); 209 return rc; 210 } 211 212 213 /** 214 * @callback_method_impl{FNIOMMMIONEWWRITE} 215 */ 216 DECL_HIDDEN_CALLBACK(VBOXSTRICTRC) gicReDistMmioWrite(PPDMDEVINS pDevIns, void *pvUser, RTGCPHYS off, void const *pv, unsigned cb) 217 { 218 NOREF(pvUser); 219 //Assert(!(off & 0xf)); 220 //Assert(cb == 4); RT_NOREF_PV(cb); 178 221 179 222 PVMCPUCC pVCpu = PDMDevHlpGetVMCPU(pDevIns); -
trunk/src/VBox/VMM/VMMR3/GICR3.cpp
r99387 r99492 176 176 * Register the MMIO ranges. 177 177 */ 178 #if 0 179 rc = PDMDevHlpMmioCreateAndMap(pDevIns, GCPhysApicBase, sizeof(XAPICPAGE), apicWriteMmio, apicReadMmio, 180 IOMMMIO_FLAGS_READ_DWORD | IOMMMIO_FLAGS_WRITE_DWORD_ZEROED, "APIC", &pApicDev->hMmio); 181 AssertRCReturn(rc, rc); 182 #endif 178 RTGCPHYS GCPhysMmioBase = 0; 179 rc = pHlp->pfnCFGMQueryU64(pCfg, "DistributorMmioBase", &GCPhysMmioBase); 180 if (RT_FAILURE(rc)) 181 return PDMDEV_SET_ERROR(pDevIns, rc, 182 N_("Configuration error: Failed to get the \"DistributorMmioBase\" value")); 183 184 rc = PDMDevHlpMmioCreateAndMap(pDevIns, GCPhysMmioBase, GIC_DIST_REG_FRAME_SIZE, gicDistMmioWrite, gicDistMmioRead, 185 IOMMMIO_FLAGS_READ_DWORD | IOMMMIO_FLAGS_WRITE_DWORD_ZEROED, "GICv3_Dist", &pGicDev->hMmioDist); 186 AssertRCReturn(rc, rc); 187 188 rc = pHlp->pfnCFGMQueryU64(pCfg, "RedistributorMmioBase", &GCPhysMmioBase); 189 if (RT_FAILURE(rc)) 190 return PDMDEV_SET_ERROR(pDevIns, rc, 191 N_("Configuration error: Failed to get the \"RedistributorMmioBase\" value")); 192 193 RTGCPHYS cbRegion = pVM->cCpus * (GIC_REDIST_REG_FRAME_SIZE + GIC_REDIST_SGI_PPI_REG_FRAME_SIZE); /* Adjacent and per vCPU. */ 194 rc = PDMDevHlpMmioCreateAndMap(pDevIns, GCPhysMmioBase, cbRegion, gicReDistMmioWrite, gicReDistMmioRead, 195 IOMMMIO_FLAGS_READ_DWORD | IOMMMIO_FLAGS_WRITE_DWORD_ZEROED, "GICv3_ReDist", &pGicDev->hMmioReDist); 196 AssertRCReturn(rc, rc); 183 197 184 198 /*
Note:
See TracChangeset
for help on using the changeset viewer.