Changeset 81929 in vbox for trunk/src/VBox/Devices/PC
- Timestamp:
- Nov 18, 2019 12:44:16 AM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 134726
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/PC/DevPcArch.cpp
r81591 r81929 48 48 49 49 /** 50 * @callback_method_impl{FNIOMIOPORTIN, Math coprocessor.} 51 */ 52 static DECLCALLBACK(int) pcarchIOPortFPURead(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t *pu32, unsigned cb) 50 * @callback_method_impl{FNIOMIOPORTNEWIN, Math coprocessor.} 51 * @note offPort is absolute 52 */ 53 static DECLCALLBACK(VBOXSTRICTRC) 54 pcarchIOPortFPURead(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT offPort, uint32_t *pu32, unsigned cb) 53 55 { 54 56 int rc; 55 57 NOREF(pvUser); NOREF(pDevIns); NOREF(pu32); 56 rc = PDMDevHlpDBGFStop(pDevIns, RT_SRC_POS, "Port=%#x cb=%d\n", Port, cb);58 rc = PDMDevHlpDBGFStop(pDevIns, RT_SRC_POS, "Port=%#x cb=%d\n", offPort, cb); 57 59 if (rc == VINF_SUCCESS) 58 60 rc = VERR_IOM_IOPORT_UNUSED; … … 61 63 62 64 /** 63 * @callback_method_impl{FNIOMIOPORTOUT, Math coprocessor.} 65 * @callback_method_impl{FNIOMIOPORTNEWOUT, Math coprocessor.} 66 * @note offPort is absolute 64 67 * @todo Add IGNNE support. 65 68 */ 66 static DECLCALLBACK(int) pcarchIOPortFPUWrite(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t u32, unsigned cb) 69 static DECLCALLBACK(VBOXSTRICTRC) 70 pcarchIOPortFPUWrite(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT offPort, uint32_t u32, unsigned cb) 67 71 { 68 72 int rc = VINF_SUCCESS; … … 70 74 if (cb == 1) 71 75 { 72 switch ( Port)76 switch (offPort) 73 77 { 74 78 /* … … 80 84 #if 0 81 85 if (!u32) 82 rc = PDMDeviceDBGFStop(pDevIns, RT_SRC_POS, "Port=%#x cb=%d u32=%#x\n", Port, cb, u32);86 rc = PDMDeviceDBGFStop(pDevIns, RT_SRC_POS, "Port=%#x cb=%d u32=%#x\n", offPort, cb, u32); 83 87 #endif 84 88 /* pDevIns->pHlp->pfnPICSetIrq(pDevIns, 13, 0); */ … … 97 101 case 0xfc: 98 102 default: 99 rc = PDMDevHlpDBGFStop(pDevIns, RT_SRC_POS, "Port=%#x cb=%d u32=%#x\n", Port, cb, u32);103 rc = PDMDevHlpDBGFStop(pDevIns, RT_SRC_POS, "Port=%#x cb=%d u32=%#x\n", offPort, cb, u32); 100 104 break; 101 105 } … … 104 108 } 105 109 else 106 rc = PDMDevHlpDBGFStop(pDevIns, RT_SRC_POS, "Port=%#x cb=%d u32=%#x\n", Port, cb, u32);110 rc = PDMDevHlpDBGFStop(pDevIns, RT_SRC_POS, "Port=%#x cb=%d u32=%#x\n", offPort, cb, u32); 107 111 return rc; 108 112 } … … 143 147 SeeAlso: #P0416,#P0417,MSR 00001000h 144 148 * @endverbatim 145 */ 146 static DECLCALLBACK(int) 147 pcarchIOPortPS2SysControlPortARead(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t *pu32, unsigned cb) 149 * @note offPort is absolute 150 */ 151 static DECLCALLBACK(VBOXSTRICTRC) 152 pcarchIOPortPS2SysControlPortARead(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT offPort, uint32_t *pu32, unsigned cb) 148 153 { 149 154 RT_NOREF1(pvUser); … … 153 158 return VINF_SUCCESS; 154 159 } 155 return PDMDevHlpDBGFStop(pDevIns, RT_SRC_POS, "Port=%#x cb=%d\n", Port, cb);160 return PDMDevHlpDBGFStop(pDevIns, RT_SRC_POS, "Port=%#x cb=%d\n", offPort, cb); 156 161 } 157 162 … … 160 165 * @callback_method_impl{FNIOMIOPORTOUT, PS/2 system control port A.} 161 166 * @see Remark and todo of pcarchIOPortPS2SysControlPortARead(). 162 */ 163 static DECLCALLBACK(int) 164 pcarchIOPortPS2SysControlPortAWrite(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t u32, unsigned cb) 167 * @note offPort is absolute 168 */ 169 static DECLCALLBACK(VBOXSTRICTRC) 170 pcarchIOPortPS2SysControlPortAWrite(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT offPort, uint32_t u32, unsigned cb) 165 171 { 166 172 NOREF(pvUser); … … 182 188 return VINF_SUCCESS; 183 189 } 184 return PDMDevHlpDBGFStop(pDevIns, RT_SRC_POS, "Port=%#x cb=%d u32=%#x\n", Port, cb, u32); 185 } 186 187 188 /** 189 * @callback_method_impl{FNIOMMMIOWRITE, Ignores writes to the reserved memory.} 190 */ 191 static DECLCALLBACK(int) pcarchReservedMemoryWrite(PPDMDEVINS pDevIns, void *pvUser, RTGCPHYS GCPhysAddr, 192 void const *pv, unsigned cb) 193 { 194 Log2(("pcarchReservedMemoryRead: %#RGp LB %#x %.*Rhxs\n", GCPhysAddr, cb, RT_MIN(cb, 16), pv)); 195 NOREF(pDevIns); NOREF(pvUser); NOREF(GCPhysAddr); NOREF(pv); NOREF(cb); 190 return PDMDevHlpDBGFStop(pDevIns, RT_SRC_POS, "Port=%#x cb=%d u32=%#x\n", offPort, cb, u32); 191 } 192 193 194 /** 195 * @callback_method_impl{FNIOMMMIONEWWRITE, Ignores writes to the reserved memory.} 196 * @note off is an absolute address. 197 */ 198 static DECLCALLBACK(VBOXSTRICTRC) 199 pcarchReservedMemoryWrite(PPDMDEVINS pDevIns, void *pvUser, RTGCPHYS off, void const *pv, unsigned cb) 200 { 201 Log2(("pcarchReservedMemoryRead: %#RGp LB %#x %.*Rhxs\n", off, cb, RT_MIN(cb, 16), pv)); 202 RT_NOREF(pDevIns, pvUser, off, pv, cb); 196 203 return VINF_SUCCESS; 197 204 } … … 199 206 200 207 /** 201 * @callback_method_impl{FNIOMMMIOREAD, The reserved memory reads as 0xff.} 202 */ 203 static DECLCALLBACK(int) pcarchReservedMemoryRead(PPDMDEVINS pDevIns, void *pvUser, RTGCPHYS GCPhysAddr, void *pv, unsigned cb) 204 { 205 Log2(("pcarchReservedMemoryRead: %#RGp LB %#x\n", GCPhysAddr, cb)); 206 NOREF(pDevIns); NOREF(pvUser); NOREF(GCPhysAddr); 208 * @callback_method_impl{FNIOMMMIONEWREAD, The reserved memory reads as 0xff.} 209 * @note off is an absolute address. 210 */ 211 static DECLCALLBACK(VBOXSTRICTRC) 212 pcarchReservedMemoryRead(PPDMDEVINS pDevIns, void *pvUser, RTGCPHYS off, void *pv, unsigned cb) 213 { 214 Log2(("pcarchReservedMemoryRead: %#RGp LB %#x\n", off, cb)); 215 RT_NOREF(pDevIns, pvUser, off); 207 216 memset(pv, 0xff, cb); 208 217 return VINF_SUCCESS; … … 231 240 while (GCPhysCur < GCPhysEnd && PGMPhysIsGCPhysNormal(pVM, GCPhysCur)); 232 241 233 int rc = PDMDevHlpMMIORegister(pDevIns, GCPhysStart, GCPhysCur - GCPhysStart, NULL /*pvUser*/, 234 IOMMMIO_FLAGS_READ_PASSTHRU | IOMMMIO_FLAGS_WRITE_PASSTHRU, 235 pcarchReservedMemoryWrite, pcarchReservedMemoryRead, 236 MMR3HeapAPrintf(pVM, MM_TAG_PGM_PHYS /* bad bird*/, "PC Arch Reserved #%u", iRegion)); 242 IOMMMIOHANDLE hMmioRegion; 243 int rc = PDMDevHlpMmioCreateAndMap(pDevIns, GCPhysStart, GCPhysCur - GCPhysStart, 244 pcarchReservedMemoryWrite, pcarchReservedMemoryRead, 245 IOMMMIO_FLAGS_READ_PASSTHRU | IOMMMIO_FLAGS_WRITE_PASSTHRU | IOMMMIO_FLAGS_ABS, 246 MMR3HeapAPrintf(pVM, MM_TAG_PGM_PHYS /* bad bird*/, "PC Arch Reserved #%u", iRegion), 247 &hMmioRegion); 237 248 AssertLogRelRCReturn(rc, rc); 238 249 iRegion++; … … 268 279 * Register I/O Ports 269 280 */ 270 rc = PDMDevHlpIOPortRegister(pDevIns, 0xF0, 0x10, NULL, 271 pcarchIOPortFPUWrite, pcarchIOPortFPURead, 272 NULL, NULL, "Math Co-Processor (DOS/OS2 mode)"); 273 if (RT_FAILURE(rc)) 274 return rc; 275 rc = PDMDevHlpIOPortRegister(pDevIns, 0x92, 1, NULL, 276 pcarchIOPortPS2SysControlPortAWrite, pcarchIOPortPS2SysControlPortARead, 277 NULL, NULL, "PS/2 system control port A (A20 and more)"); 278 if (RT_FAILURE(rc)) 279 return rc; 281 IOMIOPORTHANDLE hIoPorts; 282 rc = PDMDevHlpIoPortCreateFlagsAndMap(pDevIns, 0xf0 /*uPort*/, 0x10 /*cPorts*/, IOM_IOPORT_F_ABS, 283 pcarchIOPortFPUWrite, pcarchIOPortFPURead, 284 "Math Co-Processor (DOS/OS2 mode)", NULL /*paExtDescs*/, &hIoPorts); 285 AssertRCReturn(rc, rc); 286 rc = PDMDevHlpIoPortCreateFlagsAndMap(pDevIns, 0x92 /*uPort*/, 1 /*cPorts*/, IOM_IOPORT_F_ABS, 287 pcarchIOPortPS2SysControlPortAWrite, pcarchIOPortPS2SysControlPortARead, 288 "PS/2 system control port A (A20 and more)", NULL /*paExtDescs*/, &hIoPorts); 289 AssertRCReturn(rc, rc); 280 290 281 291 return VINF_SUCCESS; … … 291 301 /* .uReserved0 = */ 0, 292 302 /* .szName = */ "pcarch", 293 /* .fFlags = */ PDM_DEVREG_FLAGS_DEFAULT_BITS ,303 /* .fFlags = */ PDM_DEVREG_FLAGS_DEFAULT_BITS | PDM_DEVREG_FLAGS_NEW_STYLE, 294 304 /* .fClass = */ PDM_DEVREG_CLASS_ARCH, 295 305 /* .cMaxInstances = */ 1,
Note:
See TracChangeset
for help on using the changeset viewer.