Index: /trunk/include/VBox/Graphics/HGSMI.h
===================================================================
--- /trunk/include/VBox/Graphics/HGSMI.h	(revision 66505)
+++ /trunk/include/VBox/Graphics/HGSMI.h	(revision 66506)
@@ -30,6 +30,5 @@
 #define ___VBox_Graphics_HGSMI_h
 
-#include <iprt/assert.h>
-#include <iprt/types.h>
+#include <VBoxVideoIPRT.h>
 
 #include <HGSMIDefs.h>
Index: /trunk/include/VBox/Graphics/HGSMIDefs.h
===================================================================
--- /trunk/include/VBox/Graphics/HGSMIDefs.h	(revision 66505)
+++ /trunk/include/VBox/Graphics/HGSMIDefs.h	(revision 66506)
@@ -30,6 +30,5 @@
 #define ___VBox_Graphics_HGSMIDefs_h
 
-#include <iprt/assert.h>
-#include <iprt/types.h>
+#include <VBoxVideoIPRT.h>
 
 /* HGSMI uses 32 bit offsets and sizes. */
Index: /trunk/include/VBox/Graphics/HGSMIMemAlloc.h
===================================================================
--- /trunk/include/VBox/Graphics/HGSMIMemAlloc.h	(revision 66505)
+++ /trunk/include/VBox/Graphics/HGSMIMemAlloc.h	(revision 66506)
@@ -31,5 +31,5 @@
 
 #include <HGSMIDefs.h>
-#include <iprt/list.h>
+#include <VBoxVideoIPRT.h>
 
 
Index: /trunk/include/VBox/Graphics/VBoxVideo.h
===================================================================
--- /trunk/include/VBox/Graphics/VBoxVideo.h	(revision 66505)
+++ /trunk/include/VBox/Graphics/VBoxVideo.h	(revision 66506)
@@ -27,7 +27,5 @@
 #define ___VBox_Graphics_VBoxVideo_h
 
-#include <iprt/cdefs.h>
-#include <iprt/types.h>
-#include <iprt/assert.h>
+#include <VBoxVideoIPRT.h>
 
 /* this should be in sync with monitorCount <xsd:maxInclusive value="64"/> in src/VBox/Main/xml/VirtualBox-settings-common.xsd */
Index: /trunk/include/VBox/Graphics/VBoxVideoGuest.h
===================================================================
--- /trunk/include/VBox/Graphics/VBoxVideoGuest.h	(revision 66505)
+++ /trunk/include/VBox/Graphics/VBoxVideoGuest.h	(revision 66506)
@@ -32,16 +32,5 @@
 #include <HGSMIChSetup.h>
 #include <VBoxVideo.h>
-
-#include <iprt/err.h>  /* The functions in here return IPRT errors. */
-
-#ifdef VBOX_XPDM_MINIPORT
-# include <iprt/nt/miniport.h>
-# include <ntddvdeo.h> /* sdk, clean */
-# include <iprt/nt/Video.h>
-#elif defined VBOX_GUESTR3XORGMOD
-# include <compiler.h>
-#else
-# include <iprt/asm-amd64-x86.h>
-#endif
+#include <VBoxVideoIPRT.h>
 
 #ifdef VBOX_WDDM_MINIPORT
@@ -52,20 +41,4 @@
  typedef HGSMIHEAP HGSMIGUESTCMDHEAP;
 # define HGSMIGUESTCMDHEAP_GET(_p) (_p)
-#endif
-
-#if defined(IN_RING0) && defined(RT_OS_LINUX)
-# define VBVOAssert(a) do {} while(0)
-# define VBVOAssertPtr(a) do {} while(0)
-# define VBVOAssertReturnVoid(a) if (!(a)) return
-# define VBVOAssertRC(a) do {} while(0)
-# define VBVOAssertPtrNullReturnVoid(a) do {} while(0)
-# define VBVOAssertPtrReturnVoid(a) if (!(a)) return
-#else
-# define VBVOAssert Assert
-# define VBVOAssertPtr AssertPtr
-# define VBVOAssertReturnVoid AssertReturnVoid
-# define VBVOAssertRC AssertRC
-# define VBVOAssertPtrNullReturnVoid AssertPtrNullReturnVoid
-# define VBVOAssertPtrReturnVoid AssertPtrReturnVoid
 #endif
 
