VirtualBox

Changeset 82065 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Nov 21, 2019 8:32:15 AM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
134871
Message:

DevVGA: Converting more I/O ports. bugref:9218

Location:
trunk/src/VBox/Devices/Graphics
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Graphics/DevVGA.cpp

    r82064 r82065  
    32593259# ifdef IN_RING3
    32603260/**
    3261  * @callback_method_impl{FNIOMIOPORTOUT,HGSMI OUT handler.}
    3262  */
    3263 static DECLCALLBACK(int) vgaR3IOPortHGSMIWrite(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t u32, unsigned cb)
     3261 * @callback_method_impl{FNIOMIOPORTNEWOUT,HGSMI OUT handler.}
     3262 */
     3263static DECLCALLBACK(VBOXSTRICTRC)
     3264vgaR3IOPortHgsmiWrite(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT offPort, uint32_t u32, unsigned cb)
    32643265{
    32653266    PVGASTATE pThis = PDMDEVINS_2_DATA(pDevIns, PVGASTATE);
    32663267    Assert(PDMDevHlpCritSectIsOwner(pDevIns, pDevIns->CTX_SUFF(pCritSectRo)));
    3267     LogFlowFunc(("Port 0x%x, u32 0x%x, cb %d\n", Port, u32, cb));
    3268 
     3268    LogFlowFunc(("offPort=0x%x u32=0x%x cb=%u\n", offPort, u32, cb));
    32693269
    32703270    NOREF(pvUser);
     
    32723272    if (cb == 4)
    32733273    {
    3274         switch (Port)
     3274        switch (offPort)
    32753275        {
    32763276            case VGA_PORT_HGSMI_HOST: /* Host */
     
    33143314            default:
    33153315# ifdef DEBUG_sunlover
    3316                 AssertMsgFailed(("vgaR3IOPortHGSMIWrite: Port=%#x cb=%d u32=%#x\n", Port, cb, u32));
     3316                AssertMsgFailed(("vgaR3IOPortHgsmiWrite: offPort=%#x cb=%d u32=%#x\n", offPort, cb, u32));
    33173317# endif
    33183318                break;
     
    33213321    else
    33223322    {
     3323        /** @todo r=bird: According to Ralf Brown, one and two byte accesses to the
     3324         *        0x3b0-0x3b1 and 0x3b2-0x3b3 I/O port pairs should work the same as
     3325         *        0x3b4-0x3b5 (MDA CRT control). */
     3326        Log(("vgaR3IOPortHgsmiWrite: offPort=%#x cb=%d u32=%#x - possible valid MDA CRT access\n", offPort, cb, u32));
    33233327# ifdef DEBUG_sunlover
    3324         AssertMsgFailed(("vgaR3IOPortHGSMIWrite: Port=%#x cb=%d u32=%#x\n", Port, cb, u32));
     3328        AssertMsgFailed(("vgaR3IOPortHgsmiWrite: offPort=%#x cb=%d u32=%#x\n", offPort, cb, u32));
    33253329# endif
     3330        STAM_REL_COUNTER_INC(&pThis->StatHgsmiMdaCgaAccesses);
    33263331    }
    33273332
     
    33313336
    33323337/**
    3333  * @callback_method_impl{FNIOMIOPORTOUT,HGSMI IN handler.}
    3334  */
    3335 static DECLCALLBACK(int) vgaR3IOPortHGSMIRead(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t *pu32, unsigned cb)
     3338 * @callback_method_impl{FNIOMIOPORTNEWOUT,HGSMI IN handler.}
     3339 */
     3340static DECLCALLBACK(VBOXSTRICTRC)
     3341vgaR3IOPortHgmsiRead(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT offPort, uint32_t *pu32, unsigned cb)
    33363342{
    33373343    PVGASTATE pThis = PDMDEVINS_2_DATA(pDevIns, PVGASTATE);
    33383344    Assert(PDMDevHlpCritSectIsOwner(pDevIns, pDevIns->CTX_SUFF(pCritSectRo)));
    3339     LogFlowFunc(("Port 0x%x, cb %d\n", Port, cb));
     3345    LogFlowFunc(("offPort=0x%x cb=%d\n", offPort, cb));
    33403346
    33413347    NOREF(pvUser);
    33423348
    3343     int rc = VINF_SUCCESS;
     3349    VBOXSTRICTRC rc = VINF_SUCCESS;
    33443350    if (cb == 4)
    33453351    {
    3346         switch (Port)
     3352        switch (offPort)
    33473353        {
    33483354            case VGA_PORT_HGSMI_HOST: /* Host */
     
    33543360            default:
    33553361# ifdef DEBUG_sunlover
    3356                 AssertMsgFailed(("vgaR3IOPortHGSMIRead: Port=%#x cb=%d\n", Port, cb));
     3362                AssertMsgFailed(("vgaR3IOPortHgmsiRead: Port=%#x cb=%d\n", Port, cb));
    33573363# endif
    33583364                rc = VERR_IOM_IOPORT_UNUSED;
     
    33623368    else
    33633369    {
    3364 # ifdef DEBUG_sunlover
    3365         Log(("vgaR3IOPortHGSMIRead: Port=%#x cb=%d\n", Port, cb));
    3366 # endif
     3370        /** @todo r=bird: According to Ralf Brown, one and two byte accesses to the
     3371         *        0x3b0-0x3b1 and 0x3b2-0x3b3 I/O port pairs should work the same as
     3372         *        0x3b4-0x3b5 (MDA CRT control). */
     3373        Log(("vgaR3IOPortHgmsiRead: offPort=%#x cb=%d - possible valid MDA CRT access\n", offPort, cb));
     3374        STAM_REL_COUNTER_INC(&pThis->StatHgsmiMdaCgaAccesses);
    33673375        rc = VERR_IOM_IOPORT_UNUSED;
    33683376    }
     
    67616769#ifdef VBOX_WITH_HGSMI
    67626770    /* Use reserved VGA IO ports for HGSMI. */
    6763     rc = PDMDevHlpIOPortRegister(pDevIns,  VGA_PORT_HGSMI_HOST,  4, NULL, vgaR3IOPortHGSMIWrite, vgaR3IOPortHGSMIRead, NULL, NULL, "VGA - 3b0 (HGSMI host)");
    6764     AssertRCReturn(rc, rc);
    6765     rc = PDMDevHlpIOPortRegister(pDevIns,  VGA_PORT_HGSMI_GUEST,  4, NULL, vgaR3IOPortHGSMIWrite, vgaR3IOPortHGSMIRead, NULL, NULL, "VGA - 3d0 (HGSMI guest)");
    6766     AssertRCReturn(rc, rc);
     6771    REG_PORT(VGA_PORT_HGSMI_HOST,  4, vgaR3IOPortHgsmiWrite, vgaR3IOPortHgmsiRead, "HGSMI host (3b0-3b3)",  &pThis->hIoPortHgsmiHost);
     6772    REG_PORT(VGA_PORT_HGSMI_GUEST, 4, vgaR3IOPortHgsmiWrite, vgaR3IOPortHgmsiRead, "HGSMI guest (3d0-3d3)", &pThis->hIoPortHgsmiGuest);
    67676773#endif /* VBOX_WITH_HGSMI */
    67686774
     
    73627368    PDMDevHlpSTAMRegister(pDevIns, &pThis->StatMapPage,       STAMTYPE_COUNTER, "MapPageCalls",  STAMUNIT_OCCURENCES,     "Calls to IOMMMIOMapMMIO2Page.");
    73637369    PDMDevHlpSTAMRegister(pDevIns, &pThis->StatUpdateDisp,    STAMTYPE_COUNTER, "UpdateDisplay", STAMUNIT_OCCURENCES,     "Calls to vgaPortUpdateDisplay().");
     7370#endif
     7371#ifdef VBOX_WITH_HGSMI
     7372    PDMDevHlpSTAMRegister(pDevIns, &pThis->StatHgsmiMdaCgaAccesses, STAMTYPE_COUNTER, "HgmsiMdaCgaAccesses", STAMUNIT_OCCURENCES, "Number of non-HGMSI accesses for 03b0-3b3 and 03d0-3d3.");
    73647373#endif
    73657374
  • trunk/src/VBox/Devices/Graphics/DevVGA.h

    r82064 r82065  
    378378    STAMCOUNTER                 StatMapPage;            /**< Counts IOMMMIOMapMMIO2Page calls.  */
    379379    STAMCOUNTER                 StatUpdateDisp;         /**< Counts vgaPortUpdateDisplay calls.  */
     380# ifdef VBOX_WITH_HGSMI
     381    STAMCOUNTER                 StatHgsmiMdaCgaAccesses;
     382# endif
    380383
    381384    /* Keep track of ring 0 latched accesses to the VGA MMIO memory. */
     
    516519    /** @} */
    517520
     521# ifdef VBOX_WITH_HGSMI
     522    /** @name I/O ports for HGSMI 0x3b0-03b3 and 0x3d0-03d3 (ring-3 only)
     523     * @{ */
     524    IOMIOPORTHANDLE             hIoPortHgsmiHost;
     525    IOMIOPORTHANDLE             hIoPortHgsmiGuest;
     526    /** @} */
     527# endif
     528
    518529    /** @name I/O ports for Boch VBE 0x1ce-0x1cf
    519530     *  @{ */
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette