VirtualBox

Changeset 82069 in vbox for trunk


Ignore:
Timestamp:
Nov 21, 2019 9:14:50 AM (5 years ago)
Author:
vboxsync
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

    r82066 r82069  
    38333833
    38343834/**
    3835  * @callback_method_impl{FNIOMIOPORTIN,
     3835 * @callback_method_impl{FNIOMIOPORTNEWIN,
    38363836 *      Port I/O Handler for VGA BIOS IN operations.}
    38373837 */
    3838 PDMBOTHCBDECL(int) vgaIOPortReadBIOS(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t *pu32, unsigned cb)
    3839 {
    3840     NOREF(pDevIns);
    3841     NOREF(pvUser);
    3842     NOREF(Port);
    3843     NOREF(pu32);
    3844     NOREF(cb);
     3838static DECLCALLBACK(VBOXSTRICTRC) vgaIoPortReadBios(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT offPort, uint32_t *pu32, unsigned cb)
     3839{
     3840    RT_NOREF(pDevIns, pvUser, offPort, pu32, cb);
    38453841    return VERR_IOM_IOPORT_UNUSED;
    38463842}
    38473843
    38483844/**
    3849  * @callback_method_impl{FNIOMIOPORTOUT,
     3845 * @callback_method_impl{FNIOMIOPORTNEWOUT,
    38503846 *      Port I/O Handler for VGA BIOS IN operations.}
    38513847 */
    3852 PDMBOTHCBDECL(int) vgaIOPortWriteBIOS(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t u32, unsigned cb)
    3853 {
    3854     static int lastWasNotNewline = 0;  /* We are only called in a single-threaded way */
     3848static DECLCALLBACK(VBOXSTRICTRC) vgaIoPortWriteBios(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT offPort, uint32_t u32, unsigned cb)
     3849{
    38553850    RT_NOREF2(pDevIns, pvUser);
    38563851    Assert(PDMDevHlpCritSectIsOwner(pDevIns, pDevIns->CTX_SUFF(pCritSectRo)));
     3852    Assert(offPort == 0); RT_NOREF(offPort);
    38573853
    38583854    /*
    38593855     * VGA BIOS char printing.
    38603856     */
    3861     if (    cb == 1
    3862         &&  Port == VBE_PRINTF_PORT)
     3857    if (cb == 1)
    38633858    {
    38643859#if 0
     
    38723867        }
    38733868#else
    3874         if (lastWasNotNewline == 0)
     3869        static int s_fLastWasNotNewline = 0;  /* We are only called in a single-threaded way */
     3870        if (s_fLastWasNotNewline == 0)
    38753871            Log(("vgabios: "));
    38763872        if (u32 != '\r')  /* return - is only sent in conjunction with '\n' */
    38773873            Log(("%c", u32));
    38783874        if (u32 == '\n')
    3879             lastWasNotNewline = 0;
     3875            s_fLastWasNotNewline = 0;
    38803876        else
    3881             lastWasNotNewline = 1;
     3877            s_fLastWasNotNewline = 1;
    38823878#endif
    38833879        return VINF_SUCCESS;
     
    67966792
    67976793    /* vga bios */
    6798     rc = PDMDevHlpIOPortRegister(pDevIns, VBE_PRINTF_PORT, 1, NULL, vgaIOPortWriteBIOS, vgaIOPortReadBIOS, NULL, NULL, "VGA BIOS debug/panic");
     6794    rc = PDMDevHlpIoPortCreateAndMap(pDevIns, VBE_PRINTF_PORT, 1 /*cPorts*/, vgaIoPortWriteBios, vgaIoPortReadBios,
     6795                                     "VGA BIOS debug/panic", NULL /*paExtDescs*/, &pThis->hIoPortBios);
    67996796    AssertRCReturn(rc, rc);
    6800     if (pDevIns->fR0Enabled)
    6801     {
    6802         rc = PDMDevHlpIOPortRegisterR0(pDevIns, VBE_PRINTF_PORT,  1, 0, "vgaIOPortWriteBIOS", "vgaIOPortReadBIOS", NULL, NULL, "VGA BIOS debug/panic");
    6803         if (RT_FAILURE(rc))
    6804             return rc;
    6805     }
    68066797
    68076798    /*
     
    68156806    }
    68166807    else if (RT_FAILURE(rc))
    6817         return PDMDEV_SET_ERROR(pDevIns, rc,
    6818                                 N_("Configuration error: Querying \"BiosRom\" as a string failed"));
     6808        return PDMDEV_SET_ERROR(pDevIns, rc, N_("Configuration error: Querying \"BiosRom\" as a string failed"));
    68196809    else if (!*pThis->pszVgaBiosFile)
    68206810    {
     
    74407430
    74417431#undef REG_PORT
     7432
     7433    /* BIOS port: */
     7434    rc = PDMDevHlpIoPortSetUpContext(pDevIns, pThis->hIoPortBios, vgaIoPortWriteBios, vgaIoPortReadBios, NULL /*pvUser*/);
     7435    AssertRCReturn(rc, rc);
     7436
    74427437    return VINF_SUCCESS;
    74437438}
  • trunk/src/VBox/Devices/Graphics/DevVGA.h

    r82065 r82069  
    533533    /** @} */
    534534
     535    /** The BIOS printf I/O port. */
     536    IOMIOPORTHANDLE             hIoPortBios;
    535537    /** The VBE extra data I/O port. */
    536538    IOMIOPORTHANDLE             hIoPortVbeExtra;
Note: See TracChangeset for help on using the changeset viewer.

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