@@ -134,80 +107,4 @@
     struct VBVABUFFER *pVBVA;
 } VBVABUFFERCONTEXT, *PVBVABUFFERCONTEXT;
-
-/** @name Helper functions
- * @{ */
-/** Write an 8-bit value to an I/O port. */
-DECLINLINE(void) VBoxVideoCmnPortWriteUchar(RTIOPORT Port, uint8_t Value)
-{
-#ifdef VBOX_XPDM_MINIPORT
-    VideoPortWritePortUchar((PUCHAR)Port, Value);
-#elif defined VBOX_GUESTR3XORGMOD
-    outb(Port, Value);
-#else  /** @todo make these explicit */
-    ASMOutU8(Port, Value);
-#endif
-}
-
-/** Write a 16-bit value to an I/O port. */
-DECLINLINE(void) VBoxVideoCmnPortWriteUshort(RTIOPORT Port, uint16_t Value)
-{
-#ifdef VBOX_XPDM_MINIPORT
-    VideoPortWritePortUshort((PUSHORT)Port,Value);
-#elif defined VBOX_GUESTR3XORGMOD
-    outw(Port, Value);
-#else
-    ASMOutU16(Port, Value);
-#endif
-}
-
-/** Write a 32-bit value to an I/O port. */
-DECLINLINE(void) VBoxVideoCmnPortWriteUlong(RTIOPORT Port, uint32_t Value)
-{
-#ifdef VBOX_XPDM_MINIPORT
-    VideoPortWritePortUlong((PULONG)Port,Value);
-#elif defined VBOX_GUESTR3XORGMOD
-    outl(Port, Value);
-#else
-    ASMOutU32(Port, Value);
-#endif
-}
-
-/** Read an 8-bit value from an I/O port. */
-DECLINLINE(uint8_t) VBoxVideoCmnPortReadUchar(RTIOPORT Port)
-{
-#ifdef VBOX_XPDM_MINIPORT
-    return VideoPortReadPortUchar((PUCHAR)Port);
-#elif defined VBOX_GUESTR3XORGMOD
-    return inb(Port);
-#else
-    return ASMInU8(Port);
-#endif
-}
-
-/** Read a 16-bit value from an I/O port. */
-DECLINLINE(uint16_t) VBoxVideoCmnPortReadUshort(RTIOPORT Port)
-{
-#ifdef VBOX_XPDM_MINIPORT
-    return VideoPortReadPortUshort((PUSHORT)Port);
-#elif defined VBOX_GUESTR3XORGMOD
-    return inw(Port);
-#else
-    return ASMInU16(Port);
-#endif
-}
-
-/** Read a 32-bit value from an I/O port. */
-DECLINLINE(uint32_t) VBoxVideoCmnPortReadUlong(RTIOPORT Port)
-{
-#ifdef VBOX_XPDM_MINIPORT
-    return VideoPortReadPortUlong((PULONG)Port);
-#elif defined VBOX_GUESTR3XORGMOD
-    return inl(Port);
-#else
-    return ASMInU32(Port);
-#endif
-}
-
-/** @}  */
 
 /** @name Base HGSMI APIs
Index: /trunk/include/VBox/Graphics/VBoxVideoIPRT.h
===================================================================
--- /trunk/include/VBox/Graphics/VBoxVideoIPRT.h	(revision 66506)
+++ /trunk/include/VBox/Graphics/VBoxVideoIPRT.h	(revision 66506)
@@ -0,0 +1,112 @@
+/** @file
+ * VirtualBox Video driver, common code - iprt and VirtualBox macros and
+ * definitions.
+ */
+
+/*
+ * Copyright (C) 2017 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
+
+#ifndef ___VBox_VBoxVideoIPRT_h
+#define ___VBox_VBoxVideoIPRT_h
+
+#include <iprt/asm.h>
+#include <iprt/assert.h>
+#include <iprt/cdefs.h>
+#include <iprt/err.h>
+#include <iprt/list.h>
+#include <iprt/stdarg.h>
+#include <iprt/stdint.h>
+#include <iprt/string.h>
+#include <iprt/types.h>
+
+#if !defined VBOX_XPDM_MINIPORT && !defined VBOX_GUESTR3XORGMOD
+# include <iprt/asm-amd64-x86.h>
+#endif
+
+#ifdef VBOX_XPDM_MINIPORT
+# include <iprt/nt/miniport.h>
+# include <ntddvdeo.h> /* sdk, clean */
+# include <iprt/nt/Video.h>
+#elif defined VBOX_GUESTR3XORGMOD
+# include <compiler.h>
+#endif
+
+/** @name Port I/O helpers
+ * @{ */
+
+#ifdef VBOX_XPDM_MINIPORT
+
+/** Write an 8-bit value to an I/O port. */
+# define VBoxVideoCmnPortWriteUchar(Port, Value) \
+    VideoPortWritePortUchar((PUCHAR)Port, Value)
+/** Write a 16-bit value to an I/O port. */
+# define VBoxVideoCmnPortWriteUshort(Port, Value) \
+    VideoPortWritePortUshort((PUSHORT)Port, Value)
+/** Write a 32-bit value to an I/O port. */
+# define VBoxVideoCmnPortWriteUlong(Port, Value) \
+    VideoPortWritePortUlong((PULONG)Port, Value)
+/** Read an 8-bit value from an I/O port. */
+# define VBoxVideoCmnPortReadUchar(Port) \
+    VideoPortReadPortUchar((PUCHAR)Port)
+/** Read a 16-bit value from an I/O port. */
+# define VBoxVideoCmnPortReadUshort(Port) \
+    VideoPortReadPortUshort((PUSHORT)Port)
+/** Read a 32-bit value from an I/O port. */
+# define VBoxVideoCmnPortReadUlong(Port) \
+    VideoPortReadPortUlong((PULONG)Port)
+    
+#elif defined(VBOX_GUESTR3XORGMOD)
+
+/** Write an 8-bit value to an I/O port. */
+# define VBoxVideoCmnPortWriteUchar(Port, Value) \
+    outb(Port, Value)
+/** Write a 16-bit value to an I/O port. */
+# define VBoxVideoCmnPortWriteUshort(Port, Value) \
+    outw(Port, Value)
+/** Write a 32-bit value to an I/O port. */
+# define VBoxVideoCmnPortWriteUlong(Port, Value) \
+    outl(Port, Value)
+/** Read an 8-bit value from an I/O port. */
+# define VBoxVideoCmnPortReadUchar(Port) \
+    inb(Port)
+/** Read a 16-bit value from an I/O port. */
+# define VBoxVideoCmnPortReadUshort(Port) \
+    inw(Port)
+/** Read a 32-bit value from an I/O port. */
+# define VBoxVideoCmnPortReadUlong(Port) \
+    inl(Port)
+
+#else  /** @todo make these explicit */
+
+/** Write an 8-bit value to an I/O port. */
+# define VBoxVideoCmnPortWriteUchar(Port, Value) \
+    ASMOutU8(Port, Value)
+/** Write a 16-bit value to an I/O port. */
+# define VBoxVideoCmnPortWriteUshort(Port, Value) \
+    ASMOutU16(Port, Value)
+/** Write a 32-bit value to an I/O port. */
+# define VBoxVideoCmnPortWriteUlong(Port, Value) \
+    ASMOutU32(Port, Value)
+/** Read an 8-bit value from an I/O port. */
+# define VBoxVideoCmnPortReadUchar(Port) \
+    ASMInU8(Port)
+/** Read a 16-bit value from an I/O port. */
+# define VBoxVideoCmnPortReadUshort(Port) \
+    ASMInU16(Port)
+/** Read a 32-bit value from an I/O port. */
+# define VBoxVideoCmnPortReadUlong(Port) \
+    ASMInU32(Port)
+#endif
+
+/** @}  */
+
+#endif /* ___VBox_VBoxVideoIPRT_h */
Index: /trunk/src/VBox/Additions/common/VBoxVideo/HGSMIBase.cpp
===================================================================
--- /trunk/src/VBox/Additions/common/VBoxVideo/HGSMIBase.cpp	(revision 66505)
+++ /trunk/src/VBox/Additions/common/VBoxVideo/HGSMIBase.cpp	(revision 66506)
@@ -19,7 +19,5 @@
 #include <VBoxVideoGuest.h>
 #include <VBoxVideoVBE.h>
