- Timestamp:
- Nov 21, 2019 9:14:50 AM (5 years ago)
- Location:
- trunk/src/VBox/Devices/Graphics
- Files:
-
- 2 edited
-
DevVGA.cpp (modified) (5 diffs)
-
DevVGA.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/DevVGA.cpp
r82066 r82069 3833 3833 3834 3834 /** 3835 * @callback_method_impl{FNIOMIOPORT IN,3835 * @callback_method_impl{FNIOMIOPORTNEWIN, 3836 3836 * Port I/O Handler for VGA BIOS IN operations.} 3837 3837 */ 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); 3838 static DECLCALLBACK(VBOXSTRICTRC) vgaIoPortReadBios(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT offPort, uint32_t *pu32, unsigned cb) 3839 { 3840 RT_NOREF(pDevIns, pvUser, offPort, pu32, cb); 3845 3841 return VERR_IOM_IOPORT_UNUSED; 3846 3842 } 3847 3843 3848 3844 /** 3849 * @callback_method_impl{FNIOMIOPORT OUT,3845 * @callback_method_impl{FNIOMIOPORTNEWOUT, 3850 3846 * Port I/O Handler for VGA BIOS IN operations.} 3851 3847 */ 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 */ 3848 static DECLCALLBACK(VBOXSTRICTRC) vgaIoPortWriteBios(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT offPort, uint32_t u32, unsigned cb) 3849 { 3855 3850 RT_NOREF2(pDevIns, pvUser); 3856 3851 Assert(PDMDevHlpCritSectIsOwner(pDevIns, pDevIns->CTX_SUFF(pCritSectRo))); 3852 Assert(offPort == 0); RT_NOREF(offPort); 3857 3853 3858 3854 /* 3859 3855 * VGA BIOS char printing. 3860 3856 */ 3861 if ( cb == 1 3862 && Port == VBE_PRINTF_PORT) 3857 if (cb == 1) 3863 3858 { 3864 3859 #if 0 … … 3872 3867 } 3873 3868 #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) 3875 3871 Log(("vgabios: ")); 3876 3872 if (u32 != '\r') /* return - is only sent in conjunction with '\n' */ 3877 3873 Log(("%c", u32)); 3878 3874 if (u32 == '\n') 3879 lastWasNotNewline = 0;3875 s_fLastWasNotNewline = 0; 3880 3876 else 3881 lastWasNotNewline = 1;3877 s_fLastWasNotNewline = 1; 3882 3878 #endif 3883 3879 return VINF_SUCCESS; … … 6796 6792 6797 6793 /* 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); 6799 6796 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 }6806 6797 6807 6798 /* … … 6815 6806 } 6816 6807 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")); 6819 6809 else if (!*pThis->pszVgaBiosFile) 6820 6810 { … … 7440 7430 7441 7431 #undef REG_PORT 7432 7433 /* BIOS port: */ 7434 rc = PDMDevHlpIoPortSetUpContext(pDevIns, pThis->hIoPortBios, vgaIoPortWriteBios, vgaIoPortReadBios, NULL /*pvUser*/); 7435 AssertRCReturn(rc, rc); 7436 7442 7437 return VINF_SUCCESS; 7443 7438 } -
trunk/src/VBox/Devices/Graphics/DevVGA.h
r82065 r82069 533 533 /** @} */ 534 534 535 /** The BIOS printf I/O port. */ 536 IOMIOPORTHANDLE hIoPortBios; 535 537 /** The VBE extra data I/O port. */ 536 538 IOMIOPORTHANDLE hIoPortVbeExtra;
Note:
See TracChangeset
for help on using the changeset viewer.

