Changeset 34429 in vbox for trunk/include
- Timestamp:
- Nov 27, 2010 1:56:46 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/VBoxVideoGuest.h
r34346 r34429 32 32 #include <VBox/HGSMI/HGSMI.h> 33 33 #include <VBox/HGSMI/HGSMIChSetup.h> 34 35 #ifdef VBOX_XPDM_MINIPORT 36 RT_C_DECLS_BEGIN 37 # include "miniport.h" 38 # include "ntddvdeo.h" 39 # include <Video.h> 40 RT_C_DECLS_END 41 #else 42 # include <iprt/asm-amd64-x86.h> 43 #endif 44 45 RT_C_DECLS_BEGIN 34 46 35 47 /** … … 74 86 } HGSMIHOSTCOMMANDCONTEXT, *PHGSMIHOSTCOMMANDCONTEXT; 75 87 88 /** @name Helper functions 89 * @{ */ 90 /** Write an 8-bit value to an I/O port. */ 91 DECLINLINE(void) VBoxVideoCmnPortWriteUchar(RTIOPORT Port, uint8_t Value) 92 { 93 #ifdef VBOX_XPDM_MINIPORT 94 VideoPortWritePortUchar((PUCHAR)Port, Value); 95 #else /** @todo make these explicit */ 96 ASMOutU8(Port, Value); 97 #endif 98 } 99 100 /** Write a 16-bit value to an I/O port. */ 101 DECLINLINE(void) VBoxVideoCmnPortWriteUshort(RTIOPORT Port, uint16_t Value) 102 { 103 #ifdef VBOX_XPDM_MINIPORT 104 VideoPortWritePortUshort((PUSHORT)Port,Value); 105 #else 106 ASMOutU16(Port, Value); 107 #endif 108 } 109 110 /** Write a 32-bit value to an I/O port. */ 111 DECLINLINE(void) VBoxVideoCmnPortWriteUlong(RTIOPORT Port, uint32_t Value) 112 { 113 #ifdef VBOX_XPDM_MINIPORT 114 VideoPortWritePortUlong((PULONG)Port,Value); 115 #else 116 ASMOutU32(Port, Value); 117 #endif 118 } 119 120 /** Read an 8-bit value from an I/O port. */ 121 DECLINLINE(uint8_t) VBoxVideoCmnPortReadUchar(RTIOPORT Port) 122 { 123 #ifdef VBOX_XPDM_MINIPORT 124 return VideoPortReadPortUchar((PUCHAR)Port); 125 #else 126 return ASMInU8(Port); 127 #endif 128 } 129 130 /** Read a 16-bit value from an I/O port. */ 131 DECLINLINE(uint16_t) VBoxVideoCmnPortReadUshort(RTIOPORT Port) 132 { 133 #ifdef VBOX_XPDM_MINIPORT 134 return VideoPortReadPortUshort((PUSHORT)Port); 135 #else 136 return ASMInU16(Port); 137 #endif 138 } 139 140 /** Read a 32-bit value from an I/O port. */ 141 DECLINLINE(uint32_t) VBoxVideoCmnPortReadUlong(RTIOPORT Port) 142 { 143 #ifdef VBOX_XPDM_MINIPORT 144 return VideoPortReadPortUlong((PULONG)Port); 145 #else 146 return ASMInU32(Port); 147 #endif 148 } 149 150 /** @} */ 151 152 /** @name Base HGSMI APIs 153 * @{ */ 154 155 /** Acknowlege an IRQ. */ 156 DECLINLINE(void) VBoxHGSMIClearIrq(PHGSMIHOSTCOMMANDCONTEXT pCtx) 157 { 158 VBoxVideoCmnPortWriteUlong(pCtx->port, HGSMIOFFSET_VOID); 159 } 160 161 RTDECL(void) VBoxHGSMIHostCmdComplete(PHGSMIHOSTCOMMANDCONTEXT pCtx, 162 void *pvMem); 163 RTDECL(void) VBoxHGSMIProcessHostQueue(PHGSMIHOSTCOMMANDCONTEXT pCtx); 164 RTDECL(bool) VBoxHGSMIIsSupported(void); 165 RTDECL(void *) VBoxHGSMIBufferAlloc(PHGSMIGUESTCOMMANDCONTEXT pCtx, 166 HGSMISIZE cbData, 167 uint8_t u8Ch, 168 uint16_t u16Op); 169 RTDECL(void) VBoxHGSMIBufferFree(PHGSMIGUESTCOMMANDCONTEXT pCtx, 170 void *pvBuffer); 171 RTDECL(int) VBoxHGSMIBufferSubmit(PHGSMIGUESTCOMMANDCONTEXT pCtx, 172 void *pvBuffer); 173 174 typedef struct VBVAINFOVIEW *PVBVAINFOVIEW; 175 /** 176 * Callback funtion called from @a VBoxHGSMISendViewInfo to initialise 177 * the @a VBVAINFOVIEW structure for each screen. 178 * 179 * @returns iprt status code 180 * @param pvData context data for the callback, passed to @a 181 * VBoxHGSMISendViewInfo along with the callback 182 * @param pInfo array of @a VBVAINFOVIEW structures to be filled in 183 * @todo explicitly pass the array size 184 */ 185 typedef DECLCALLBACK(int) FNHGSMIFILLVIEWINFO (void *pvData, 186 PVBVAINFOVIEW pInfo); 187 /** Pointer to a FNHGSMIFILLVIEWINFO callback */ 188 typedef FNHGSMIFILLVIEWINFO *PFNHGSMIFILLVIEWINFO; 189 190 RTDECL(int) VBoxHGSMISendViewInfo(PHGSMIGUESTCOMMANDCONTEXT pCtx, 191 uint32_t u32Count, 192 PFNHGSMIFILLVIEWINFO pfnFill, 193 void *pvData); 194 RTDECL(void) VBoxHGSMIGetBaseMappingInfo(uint32_t cbVRAM, 195 uint32_t *poffVRAMBaseMapping, 196 uint32_t *pcbMapping, 197 uint32_t *poffGuestHeapMemory, 198 uint32_t *pcbGuestHeapMemory, 199 uint32_t *poffHostFlags); 200 /** @todo we should provide a cleanup function too as part of the API */ 201 RTDECL(int) VBoxHGSMISetupGuestContext(PHGSMIGUESTCOMMANDCONTEXT pCtx, 202 void *pvGuestHeapMemory, 203 uint32_t cbGuestHeapMemory, 204 uint32_t offVRAMGuestHeapMemory); 205 RTDECL(void) VBoxHGSMIGetHostAreaMapping(PHGSMIGUESTCOMMANDCONTEXT pCtx, 206 uint32_t cbVRAM, 207 uint32_t offVRAMBaseMapping, 208 uint32_t *poffVRAMHostArea, 209 uint32_t *pcbHostArea); 210 RTDECL(void) VBoxHGSMISetupHostContext(PHGSMIHOSTCOMMANDCONTEXT pCtx, 211 void *pvBaseMapping, 212 uint32_t offHostFlags, 213 void *pvHostAreaMapping, 214 uint32_t offVRAMHostArea, 215 uint32_t cbHostArea); 216 RTDECL(int) VBoxHGSMISendHostCtxInfo(PHGSMIGUESTCOMMANDCONTEXT pCtx, 217 HGSMIOFFSET offVRAMFlagsLocation, 218 uint32_t fCaps, 219 uint32_t offVRAMHostArea, 220 uint32_t cbHostArea); 221 RTDECL(uint32_t) VBoxHGSMIGetMonitorCount(PHGSMIGUESTCOMMANDCONTEXT pCtx); 222 RTDECL(bool) VBoxHGSMIUpdatePointerShape(PHGSMIGUESTCOMMANDCONTEXT pCtx, 223 uint32_t fFlags, 224 uint32_t cHotX, 225 uint32_t cHotY, 226 uint32_t cWidth, 227 uint32_t cHeight, 228 uint8_t *pPixels, 229 uint32_t cbLength); 230 231 /** @} */ 232 233 RT_C_DECLS_END 76 234 77 235 #endif /* __HGSMI_GUEST_h__*/
Note:
See TracChangeset
for help on using the changeset viewer.