Changeset 82084 in vbox
- Timestamp:
- Nov 21, 2019 4:26:41 PM (5 years ago)
- Location:
- trunk/src/VBox/Devices/Graphics
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/DevVGA.cpp
r82079 r82084 52 52 53 53 #ifdef VBOX_WITH_HGSMI 54 #define PCIDEV_2_VGASTATE(pPciDev) ((PVGASTATE)((uintptr_t)pPciDev - RT_OFFSETOF(VGASTATE, Dev)))54 #define PCIDEV_2_VGASTATE(pPciDev) ((PVGASTATE)((uintptr_t)pPciDev - RT_OFFSETOF(VGASTATE, Dev))) 55 55 #endif /* VBOX_WITH_HGSMI */ 56 56 /** Converts a vga adaptor state pointer to a device instance pointer. */ 57 #define VGASTATE2DEVINS(pVgaState) ((pVgaState)->CTX_SUFF(pDevIns)) 58 59 /** Check buffer if an VRAM offset is within the right range or not. */ 60 #if defined(IN_RC) || defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0) || (defined(IN_RING0) && defined(VGA_WITH_PARTIAL_RING0_MAPPING)) 61 # define VERIFY_VRAM_WRITE_OFF_RETURN(pThis, off) \ 62 do { \ 63 if ((off) < VGA_MAPPING_SIZE) \ 64 RT_UNTRUSTED_VALIDATED_FENCE(); \ 65 else \ 66 { \ 67 AssertMsgReturn((off) < (pThis)->vram_size, ("%RX32 !< %RX32\n", (uint32_t)(off), (pThis)->vram_size), VINF_SUCCESS); \ 68 Log2(("%Rfn[%d]: %RX32 -> R3\n", __PRETTY_FUNCTION__, __LINE__, (off))); \ 69 return VINF_IOM_R3_MMIO_WRITE; \ 70 } \ 71 } while (0) 72 #else 73 # define VERIFY_VRAM_WRITE_OFF_RETURN(pThis, off) \ 74 do { \ 75 AssertMsgReturn((off) < (pThis)->vram_size, ("%RX32 !< %RX32\n", (uint32_t)(off), (pThis)->vram_size), VINF_SUCCESS); \ 76 RT_UNTRUSTED_VALIDATED_FENCE(); \ 77 } while (0) 78 #endif 79 80 /** Check buffer if an VRAM offset is within the right range or not. */ 81 #if defined(IN_RC) || defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0) || (defined(IN_RING0) && defined(VGA_WITH_PARTIAL_RING0_MAPPING)) 82 # define VERIFY_VRAM_READ_OFF_RETURN(pThis, off, rcVar) \ 83 do { \ 84 if ((off) < VGA_MAPPING_SIZE) \ 85 RT_UNTRUSTED_VALIDATED_FENCE(); \ 86 else \ 87 { \ 88 AssertMsgReturn((off) < (pThis)->vram_size, ("%RX32 !< %RX32\n", (uint32_t)(off), (pThis)->vram_size), 0xff); \ 89 Log2(("%Rfn[%d]: %RX32 -> R3\n", __PRETTY_FUNCTION__, __LINE__, (off))); \ 90 (rcVar) = VINF_IOM_R3_MMIO_READ; \ 91 return 0; \ 92 } \ 93 } while (0) 94 #else 95 # define VERIFY_VRAM_READ_OFF_RETURN(pThis, off, rcVar) \ 96 do { \ 97 AssertMsgReturn((off) < (pThis)->vram_size, ("%RX32 !< %RX32\n", (uint32_t)(off), (pThis)->vram_size), 0xff); \ 98 RT_UNTRUSTED_VALIDATED_FENCE(); \ 99 NOREF(rcVar); \ 100 } while (0) 101 #endif 57 #define VGASTATE2DEVINS(pVgaState) ((pVgaState)->CTX_SUFF(pDevIns)) 102 58 103 59 /* VGA text mode blinking constants (cursor and blinking chars). */ 104 #define VGA_BLINK_PERIOD_FULL (RT_NS_100MS * 4) /*Blink cycle length. */105 #define VGA_BLINK_PERIOD_ON (RT_NS_100MS * 2) /*How long cursor/text is visible. */60 #define VGA_BLINK_PERIOD_FULL (RT_NS_100MS * 4) /**< Blink cycle length. */ 61 #define VGA_BLINK_PERIOD_ON (RT_NS_100MS * 2) /**< How long cursor/text is visible. */ 106 62 107 63 -
trunk/src/VBox/Devices/Graphics/DevVGA.h
r82078 r82084 74 74 #endif 75 75 76 77 /** @name Macros dealing with partial ring-0/raw-mode VRAM mappings. 78 * @{ */ 76 79 /** The size of the VGA ring-0 and raw-mode mapping. 77 80 * … … 86 89 * The VGA_MAPPING_SIZE define sets the number of bytes that will be mapped. */ 87 90 #define VGA_WITH_PARTIAL_RING0_MAPPING 91 92 /** 93 * Check buffer if an VRAM offset is within the right range or not. 94 */ 95 #if defined(IN_RC) || defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0) || (defined(IN_RING0) && defined(VGA_WITH_PARTIAL_RING0_MAPPING)) 96 # define VERIFY_VRAM_WRITE_OFF_RETURN(pThis, off) \ 97 do { \ 98 if ((off) < VGA_MAPPING_SIZE) \ 99 RT_UNTRUSTED_VALIDATED_FENCE(); \ 100 else \ 101 { \ 102 AssertMsgReturn((off) < (pThis)->vram_size, ("%RX32 !< %RX32\n", (uint32_t)(off), (pThis)->vram_size), VINF_SUCCESS); \ 103 Log2(("%Rfn[%d]: %RX32 -> R3\n", __PRETTY_FUNCTION__, __LINE__, (off))); \ 104 return VINF_IOM_R3_MMIO_WRITE; \ 105 } \ 106 } while (0) 107 #else 108 # define VERIFY_VRAM_WRITE_OFF_RETURN(pThis, off) \ 109 do { \ 110 AssertMsgReturn((off) < (pThis)->vram_size, ("%RX32 !< %RX32\n", (uint32_t)(off), (pThis)->vram_size), VINF_SUCCESS); \ 111 RT_UNTRUSTED_VALIDATED_FENCE(); \ 112 } while (0) 113 #endif 114 115 /** 116 * Check buffer if an VRAM offset is within the right range or not. 117 */ 118 #if defined(IN_RC) || defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0) || (defined(IN_RING0) && defined(VGA_WITH_PARTIAL_RING0_MAPPING)) 119 # define VERIFY_VRAM_READ_OFF_RETURN(pThis, off, rcVar) \ 120 do { \ 121 if ((off) < VGA_MAPPING_SIZE) \ 122 RT_UNTRUSTED_VALIDATED_FENCE(); \ 123 else \ 124 { \ 125 AssertMsgReturn((off) < (pThis)->vram_size, ("%RX32 !< %RX32\n", (uint32_t)(off), (pThis)->vram_size), 0xff); \ 126 Log2(("%Rfn[%d]: %RX32 -> R3\n", __PRETTY_FUNCTION__, __LINE__, (off))); \ 127 (rcVar) = VINF_IOM_R3_MMIO_READ; \ 128 return 0; \ 129 } \ 130 } while (0) 131 #else 132 # define VERIFY_VRAM_READ_OFF_RETURN(pThis, off, rcVar) \ 133 do { \ 134 AssertMsgReturn((off) < (pThis)->vram_size, ("%RX32 !< %RX32\n", (uint32_t)(off), (pThis)->vram_size), 0xff); \ 135 RT_UNTRUSTED_VALIDATED_FENCE(); \ 136 NOREF(rcVar); \ 137 } while (0) 138 #endif 139 /** @} */ 140 88 141 89 142 #define MSR_COLOR_EMULATION 0x01
Note:
See TracChangeset
for help on using the changeset viewer.