-
-#include <iprt/asm.h>
-#include <iprt/string.h>
+#include <VBoxVideoIPRT.h>
 
 /** Send completion notification to the host for the command located at offset
@@ -43,5 +41,5 @@
     HGSMIBUFFERHEADER *pHdr = HGSMIBufferHeaderFromData(pvMem);
     HGSMIOFFSET offMem = HGSMIPointerToOffset(&pCtx->areaCtx, pHdr);
-    VBVOAssert(offMem != HGSMIOFFSET_VOID);
+    Assert(offMem != HGSMIOFFSET_VOID);
     if(offMem != HGSMIOFFSET_VOID)
     {
@@ -56,5 +54,5 @@
 {
     int rc = HGSMIBufferProcess(&pCtx->areaCtx, &pCtx->channels, offBuffer);
-    VBVOAssert(!RT_FAILURE(rc));
+    Assert(!RT_FAILURE(rc));
     if(RT_FAILURE(rc))
     {
@@ -77,5 +75,5 @@
 {
     HGSMIOFFSET offset = hgsmiGetHostBuffer(pCtx);
-    VBVOAssertReturnVoid(offset != HGSMIOFFSET_VOID);
+    AssertReturnVoid(offset != HGSMIOFFSET_VOID);
     hgsmiHostCmdProcess(pCtx, offset);
 }
@@ -161,5 +159,5 @@
     HGSMIOFFSET offBuffer = HGSMIHeapBufferOffset (HGSMIGUESTCMDHEAP_GET(&pCtx->heapCtx), pvBuffer);
 
-    VBVOAssert(offBuffer != HGSMIOFFSET_VOID);
+    Assert(offBuffer != HGSMIOFFSET_VOID);
     if (offBuffer != HGSMIOFFSET_VOID)
     {
@@ -241,5 +239,5 @@
         if (RT_SUCCESS(rc))
         {
-            VBVOAssertRC(pCaps->rc);
+            AssertRC(pCaps->rc);
             rc = pCaps->rc;
         }
@@ -317,9 +315,9 @@
                                              uint32_t *poffHostFlags)
 {
-    VBVOAssertPtrNullReturnVoid(poffVRAMBaseMapping);
-    VBVOAssertPtrNullReturnVoid(pcbMapping);
-    VBVOAssertPtrNullReturnVoid(poffGuestHeapMemory);
-    VBVOAssertPtrNullReturnVoid(pcbGuestHeapMemory);
-    VBVOAssertPtrNullReturnVoid(poffHostFlags);
+    AssertPtrNullReturnVoid(poffVRAMBaseMapping);
+    AssertPtrNullReturnVoid(pcbMapping);
+    AssertPtrNullReturnVoid(poffGuestHeapMemory);
+    AssertPtrNullReturnVoid(pcbGuestHeapMemory);
+    AssertPtrNullReturnVoid(poffHostFlags);
     if (poffVRAMBaseMapping)
         *poffVRAMBaseMapping = cbVRAM - VBVA_ADAPTER_INFORMATION_SIZE;
@@ -386,6 +384,6 @@
     uint32_t offVRAMHostArea = offVRAMBaseMapping, cbHostArea = 0;
 
-    VBVOAssertPtrReturnVoid(poffVRAMHostArea);
-    VBVOAssertPtrReturnVoid(pcbHostArea);
+    AssertPtrReturnVoid(poffVRAMHostArea);
+    AssertPtrReturnVoid(pcbHostArea);
     VBoxQueryConfHGSMI(pCtx, VBOX_VBVA_CONF32_HOST_HEAP_SIZE, &cbHostArea);
     if (cbHostArea != 0)
@@ -464,10 +462,10 @@
      * host heap is ready */
     int rc = vboxHGSMIReportFlagsLocation(pCtx, offVRAMFlagsLocation);
