Changeset 81995 in vbox
- Timestamp:
- Nov 19, 2019 1:46:52 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DevFdc.cpp
r81799 r81995 692 692 PPDMILEDCONNECTORS pLedsConnector; 693 693 694 /** I/O ports: 0x3f0 */ 695 IOMIOPORTHANDLE hIoPorts0; 694 696 /** I/O ports: 0x3f1..0x3f5 */ 695 697 IOMIOPORTHANDLE hIoPorts1; … … 2185 2187 2186 2188 /** 2187 * @callback_method_impl{FNIOMIOPORTNEWOUT, Handling 0x3f1..0x3f5 acceses.} 2189 * @callback_method_impl{FNIOMIOPORTNEWOUT, Handling 0x3f0 accesses.} 2190 */ 2191 static DECLCALLBACK(VBOXSTRICTRC) fdcIoPort0Write(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT offPort, uint32_t u32, unsigned cb) 2192 { 2193 RT_NOREF(pvUser); 2194 2195 if (cb == 1) 2196 fdctrl_write(PDMDEVINS_2_DATA(pDevIns, fdctrl_t *), offPort, u32); 2197 else 2198 ASSERT_GUEST_MSG_FAILED(("offPort=%#x cb=%d u32=%#x\n", offPort, cb, u32)); 2199 return VINF_SUCCESS; 2200 } 2201 2202 2203 /** 2204 * @callback_method_impl{FNIOMIOPORTNEWIN, Handling 0x3f0 accesses.} 2205 */ 2206 static DECLCALLBACK(VBOXSTRICTRC) fdcIoPort0Read(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT offPort, uint32_t *pu32, unsigned cb) 2207 { 2208 RT_NOREF(pvUser); 2209 2210 if (cb == 1) 2211 { 2212 *pu32 = fdctrl_read(PDMDEVINS_2_DATA(pDevIns, fdctrl_t *), offPort); 2213 return VINF_SUCCESS; 2214 } 2215 return VERR_IOM_IOPORT_UNUSED; 2216 } 2217 2218 2219 /** 2220 * @callback_method_impl{FNIOMIOPORTNEWOUT, Handling 0x3f1..0x3f5 accesses.} 2188 2221 */ 2189 2222 static DECLCALLBACK(VBOXSTRICTRC) fdcIoPort1Write(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT offPort, uint32_t u32, unsigned cb) … … 2200 2233 2201 2234 /** 2202 * @callback_method_impl{FNIOMIOPORTNEWIN, Handling 0x3f1..0x3f5 acces es.}2235 * @callback_method_impl{FNIOMIOPORTNEWIN, Handling 0x3f1..0x3f5 accesses.} 2203 2236 */ 2204 2237 static DECLCALLBACK(VBOXSTRICTRC) fdcIoPort1Read(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT offPort, uint32_t *pu32, unsigned cb) … … 2725 2758 * Validate configuration. 2726 2759 */ 2727 PDMDEV_VALIDATE_CONFIG_RETURN(pDevIns, "IRQ|DMA|MemMapped|IOBase ", "");2760 PDMDEV_VALIDATE_CONFIG_RETURN(pDevIns, "IRQ|DMA|MemMapped|IOBase|StatusA", ""); 2728 2761 2729 2762 /* … … 2742 2775 rc = pHlp->pfnCFGMQueryBoolDef(pCfg, "MemMapped", &fMemMapped, false); 2743 2776 AssertMsgRCReturn(rc, ("Configuration error: Failed to read bool value MemMapped rc=%Rrc\n", rc), rc); 2777 2778 bool fStatusA; 2779 rc = pHlp->pfnCFGMQueryBoolDef(pCfg, "StatusA", &fStatusA, false); 2780 AssertMsgRCReturn(rc, ("Configuration error: Failed to read bool value fStatusA rc=%Rrc\n", rc), rc); 2744 2781 2745 2782 /* … … 2751 2788 pThis->config = FD_CONFIG_EIS | FD_CONFIG_EFIFO; /* Implicit seek, polling & FIFO enabled */ 2752 2789 pThis->num_floppies = MAX_FD; 2790 pThis->hIoPorts0 = NIL_IOMMMIOHANDLE; 2791 pThis->hIoPorts1 = NIL_IOMMMIOHANDLE; 2792 pThis->hIoPorts2 = NIL_IOMMMIOHANDLE; 2753 2793 2754 2794 /* Fill 'command_to_handler' lookup table */ … … 2812 2852 { NULL, NULL, NULL, NULL } 2813 2853 }; 2854 2855 /* 0x3f0 */ 2856 if (fStatusA) 2857 { 2858 rc = PDMDevHlpIoPortCreateAndMap(pDevIns, pThis->io_base, 1 /*cPorts*/, fdcIoPort0Write, fdcIoPort0Read, 2859 "FDC-SRA", s_aDescs, &pThis->hIoPorts0); 2860 AssertRCReturn(rc, rc); 2861 } 2814 2862 2815 2863 /* 0x3f1..0x3f5 */
Note:
See TracChangeset
for help on using the changeset viewer.