-    VBVOAssertRC(rc);
+    AssertRC(rc);
     if (RT_SUCCESS(rc) && fCaps)
     {
         /* Inform about caps */
         rc = vboxHGSMISendCapsInfo(pCtx, fCaps);
-        VBVOAssertRC(rc);
+        AssertRC(rc);
     }
     if (RT_SUCCESS (rc))
@@ -475,5 +473,5 @@
         /* Report the host heap location. */
         rc = vboxHGSMIReportHostArea(pCtx, offVRAMHostArea, cbHostArea);
-        VBVOAssertRC(rc);
+        AssertRC(rc);
     }
     // Log(("VBoxVideo::vboxSetupAdapterInfo finished rc = %d\n", rc));
Index: /trunk/src/VBox/Additions/common/VBoxVideo/Modesetting.cpp
===================================================================
--- /trunk/src/VBox/Additions/common/VBoxVideo/Modesetting.cpp	(revision 66505)
+++ /trunk/src/VBox/Additions/common/VBoxVideo/Modesetting.cpp	(revision 66506)
@@ -21,5 +21,5 @@
 
 #ifndef VBOX_GUESTR3XF86MOD
-# include <iprt/string.h>
+# include <VBoxVideoIPRT.h>
 #endif
 
@@ -331,5 +331,5 @@
 {
     int rc;
-    VBVOAssertPtr(paHints);
+    AssertPtr(paHints);
     if (!VALID_PTR(paHints))
         return VERR_INVALID_POINTER;
Index: /trunk/src/VBox/Additions/common/VBoxVideo/VBVABase.cpp
===================================================================
--- /trunk/src/VBox/Additions/common/VBoxVideo/VBVABase.cpp	(revision 66505)
+++ /trunk/src/VBox/Additions/common/VBoxVideo/VBVABase.cpp	(revision 66506)
@@ -18,7 +18,5 @@
 
 #include <VBoxVideoGuest.h>
-#include <VBox/err.h>
-// #include <VBox/log.h>
-#include <iprt/string.h>
+#include <VBoxVideoIPRT.h>
 
 /*
@@ -162,6 +160,6 @@
         uint32_t indexRecordNext;
 
-        VBVOAssert(!pCtx->fHwBufferOverflow);
-        VBVOAssert(pCtx->pRecord == NULL);
+        Assert(!pCtx->fHwBufferOverflow);
+        Assert(pCtx->pRecord == NULL);
 
         indexRecordNext = (pCtx->pVBVA->indexRecordFree + 1) % VBVA_MAX_RECORDS;
@@ -206,8 +204,8 @@
     // LogFunc(("\n"));
 
-    VBVOAssert(pCtx->pVBVA);
+    Assert(pCtx->pVBVA);
 
     pRecord = pCtx->pRecord;
-    VBVOAssert(pRecord && (pRecord->cbRecord & VBVA_F_RECORD_PARTIAL));
+    Assert(pRecord && (pRecord->cbRecord & VBVA_F_RECORD_PARTIAL));
 
     /* Mark the record completed. */
@@ -288,5 +286,5 @@
 
     VBVABUFFER *pVBVA = pCtx->pVBVA;
-    VBVOAssert(pVBVA);
+    Assert(pVBVA);
 
     if (!pVBVA || pCtx->fHwBufferOverflow)
@@ -295,8 +293,8 @@
     }
 
-    VBVOAssert(pVBVA->indexRecordFirst != pVBVA->indexRecordFree);
+    Assert(pVBVA->indexRecordFirst != pVBVA->indexRecordFree);
 
     pRecord = pCtx->pRecord;
-    VBVOAssert(pRecord && (pRecord->cbRecord & VBVA_F_RECORD_PARTIAL));
+    Assert(pRecord && (pRecord->cbRecord & VBVA_F_RECORD_PARTIAL));
 
     // LogFunc(("%d\n", cb));
@@ -328,5 +326,5 @@
                     // LogFunc(("Buffer overflow!!!\n"));
                     pCtx->fHwBufferOverflow = true;
-                    VBVOAssert(false);
+                    Assert(false);
                     return false;
                 }
@@ -336,6 +334,6 @@
         }
 
-        VBVOAssert(cbChunk <= cb);
-        VBVOAssert(cbChunk <= vboxHwBufferAvail (pVBVA));
+        Assert(cbChunk <= cb);
+        Assert(cbChunk <= vboxHwBufferAvail (pVBVA));
 
         vboxHwBufferPlaceDataAt (pCtx, (uint8_t *)p + cbWritten, cbChunk, pVBVA->off32Free);
Index: /trunk/src/VBox/Additions/linux/drm/VBoxVideoIPRT.h
===================================================================
--- /trunk/src/VBox/Additions/linux/drm/VBoxVideoIPRT.h	(revision 66506)
+++ /trunk/src/VBox/Additions/linux/drm/VBoxVideoIPRT.h	(revision 66506)
@@ -0,0 +1,105 @@
+/** @file
+ * VirtualBox Video driver, common code - iprt and VirtualBox macros and
+ * definitions.
+ */
+
+/*
+ * Copyright (C) 2017 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
+
+#ifndef ___VBox_VBoxVideoIPRT_h
+#define ___VBox_VBoxVideoIPRT_h
+
+#include <asm/cmpxchg.h>
+#include <asm/io.h>
+#include <iprt/cdefs.h>
+#include <iprt/list.h>
+#include <iprt/stdarg.h>
+#include <iprt/stdint.h>
+
+#include <linux/string.h>
+
+/** @name VirtualBox error macros
+ * @{ */
+
+#define VINF_SUCCESS                        0
+#define VERR_INVALID_PARAMETER              (-2)
+#define VERR_INVALID_POINTER                (-6)
+#define VERR_NO_MEMORY                      (-8)
+#define VERR_NOT_IMPLEMENTED                (-12)
+#define VERR_INVALID_FUNCTION               (-36)
+#define VERR_NOT_SUPPORTED                  (-37)
+#define VERR_TOO_MUCH_DATA                  (-42)
+#define VERR_INVALID_STATE                  (-79)
+#define VERR_OUT_OF_RESOURCES               (-80)
+#define VERR_ALREADY_EXISTS                 (-105)
+#define VERR_INTERNAL_ERROR                 (-225)
+
+#define RT_SUCCESS_NP(rc)   ( (int)(rc) >= VINF_SUCCESS )
+#define RT_SUCCESS(rc)      ( likely(RT_SUCCESS_NP(rc)) )
+#define RT_FAILURE(rc)      ( unlikely(!RT_SUCCESS_NP(rc)) )
+
+/** @}  */
+
+/** @name VirtualBox helper functions
+ * @{ */
+
+#define RT_ZERO(x) memset(&(x), 0, sizeof(x))
+#define ASMAtomicCmpXchgBool(b, new_val, old_val) \
+	(cmpxchg(b, old_val, new_val) == old_val)
+#define ASMAtomicWriteBool(b, val) xchg(b, val)
+#define ASMCompilerBarrier() mb()
+
+/** @}  */
+
+/** @name VirtualBox assertions
+ * @{ */
+
+#define Assert(a) WARN_ON(a)
+#define AssertPtr(a) WARN_ON(!(a))
+#define AssertReturnVoid(a) do { if (WARN_ON(!(a))) return; } while(0)
+#define AssertRC(a) WARN_ON(RT_FAILURE(a))
+#define AssertPtrNullReturnVoid(a) do {} while(0)
+#define AssertPtrReturnVoid(a) do { if (WARN_ON(!(a))) return; } while(0)
+
+extern int RTASSERTVAR[1];
+#define AssertCompile(expr) \
+    extern int RTASSERTVAR[1] __attribute__((__unused__)), \
+    RTASSERTVAR[(expr) ? 1 : 0] __attribute__((__unused__))
+#define AssertCompileSize(type, size) \
+    AssertCompile(sizeof(type) == (size))
+
+/** @}  */
+
+/** @name Port I/O helpers
+ * @{ */
+/** Write an 8-bit value to an I/O port. */
+#define VBoxVideoCmnPortWriteUchar(Port, Value) \
+    outb(Value, Port)
+/** Write a 16-bit value to an I/O port. */
+#define VBoxVideoCmnPortWriteUshort(Port, Value) \
+    outw(Value, Port)
+/** Write a 32-bit value to an I/O port. */
+#define VBoxVideoCmnPortWriteUlong(Port, Value) \
+    outl(Value, Port)
+/** Read an 8-bit value from an I/O port. */
+#define VBoxVideoCmnPortReadUchar(Port) \
+    inb(Port)
+/** Read a 16-bit value from an I/O port. */
+#define VBoxVideoCmnPortReadUshort(Port) \
+    inw(Port)
+/** Read a 32-bit value from an I/O port. */
+#define VBoxVideoCmnPortReadUlong(Port) \
+    inl(Port)
+
+/** @}  */
+
+#endif /* ___VBox_VBoxVideoIPRT_h */
Index: /trunk/src/VBox/Additions/linux/drm/files_vboxvideo_drv
===================================================================
--- /trunk/src/VBox/Additions/linux/drm/files_vboxvideo_drv	(revision 66505)
+++ /trunk/src/VBox/Additions/linux/drm/files_vboxvideo_drv	(revision 66506)
@@ -21,19 +21,9 @@
     ${PATH_OUT}/revision-generated.h=>revision-generated.h \
     ${PATH_OUT}/product-generated.h=>product-generated.h \
-    ${PATH_ROOT}/include/iprt/asm.h=>include/iprt/asm.h \
-    ${PATH_ROOT}/include/iprt/asm-amd64-x86.h=>include/iprt/asm-amd64-x86.h \
-    ${PATH_ROOT}/include/iprt/assert.h=>include/iprt/assert.h \
     ${PATH_ROOT}/include/iprt/cdefs.h=>include/iprt/cdefs.h \
-    ${PATH_ROOT}/include/iprt/err.h=>include/iprt/err.h \
-    ${PATH_ROOT}/include/iprt/latin1.h=>include/iprt/latin1.h \
     ${PATH_ROOT}/include/iprt/list.h=>include/iprt/list.h \
     ${PATH_ROOT}/include/iprt/stdarg.h=>include/iprt/stdarg.h \
     ${PATH_ROOT}/include/iprt/stdint.h=>include/iprt/stdint.h \
-    ${PATH_ROOT}/include/iprt/string.h=>include/iprt/string.h \
     ${PATH_ROOT}/include/iprt/types.h=>include/iprt/types.h \
-    ${PATH_ROOT}/include/iprt/utf16.h=>include/iprt/utf16.h \
-    ${PATH_ROOT}/include/VBox/cdefs.h=>include/VBox/cdefs.h \
-    ${PATH_ROOT}/include/VBox/err.h=>include/VBox/err.h \
-    ${PATH_ROOT}/include/VBox/types.h=>include/VBox/types.h \
     ${PATH_ROOT}/include/VBox/Graphics/VBoxVideo.h=>include/VBoxVideo.h \
     ${PATH_ROOT}/include/VBox/Graphics/VBoxVideoGuest.h=>include/VBoxVideoGuest.h \
@@ -47,4 +37,5 @@
     ${PATH_ROOT}/src/VBox/Additions/common/VBoxVideo/Modesetting.cpp=>Modesetting.c \
     ${PATH_ROOT}/src/VBox/Additions/common/VBoxVideo/VBVABase.cpp=>VBVABase.c \
+    ${PATH_ROOT}/src/VBox/Additions/linux/drm/VBoxVideoIPRT.h=>include/VBoxVideoIPRT.h \
     ${PATH_ROOT}/src/VBox/Additions/linux/drm/vbox_drv.c=>vbox_drv.c \
     ${PATH_ROOT}/src/VBox/Additions/linux/drm/vbox_drv.h=>vbox_drv.h \
Index: /trunk/src/VBox/GuestHost/HGSMI/HGSMICommon.cpp
===================================================================
--- /trunk/src/VBox/GuestHost/HGSMI/HGSMICommon.cpp	(revision 66505)
+++ /trunk/src/VBox/GuestHost/HGSMI/HGSMICommon.cpp	(revision 66506)
@@ -23,5 +23,5 @@
 #define LOG_GROUP LOG_GROUP_HGSMI
 
-#include <iprt/string.h>
+#include <VBoxVideoIPRT.h>
 
 #include <HGSMI.h>
Index: /trunk/src/VBox/GuestHost/HGSMI/HGSMIMemAlloc.cpp
===================================================================
--- /trunk/src/VBox/GuestHost/HGSMI/HGSMIMemAlloc.cpp	(revision 66505)
+++ /trunk/src/VBox/GuestHost/HGSMI/HGSMIMemAlloc.cpp	(revision 66506)
@@ -56,6 +56,5 @@
 #include <HGSMI.h>
 
-#include <iprt/err.h>
-#include <iprt/string.h>
+#include <VBoxVideoIPRT.h>
 
 /*
