pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
virtualbox: Initial set of changes to fix symbol clash with system headers
Module Name: pkgsrc-wip
Committed By: Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By: kamil
Date: Sun Jul 10 02:08:47 2016 +0200
Changeset: 1c0f18e9ce69e74cb2df4ea7ea46c9e37990b0da
Modified Files:
virtualbox/distinfo
Added Files:
virtualbox/patches/patch-include_VBox_rawpci.h
virtualbox/patches/patch-include_VBox_types.h
virtualbox/patches/patch-include_VBox_vmm_cfgm.h
virtualbox/patches/patch-include_VBox_vmm_cpum.h
virtualbox/patches/patch-include_VBox_vmm_dbgf.h
virtualbox/patches/patch-include_VBox_vmm_ftm.h
virtualbox/patches/patch-include_VBox_vmm_gvm.h
virtualbox/patches/patch-include_VBox_vmm_gvmm.h
virtualbox/patches/patch-include_VBox_vmm_iom.h
virtualbox/patches/patch-include_VBox_vmm_mm.h
virtualbox/patches/patch-include_VBox_vmm_pdmapi.h
virtualbox/patches/patch-include_VBox_vmm_pdmasynccompletion.h
virtualbox/patches/patch-include_VBox_vmm_pdmblkcache.h
virtualbox/patches/patch-include_VBox_vmm_pdmcritsect.h
virtualbox/patches/patch-include_VBox_vmm_pdmcritsectrw.h
virtualbox/patches/patch-include_VBox_vmm_pdmdev.h
virtualbox/patches/patch-include_VBox_vmm_pdmpci.h
virtualbox/patches/patch-include_VBox_vmm_pdmqueue.h
virtualbox/patches/patch-include_VBox_vmm_pdmthread.h
virtualbox/patches/patch-include_VBox_vmm_ssm.h
virtualbox/patches/patch-include_VBox_vmm_stam.h
virtualbox/patches/patch-include_VBox_vmm_tm.h
virtualbox/patches/patch-include_VBox_vmm_uvm.h
virtualbox/patches/patch-include_VBox_vmm_vmapi.h
virtualbox/patches/patch-include_VBox_vmm_vmm.h
virtualbox/patches/patch-src_VBox_Devices_Bus_SrvPciRawR0.cpp
virtualbox/patches/patch-src_VBox_VMM_VMMR3_SSM.cpp
virtualbox/patches/patch-src_VBox_VMM_include_CPUMInternal.h
Log Message:
virtualbox: Initial set of changes to fix symbol clash with system headers
PVM is defined in <sys/param.h>, rename it to vbox_PVM.
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=1c0f18e9ce69e74cb2df4ea7ea46c9e37990b0da
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
virtualbox/distinfo | 28 ++
virtualbox/patches/patch-include_VBox_rawpci.h | 22 +
virtualbox/patches/patch-include_VBox_types.h | 13 +
virtualbox/patches/patch-include_VBox_vmm_cfgm.h | 40 ++
virtualbox/patches/patch-include_VBox_vmm_cpum.h | 131 ++++++
virtualbox/patches/patch-include_VBox_vmm_dbgf.h | 122 ++++++
virtualbox/patches/patch-include_VBox_vmm_ftm.h | 33 ++
virtualbox/patches/patch-include_VBox_vmm_gvm.h | 18 +
virtualbox/patches/patch-include_VBox_vmm_gvmm.h | 84 ++++
virtualbox/patches/patch-include_VBox_vmm_iom.h | 104 +++++
virtualbox/patches/patch-include_VBox_vmm_mm.h | 290 ++++++++++++++
virtualbox/patches/patch-include_VBox_vmm_pdmapi.h | 155 ++++++++
.../patch-include_VBox_vmm_pdmasynccompletion.h | 23 ++
.../patches/patch-include_VBox_vmm_pdmblkcache.h | 72 ++++
.../patches/patch-include_VBox_vmm_pdmcritsect.h | 41 ++
.../patches/patch-include_VBox_vmm_pdmcritsectrw.h | 18 +
virtualbox/patches/patch-include_VBox_vmm_pdmdev.h | 40 ++
virtualbox/patches/patch-include_VBox_vmm_pdmpci.h | 28 ++
.../patches/patch-include_VBox_vmm_pdmqueue.h | 44 ++
.../patches/patch-include_VBox_vmm_pdmthread.h | 34 ++
virtualbox/patches/patch-include_VBox_vmm_ssm.h | 152 +++++++
virtualbox/patches/patch-include_VBox_vmm_stam.h | 59 +++
virtualbox/patches/patch-include_VBox_vmm_tm.h | 171 ++++++++
virtualbox/patches/patch-include_VBox_vmm_uvm.h | 27 ++
virtualbox/patches/patch-include_VBox_vmm_vmapi.h | 118 ++++++
virtualbox/patches/patch-include_VBox_vmm_vmm.h | 151 +++++++
.../patch-src_VBox_Devices_Bus_SrvPciRawR0.cpp | 40 ++
.../patches/patch-src_VBox_VMM_VMMR3_SSM.cpp | 442 +++++++++++++++++++++
.../patch-src_VBox_VMM_include_CPUMInternal.h | 46 +++
29 files changed, 2546 insertions(+)
diffs:
diff --git a/virtualbox/distinfo b/virtualbox/distinfo
index d005555..46f13b1 100644
--- a/virtualbox/distinfo
+++ b/virtualbox/distinfo
@@ -10,7 +10,32 @@ SHA1 (patch-configure) = b360df61c744ffbb335bf5b8b0dae36abd7206c2
SHA1 (patch-include_VBox_VBoxGuest.h) = 4f41910ca3abbc502bad31cb9f9b427566025765
SHA1 (patch-include_VBox_ostypes.h) = fd452f95c79b2e5c98a048af21f6561c80adebc5
SHA1 (patch-include_VBox_param.h) = 1efcacb3e7890344dc132fee85b945bf9baa9614
+SHA1 (patch-include_VBox_rawpci.h) = e79ddcf19ea8862bc648678cb8212ebd33b38098
+SHA1 (patch-include_VBox_types.h) = 2f4c71862085a5694c080b498bdb82a55ad712b8
SHA1 (patch-include_VBox_usb.h) = c16d333f6dee240f1d4147cc49c04451dfb776a7
+SHA1 (patch-include_VBox_vmm_cfgm.h) = f83d729ed8ffd9f059c9d06bb002d9fa54670bb1
+SHA1 (patch-include_VBox_vmm_cpum.h) = 5abdd2f9bc534a88c307a0517fbadbf088037d44
+SHA1 (patch-include_VBox_vmm_dbgf.h) = 7c74694596d4cdbe100146b21876c76187140dd6
+SHA1 (patch-include_VBox_vmm_ftm.h) = 3a9350453e466dbc96baf27b5d93b912da474811
+SHA1 (patch-include_VBox_vmm_gvm.h) = 424767981594e5c10be1a79083fa49d7fb84eb34
+SHA1 (patch-include_VBox_vmm_gvmm.h) = 4807df4ee6ab5c6536a52959643b188e85338808
+SHA1 (patch-include_VBox_vmm_iom.h) = d830194197220f2c090dc85ff2e29929935cc188
+SHA1 (patch-include_VBox_vmm_mm.h) = ff8727b1167ce1e78726f6dcb38e18a8bef1ee9a
+SHA1 (patch-include_VBox_vmm_pdmapi.h) = ce4f4761bd6eb4a35180c8383223dd93067f9588
+SHA1 (patch-include_VBox_vmm_pdmasynccompletion.h) = d2450d59d45205ea9088a724cc6ef0bebabfc7c7
+SHA1 (patch-include_VBox_vmm_pdmblkcache.h) = 9a2a4583ecc8ff127e6fe2f597cc2a92b941bd3c
+SHA1 (patch-include_VBox_vmm_pdmcritsect.h) = 4081ac5f87a6b2d8778dc03aa8b42ab349c4ce3f
+SHA1 (patch-include_VBox_vmm_pdmcritsectrw.h) = 3eefdd3a539d30e38ca3a2fffdfd1cc134cb69c2
+SHA1 (patch-include_VBox_vmm_pdmdev.h) = 2d839e1dfbaa545fd894ca7f3d4837143fc6450d
+SHA1 (patch-include_VBox_vmm_pdmpci.h) = b2c2662cc85ce0f6af11e7846c8127a740bd778f
+SHA1 (patch-include_VBox_vmm_pdmqueue.h) = 1530794bb5698746be12a92d2a511f0961cfb612
+SHA1 (patch-include_VBox_vmm_pdmthread.h) = 849fe1991fccda5a6c142b559932ca31df8a2f08
+SHA1 (patch-include_VBox_vmm_ssm.h) = d3897c09739809332df66121f94ca64fc829eb6f
+SHA1 (patch-include_VBox_vmm_stam.h) = 17ada0b96c1d688187c4d8b98824912bea9480b4
+SHA1 (patch-include_VBox_vmm_tm.h) = 1ee6f17044409fa83407904083b8940a15398495
+SHA1 (patch-include_VBox_vmm_uvm.h) = ace6cdfc0a1002a4de1bbbeb76c5fc04cc0b4486
+SHA1 (patch-include_VBox_vmm_vmapi.h) = a349612c7d04e09cded3a99150f5769f77723a4f
+SHA1 (patch-include_VBox_vmm_vmm.h) = 9e8d02d7e2056df088b83190694d5da1f454e7e7
SHA1 (patch-include_iprt_stdint.h) = b7ab7c1dd77e8d8725c249cc39a58da6c68766f5
SHA1 (patch-include_iprt_string.h) = dd74a70d35be03f480bbb42db170cf7c5f583e4e
SHA1 (patch-include_iprt_time.h) = 9940a7b65300990d2fbeb7629813323e8b7971c5
@@ -43,6 +68,7 @@ SHA1 (patch-src_VBox_Additions_netbsd_vboxvfs_vboxvfs__vfsops.c) = 7f1c95df11fa3
SHA1 (patch-src_VBox_Additions_netbsd_vboxvfs_vboxvfs__vnops.c) = e94574f46776b704755603d3a87be0ef6dee0827
SHA1 (patch-src_VBox_Debugger_DBGPlugInDiggers.cpp) = 3851f8bb02e1e00d504ca73542663ff78359bf01
SHA1 (patch-src_VBox_Debugger_DBGPlugIns.h) = c98f48c70574f05d6afa33e5309610d74c0c32ec
+SHA1 (patch-src_VBox_Devices_Bus_SrvPciRawR0.cpp) = 2adaa8676ed8077bb6296f71e2b5852cde5b17e7
SHA1 (patch-src_VBox_Devices_EFI_Firmware_AppPkg_Applications_Python_PyMod-2.7.1_Include_pyport.h) = 626e4ad27a01ba949b42a6fdb2f6e0dcf7daa132
SHA1 (patch-src_VBox_Devices_Makefile.kmk) = 67cb5e0bbad005e4ca71e8e74556ffae8939de61
SHA1 (patch-src_VBox_Devices_Network_DrvNAT.cpp) = c24f0b47ee671833fcc9d8bb9a569cd1c6710d95
@@ -197,8 +223,10 @@ SHA1 (patch-src_VBox_Storage_testcase_Makefile.kmk) = edafb43c93359d0b37fbe4bec8
SHA1 (patch-src_VBox_VMM_VMMR0_GMMR0.cpp) = 08336e3aa159e2d2092cacbd16c2011963fe3908
SHA1 (patch-src_VBox_VMM_VMMR0_VMMR0.cpp) = 57f17e39057edea79be1fa16a43f0624eaf2a15b
SHA1 (patch-src_VBox_VMM_VMMR3_PGMPhys.cpp) = 4b934d9c2dfcffc38eb4b9e834d91328c284a50b
+SHA1 (patch-src_VBox_VMM_VMMR3_SSM.cpp) = 63e22ce701acb9b965d95aa886a1880b73b4d116
SHA1 (patch-src_VBox_VMM_VMMR3_VM.cpp) = bf65afe2fe4012c332a3914eeaddde7a980c19b5
SHA1 (patch-src_VBox_VMM_VMMRC_VMMRCDeps.cpp) = 4c6a6919633b07e1e6a9b93ec2c49dfec598f7cd
+SHA1 (patch-src_VBox_VMM_include_CPUMInternal.h) = ceca029d59bc86f1d98a6b2ccfc279700fb39995
SHA1 (patch-src_VBox_VMM_testcase_mkdsk.sh) = b45e17ad1ea5ab524fd4e36448b29b5700e20fec
SHA1 (patch-src_VBox_VMM_testcase_tstX86-1.cpp) = bbdefc55c2ca664475417a127093995c6e618b79
SHA1 (patch-src_VBox_ValidationKit_Makefile.kmk) = a9d0dbc43708423f088798dd4fdfc79e2d54c90a
diff --git a/virtualbox/patches/patch-include_VBox_rawpci.h b/virtualbox/patches/patch-include_VBox_rawpci.h
new file mode 100644
index 0000000..968741a
--- /dev/null
+++ b/virtualbox/patches/patch-include_VBox_rawpci.h
@@ -0,0 +1,22 @@
+$NetBSD$
+
+--- include/VBox/rawpci.h.orig 2016-03-04 19:22:58.000000000 +0000
++++ include/VBox/rawpci.h
+@@ -532,7 +532,7 @@ typedef struct RAWPCIFACTORY
+ * @param pPciData Pointer to PCI data.
+ */
+ DECLR0CALLBACKMEMBER(int, pfnInitVm,(PRAWPCIFACTORY pFactory,
+- PVM pVM,
++ vbox_PVM pVM,
+ PRAWPCIPERVM pPciData));
+
+ /**
+@@ -545,7 +545,7 @@ typedef struct RAWPCIFACTORY
+ * @param pPciData Pointer to PCI data.
+ */
+ DECLR0CALLBACKMEMBER(void, pfnDeinitVm,(PRAWPCIFACTORY pFactory,
+- PVM pVM,
++ vbox_PVM pVM,
+ PRAWPCIPERVM pPciData));
+ } RAWPCIFACTORY;
+
diff --git a/virtualbox/patches/patch-include_VBox_types.h b/virtualbox/patches/patch-include_VBox_types.h
new file mode 100644
index 0000000..451963d
--- /dev/null
+++ b/virtualbox/patches/patch-include_VBox_types.h
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- include/VBox/types.h.orig 2016-03-04 19:22:58.000000000 +0000
++++ include/VBox/types.h
+@@ -75,7 +75,7 @@ typedef SUPSEMEVENTMULTI
+
+
+ /** Pointer to a VM. */
+-typedef struct VM *PVM;
++typedef struct VM *vbox_PVM;
+ /** Pointer to a VM - Ring-0 Ptr. */
+ typedef R0PTRTYPE(struct VM *) PVMR0;
+ /** Pointer to a VM - Ring-3 Ptr. */
diff --git a/virtualbox/patches/patch-include_VBox_vmm_cfgm.h b/virtualbox/patches/patch-include_VBox_vmm_cfgm.h
new file mode 100644
index 0000000..19fa9ef
--- /dev/null
+++ b/virtualbox/patches/patch-include_VBox_vmm_cfgm.h
@@ -0,0 +1,40 @@
+$NetBSD$
+
+--- include/VBox/vmm/cfgm.h.orig 2016-03-04 19:22:58.000000000 +0000
++++ include/VBox/vmm/cfgm.h
+@@ -78,13 +78,13 @@ typedef enum CFGMCONFIGTYPE
+ * @param pVM The cross context VM structure.
+ * @param pvUser The argument supplied to VMR3Create().
+ */
+-typedef DECLCALLBACK(int) FNCFGMCONSTRUCTOR(PUVM pUVM, PVM pVM, void *pvUser);
++typedef DECLCALLBACK(int) FNCFGMCONSTRUCTOR(PUVM pUVM, vbox_PVM pVM, void *pvUser);
+ /** Pointer to a FNCFGMCONSTRUCTOR(). */
+ typedef FNCFGMCONSTRUCTOR *PFNCFGMCONSTRUCTOR;
+
+-VMMR3DECL(int) CFGMR3Init(PVM pVM, PFNCFGMCONSTRUCTOR pfnCFGMConstructor, void *pvUser);
+-VMMR3DECL(int) CFGMR3Term(PVM pVM);
+-VMMR3DECL(int) CFGMR3ConstructDefaultTree(PVM pVM);
++VMMR3DECL(int) CFGMR3Init(vbox_PVM pVM, PFNCFGMCONSTRUCTOR pfnCFGMConstructor, void *pvUser);
++VMMR3DECL(int) CFGMR3Term(vbox_PVM pVM);
++VMMR3DECL(int) CFGMR3ConstructDefaultTree(vbox_PVM pVM);
+
+ VMMR3DECL(PCFGMNODE) CFGMR3CreateTree(PUVM pUVM);
+ VMMR3DECL(int) CFGMR3DestroyTree(PCFGMNODE pRoot);
+@@ -190,10 +190,10 @@ VMMR3DECL(int) CFGMR3QueryStrin
+ /** @name Tree Navigation and Enumeration.
+ * @{
+ */
+-VMMR3DECL(PCFGMNODE) CFGMR3GetRoot(PVM pVM);
++VMMR3DECL(PCFGMNODE) CFGMR3GetRoot(vbox_PVM pVM);
+ VMMR3DECL(PCFGMNODE) CFGMR3GetRootU(PUVM pUVM);
+ VMMR3DECL(PCFGMNODE) CFGMR3GetParent(PCFGMNODE pNode);
+-VMMR3DECL(PCFGMNODE) CFGMR3GetParentEx(PVM pVM, PCFGMNODE pNode);
++VMMR3DECL(PCFGMNODE) CFGMR3GetParentEx(vbox_PVM pVM, PCFGMNODE pNode);
+ VMMR3DECL(PCFGMNODE) CFGMR3GetChild(PCFGMNODE pNode, const char *pszPath);
+ VMMR3DECL(PCFGMNODE) CFGMR3GetChildF(PCFGMNODE pNode, const char *pszPathFormat, ...) RT_IPRT_FORMAT_ATTR(2, 3);
+ VMMR3DECL(PCFGMNODE) CFGMR3GetChildFV(PCFGMNODE pNode, const char *pszPathFormat, va_list Args) RT_IPRT_FORMAT_ATTR(3, 0);
+@@ -224,4 +224,3 @@ RT_C_DECLS_END
+ /** @} */
+
+ #endif
+-
diff --git a/virtualbox/patches/patch-include_VBox_vmm_cpum.h b/virtualbox/patches/patch-include_VBox_vmm_cpum.h
new file mode 100644
index 0000000..2e1ffca
--- /dev/null
+++ b/virtualbox/patches/patch-include_VBox_vmm_cpum.h
@@ -0,0 +1,131 @@
+$NetBSD$
+
+--- include/VBox/vmm/cpum.h.orig 2016-03-04 19:22:58.000000000 +0000
++++ include/VBox/vmm/cpum.h
+@@ -1053,8 +1053,8 @@ VMMDECL(void) CPUMGetGuestCpuId(PV
+ VMMDECL(uint64_t) CPUMGetGuestEFER(PVMCPU pVCpu);
+ VMMDECL(VBOXSTRICTRC) CPUMQueryGuestMsr(PVMCPU pVCpu, uint32_t idMsr, uint64_t *puValue);
+ VMMDECL(VBOXSTRICTRC) CPUMSetGuestMsr(PVMCPU pVCpu, uint32_t idMsr, uint64_t uValue);
+-VMMDECL(CPUMCPUVENDOR) CPUMGetGuestCpuVendor(PVM pVM);
+-VMMDECL(CPUMCPUVENDOR) CPUMGetHostCpuVendor(PVM pVM);
++VMMDECL(CPUMCPUVENDOR) CPUMGetGuestCpuVendor(vbox_PVM pVM);
++VMMDECL(CPUMCPUVENDOR) CPUMGetHostCpuVendor(vbox_PVM pVM);
+ /** @} */
+
+ /** @name Guest Register Setters.
+@@ -1092,9 +1092,9 @@ VMMDECL(int) CPUMSetGuestFS(PVMCP
+ VMMDECL(int) CPUMSetGuestGS(PVMCPU pVCpu, uint16_t gs);
+ VMMDECL(int) CPUMSetGuestSS(PVMCPU pVCpu, uint16_t ss);
+ VMMDECL(void) CPUMSetGuestEFER(PVMCPU pVCpu, uint64_t val);
+-VMMDECL(void) CPUMSetGuestCpuIdFeature(PVM pVM, CPUMCPUIDFEATURE enmFeature);
+-VMMDECL(void) CPUMClearGuestCpuIdFeature(PVM pVM, CPUMCPUIDFEATURE enmFeature);
+-VMMDECL(bool) CPUMGetGuestCpuIdFeature(PVM pVM, CPUMCPUIDFEATURE enmFeature);
++VMMDECL(void) CPUMSetGuestCpuIdFeature(vbox_PVM pVM, CPUMCPUIDFEATURE enmFeature);
++VMMDECL(void) CPUMClearGuestCpuIdFeature(vbox_PVM pVM, CPUMCPUIDFEATURE enmFeature);
++VMMDECL(bool) CPUMGetGuestCpuIdFeature(vbox_PVM pVM, CPUMCPUIDFEATURE enmFeature);
+ VMMDECL(void) CPUMSetGuestCtx(PVMCPU pVCpu, const PCPUMCTX pCtx);
+ VMM_INT_DECL(void) CPUMGuestLazyLoadHiddenCsAndSs(PVMCPU pVCpu);
+ VMM_INT_DECL(void) CPUMGuestLazyLoadHiddenSelectorReg(PVMCPU pVCpu, PCPUMSELREG pSReg);
+@@ -1341,9 +1341,9 @@ VMMDECL(void) CPUMRawSetEFlags
+ VMMDECL(void) CPUMSetChangedFlags(PVMCPU pVCpu, uint32_t fChangedAdd);
+ VMMR3DECL(uint32_t) CPUMR3RemEnter(PVMCPU pVCpu, uint32_t *puCpl);
+ VMMR3DECL(void) CPUMR3RemLeave(PVMCPU pVCpu, bool fNoOutOfSyncSels);
+-VMMDECL(bool) CPUMSupportsXSave(PVM pVM);
+-VMMDECL(bool) CPUMIsHostUsingSysEnter(PVM pVM);
+-VMMDECL(bool) CPUMIsHostUsingSysCall(PVM pVM);
++VMMDECL(bool) CPUMSupportsXSave(vbox_PVM pVM);
++VMMDECL(bool) CPUMIsHostUsingSysEnter(vbox_PVM pVM);
++VMMDECL(bool) CPUMIsHostUsingSysCall(vbox_PVM pVM);
+ VMMDECL(bool) CPUMIsGuestFPUStateActive(PVMCPU pVCpu);
+ VMMDECL(bool) CPUMIsGuestDebugStateActive(PVMCPU pVCpu);
+ VMMDECL(bool) CPUMIsGuestDebugStateActivePending(PVMCPU pVCpu);
+@@ -1354,7 +1354,7 @@ VMMDECL(uint32_t) CPUMGetGuestCPL(
+ VMMDECL(CPUMMODE) CPUMGetGuestMode(PVMCPU pVCpu);
+ VMMDECL(uint32_t) CPUMGetGuestCodeBits(PVMCPU pVCpu);
+ VMMDECL(DISCPUMODE) CPUMGetGuestDisMode(PVMCPU pVCpu);
+-VMMDECL(uint64_t) CPUMGetGuestScalableBusFrequency(PVM pVM);
++VMMDECL(uint64_t) CPUMGetGuestScalableBusFrequency(vbox_PVM pVM);
+
+ /** @name Typical scalable bus frequency values.
+ * @{ */
+@@ -1376,19 +1376,19 @@ VMMDECL(uint64_t) CPUMGetGuestScal
+ * @{
+ */
+
+-VMMR3DECL(int) CPUMR3Init(PVM pVM);
+-VMMR3DECL(int) CPUMR3InitCompleted(PVM pVM);
+-VMMR3DECL(void) CPUMR3LogCpuIds(PVM pVM);
+-VMMR3DECL(void) CPUMR3Relocate(PVM pVM);
+-VMMR3DECL(int) CPUMR3Term(PVM pVM);
+-VMMR3DECL(void) CPUMR3Reset(PVM pVM);
+-VMMR3DECL(void) CPUMR3ResetCpu(PVM pVM, PVMCPU pVCpu);
+-VMMDECL(bool) CPUMR3IsStateRestorePending(PVM pVM);
+-VMMR3DECL(void) CPUMR3SetHWVirtEx(PVM pVM, bool fHWVirtExEnabled);
+-VMMR3DECL(int) CPUMR3SetCR4Feature(PVM pVM, RTHCUINTREG fOr, RTHCUINTREG fAnd);
++VMMR3DECL(int) CPUMR3Init(vbox_PVM pVM);
++VMMR3DECL(int) CPUMR3InitCompleted(vbox_PVM pVM);
++VMMR3DECL(void) CPUMR3LogCpuIds(vbox_PVM pVM);
++VMMR3DECL(void) CPUMR3Relocate(vbox_PVM pVM);
++VMMR3DECL(int) CPUMR3Term(vbox_PVM pVM);
++VMMR3DECL(void) CPUMR3Reset(vbox_PVM pVM);
++VMMR3DECL(void) CPUMR3ResetCpu(vbox_PVM pVM, PVMCPU pVCpu);
++VMMDECL(bool) CPUMR3IsStateRestorePending(vbox_PVM pVM);
++VMMR3DECL(void) CPUMR3SetHWVirtEx(vbox_PVM pVM, bool fHWVirtExEnabled);
++VMMR3DECL(int) CPUMR3SetCR4Feature(vbox_PVM pVM, RTHCUINTREG fOr, RTHCUINTREG fAnd);
+
+-VMMR3DECL(int) CPUMR3CpuIdInsert(PVM pVM, PCPUMCPUIDLEAF pNewLeaf);
+-VMMR3DECL(int) CPUMR3CpuIdGetLeaf(PVM pVM, PCPUMCPUIDLEAF pLeaf, uint32_t uLeaf, uint32_t uSubLeaf);
++VMMR3DECL(int) CPUMR3CpuIdInsert(vbox_PVM pVM, PCPUMCPUIDLEAF pNewLeaf);
++VMMR3DECL(int) CPUMR3CpuIdGetLeaf(vbox_PVM pVM, PCPUMCPUIDLEAF pLeaf, uint32_t uLeaf, uint32_t uSubLeaf);
+ VMMR3DECL(CPUMMICROARCH) CPUMR3CpuIdDetermineMicroarchEx(CPUMCPUVENDOR enmVendor, uint8_t bFamily,
+ uint8_t bModel, uint8_t bStepping);
+ VMMR3DECL(const char *) CPUMR3MicroarchName(CPUMMICROARCH enmMicroarch);
+@@ -1398,18 +1398,18 @@ VMMR3DECL(const char *) CPUMR3CpuIdU
+ VMMR3DECL(CPUMCPUVENDOR) CPUMR3CpuIdDetectVendorEx(uint32_t uEAX, uint32_t uEBX, uint32_t uECX, uint32_t uEDX);
+ VMMR3DECL(const char *) CPUMR3CpuVendorName(CPUMCPUVENDOR enmVendor);
+
+-VMMR3DECL(int) CPUMR3MsrRangesInsert(PVM pVM, PCCPUMMSRRANGE pNewRange);
++VMMR3DECL(int) CPUMR3MsrRangesInsert(vbox_PVM pVM, PCCPUMMSRRANGE pNewRange);
+
+ # if defined(VBOX_WITH_RAW_MODE) || defined(DOXYGEN_RUNNING)
+ /** @name APIs for the CPUID raw-mode patch (legacy).
+ * @{ */
+-VMMR3_INT_DECL(RCPTRTYPE(PCCPUMCPUID)) CPUMR3GetGuestCpuIdPatmDefRCPtr(PVM pVM);
+-VMMR3_INT_DECL(uint32_t) CPUMR3GetGuestCpuIdPatmStdMax(PVM pVM);
+-VMMR3_INT_DECL(uint32_t) CPUMR3GetGuestCpuIdPatmExtMax(PVM pVM);
+-VMMR3_INT_DECL(uint32_t) CPUMR3GetGuestCpuIdPatmCentaurMax(PVM pVM);
+-VMMR3_INT_DECL(RCPTRTYPE(PCCPUMCPUID)) CPUMR3GetGuestCpuIdPatmStdRCPtr(PVM pVM);
+-VMMR3_INT_DECL(RCPTRTYPE(PCCPUMCPUID)) CPUMR3GetGuestCpuIdPatmExtRCPtr(PVM pVM);
+-VMMR3_INT_DECL(RCPTRTYPE(PCCPUMCPUID)) CPUMR3GetGuestCpuIdPatmCentaurRCPtr(PVM pVM);
++VMMR3_INT_DECL(RCPTRTYPE(PCCPUMCPUID)) CPUMR3GetGuestCpuIdPatmDefRCPtr(vbox_PVM pVM);
++VMMR3_INT_DECL(uint32_t) CPUMR3GetGuestCpuIdPatmStdMax(vbox_PVM pVM);
++VMMR3_INT_DECL(uint32_t) CPUMR3GetGuestCpuIdPatmExtMax(vbox_PVM pVM);
++VMMR3_INT_DECL(uint32_t) CPUMR3GetGuestCpuIdPatmCentaurMax(vbox_PVM pVM);
++VMMR3_INT_DECL(RCPTRTYPE(PCCPUMCPUID)) CPUMR3GetGuestCpuIdPatmStdRCPtr(vbox_PVM pVM);
++VMMR3_INT_DECL(RCPTRTYPE(PCCPUMCPUID)) CPUMR3GetGuestCpuIdPatmExtRCPtr(vbox_PVM pVM);
++VMMR3_INT_DECL(RCPTRTYPE(PCCPUMCPUID)) CPUMR3GetGuestCpuIdPatmCentaurRCPtr(vbox_PVM pVM);
+ /** @} */
+ # endif
+
+@@ -1461,11 +1461,11 @@ VMMDECL(void) CPUMRCRecheckRaw
+ */
+ VMMR0_INT_DECL(int) CPUMR0ModuleInit(void);
+ VMMR0_INT_DECL(int) CPUMR0ModuleTerm(void);
+-VMMR0_INT_DECL(int) CPUMR0InitVM(PVM pVM);
+-VMMR0_INT_DECL(int) CPUMR0Trap07Handler(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx);
+-VMMR0_INT_DECL(int) CPUMR0LoadGuestFPU(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx);
+-VMMR0_INT_DECL(int) CPUMR0SaveGuestFPU(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx);
+-VMMR0_INT_DECL(int) CPUMR0SaveHostDebugState(PVM pVM, PVMCPU pVCpu);
++VMMR0_INT_DECL(int) CPUMR0InitVM(vbox_PVM pVM);
++VMMR0_INT_DECL(int) CPUMR0Trap07Handler(vbox_PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx);
++VMMR0_INT_DECL(int) CPUMR0LoadGuestFPU(vbox_PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx);
++VMMR0_INT_DECL(int) CPUMR0SaveGuestFPU(vbox_PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx);
++VMMR0_INT_DECL(int) CPUMR0SaveHostDebugState(vbox_PVM pVM, PVMCPU pVCpu);
+ VMMR0_INT_DECL(bool) CPUMR0DebugStateMaybeSaveGuestAndRestoreHost(PVMCPU pVCpu, bool fDr6);
+ VMMR0_INT_DECL(bool) CPUMR0DebugStateMaybeSaveGuest(PVMCPU pVCpu, bool fDr6);
+
+@@ -1483,4 +1483,3 @@ RT_C_DECLS_END
+
+
+ #endif
+-
diff --git a/virtualbox/patches/patch-include_VBox_vmm_dbgf.h b/virtualbox/patches/patch-include_VBox_vmm_dbgf.h
new file mode 100644
index 0000000..1388c3b
--- /dev/null
+++ b/virtualbox/patches/patch-include_VBox_vmm_dbgf.h
@@ -0,0 +1,122 @@
+$NetBSD$
+
+--- include/VBox/vmm/dbgf.h.orig 2016-03-04 19:22:58.000000000 +0000
++++ include/VBox/vmm/dbgf.h
+@@ -46,8 +46,8 @@ RT_C_DECLS_BEGIN
+ /** @defgroup grp_dbgf_rz The RZ DBGF API
+ * @{
+ */
+-VMMRZ_INT_DECL(int) DBGFRZTrap01Handler(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, RTGCUINTREG uDr6, bool fAltStepping);
+-VMMRZ_INT_DECL(int) DBGFRZTrap03Handler(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame);
++VMMRZ_INT_DECL(int) DBGFRZTrap01Handler(vbox_PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, RTGCUINTREG uDr6, bool fAltStepping);
++VMMRZ_INT_DECL(int) DBGFRZTrap03Handler(vbox_PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame);
+ /** @} */
+ #endif
+
+@@ -281,18 +281,18 @@ typedef const DBGFEVENT *PCDBGFEVENT;
+ # define DBGFSTOP(pVM) VINF_SUCCESS
+ # endif
+
+-VMMR3_INT_DECL(int) DBGFR3Init(PVM pVM);
+-VMMR3_INT_DECL(int) DBGFR3Term(PVM pVM);
+-VMMR3_INT_DECL(void) DBGFR3PowerOff(PVM pVM);
+-VMMR3_INT_DECL(void) DBGFR3Relocate(PVM pVM, RTGCINTPTR offDelta);
+-VMMR3_INT_DECL(int) DBGFR3VMMForcedAction(PVM pVM);
+-VMMR3DECL(int) DBGFR3Event(PVM pVM, DBGFEVENTTYPE enmEvent);
+-VMMR3DECL(int) DBGFR3EventSrc(PVM pVM, DBGFEVENTTYPE enmEvent, const char *pszFile, unsigned uLine,
++VMMR3_INT_DECL(int) DBGFR3Init(vbox_PVM pVM);
++VMMR3_INT_DECL(int) DBGFR3Term(vbox_PVM pVM);
++VMMR3_INT_DECL(void) DBGFR3PowerOff(vbox_PVM pVM);
++VMMR3_INT_DECL(void) DBGFR3Relocate(vbox_PVM pVM, RTGCINTPTR offDelta);
++VMMR3_INT_DECL(int) DBGFR3VMMForcedAction(vbox_PVM pVM);
++VMMR3DECL(int) DBGFR3Event(vbox_PVM pVM, DBGFEVENTTYPE enmEvent);
++VMMR3DECL(int) DBGFR3EventSrc(vbox_PVM pVM, DBGFEVENTTYPE enmEvent, const char *pszFile, unsigned uLine,
+ const char *pszFunction, const char *pszFormat, ...) RT_IPRT_FORMAT_ATTR_MAYBE_NULL(6, 7);
+-VMMR3DECL(int) DBGFR3EventSrcV(PVM pVM, DBGFEVENTTYPE enmEvent, const char *pszFile, unsigned uLine,
++VMMR3DECL(int) DBGFR3EventSrcV(vbox_PVM pVM, DBGFEVENTTYPE enmEvent, const char *pszFile, unsigned uLine,
+ const char *pszFunction, const char *pszFormat, va_list args) RT_IPRT_FORMAT_ATTR_MAYBE_NULL(6, 0);
+-VMMR3_INT_DECL(int) DBGFR3EventAssertion(PVM pVM, DBGFEVENTTYPE enmEvent, const char *pszMsg1, const char *pszMsg2);
+-VMMR3_INT_DECL(int) DBGFR3EventBreakpoint(PVM pVM, DBGFEVENTTYPE enmEvent);
++VMMR3_INT_DECL(int) DBGFR3EventAssertion(vbox_PVM pVM, DBGFEVENTTYPE enmEvent, const char *pszMsg1, const char *pszMsg2);
++VMMR3_INT_DECL(int) DBGFR3EventBreakpoint(vbox_PVM pVM, DBGFEVENTTYPE enmEvent);
+ VMMR3_INT_DECL(int) DBGFR3PrgStep(PVMCPU pVCpu);
+
+ VMMR3DECL(int) DBGFR3Attach(PUVM pUVM);
+@@ -412,15 +412,15 @@ typedef FNDBGFBPENUM *PFNDBGFBPENUM;
+ VMMR3DECL(int) DBGFR3BpEnum(PUVM pUVM, PFNDBGFBPENUM pfnCallback, void *pvUser);
+ #endif /* IN_RING3 */
+
+-VMM_INT_DECL(RTGCUINTREG) DBGFBpGetDR7(PVM pVM);
+-VMM_INT_DECL(RTGCUINTREG) DBGFBpGetDR0(PVM pVM);
+-VMM_INT_DECL(RTGCUINTREG) DBGFBpGetDR1(PVM pVM);
+-VMM_INT_DECL(RTGCUINTREG) DBGFBpGetDR2(PVM pVM);
+-VMM_INT_DECL(RTGCUINTREG) DBGFBpGetDR3(PVM pVM);
+-VMM_INT_DECL(bool) DBGFBpIsHwArmed(PVM pVM);
+-VMM_INT_DECL(bool) DBGFBpIsHwIoArmed(PVM pVM);
++VMM_INT_DECL(RTGCUINTREG) DBGFBpGetDR7(vbox_PVM pVM);
++VMM_INT_DECL(RTGCUINTREG) DBGFBpGetDR0(vbox_PVM pVM);
++VMM_INT_DECL(RTGCUINTREG) DBGFBpGetDR1(vbox_PVM pVM);
++VMM_INT_DECL(RTGCUINTREG) DBGFBpGetDR2(vbox_PVM pVM);
++VMM_INT_DECL(RTGCUINTREG) DBGFBpGetDR3(vbox_PVM pVM);
++VMM_INT_DECL(bool) DBGFBpIsHwArmed(vbox_PVM pVM);
++VMM_INT_DECL(bool) DBGFBpIsHwIoArmed(vbox_PVM pVM);
+ VMM_INT_DECL(bool) DBGFIsStepping(PVMCPU pVCpu);
+-VMM_INT_DECL(VBOXSTRICTRC) DBGFBpCheckIo(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx, RTIOPORT uIoPort, uint8_t cbValue);
++VMM_INT_DECL(VBOXSTRICTRC) DBGFBpCheckIo(vbox_PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx, RTIOPORT uIoPort, uint8_t cbValue);
+
+
+ #ifdef IN_RING3 /* The CPU mode API only works in ring-3. */
+@@ -498,7 +498,7 @@ typedef FNDBGFHANDLERDRV *PFNDBGFHANDLE
+ * @param pHlp Callback functions for doing output.
+ * @param pszArgs Argument string. Optional and specific to the handler.
+ */
+-typedef DECLCALLBACK(void) FNDBGFHANDLERINT(PVM pVM, PCDBGFINFOHLP pHlp, const char *pszArgs);
++typedef DECLCALLBACK(void) FNDBGFHANDLERINT(vbox_PVM pVM, PCDBGFINFOHLP pHlp, const char *pszArgs);
+ /** Pointer to a FNDBGFHANDLERINT function. */
+ typedef FNDBGFHANDLERINT *PFNDBGFHANDLERINT;
+
+@@ -520,20 +520,20 @@ typedef FNDBGFHANDLEREXT *PFNDBGFHANDLE
+ #define DBGFINFO_FLAGS_RUN_ON_EMT RT_BIT(0)
+ /** @} */
+
+-VMMR3_INT_DECL(int) DBGFR3InfoRegisterDevice(PVM pVM, const char *pszName, const char *pszDesc, PFNDBGFHANDLERDEV pfnHandler, PPDMDEVINS pDevIns);
+-VMMR3_INT_DECL(int) DBGFR3InfoRegisterDriver(PVM pVM, const char *pszName, const char *pszDesc, PFNDBGFHANDLERDRV pfnHandler, PPDMDRVINS pDrvIns);
+-VMMR3_INT_DECL(int) DBGFR3InfoRegisterInternal(PVM pVM, const char *pszName, const char *pszDesc, PFNDBGFHANDLERINT pfnHandler);
+-VMMR3_INT_DECL(int) DBGFR3InfoRegisterInternalEx(PVM pVM, const char *pszName, const char *pszDesc, PFNDBGFHANDLERINT pfnHandler, uint32_t fFlags);
++VMMR3_INT_DECL(int) DBGFR3InfoRegisterDevice(vbox_PVM pVM, const char *pszName, const char *pszDesc, PFNDBGFHANDLERDEV pfnHandler, PPDMDEVINS pDevIns);
++VMMR3_INT_DECL(int) DBGFR3InfoRegisterDriver(vbox_PVM pVM, const char *pszName, const char *pszDesc, PFNDBGFHANDLERDRV pfnHandler, PPDMDRVINS pDrvIns);
++VMMR3_INT_DECL(int) DBGFR3InfoRegisterInternal(vbox_PVM pVM, const char *pszName, const char *pszDesc, PFNDBGFHANDLERINT pfnHandler);
++VMMR3_INT_DECL(int) DBGFR3InfoRegisterInternalEx(vbox_PVM pVM, const char *pszName, const char *pszDesc, PFNDBGFHANDLERINT pfnHandler, uint32_t fFlags);
+ VMMR3DECL(int) DBGFR3InfoRegisterExternal(PUVM pUVM, const char *pszName, const char *pszDesc, PFNDBGFHANDLEREXT pfnHandler, void *pvUser);
+-VMMR3_INT_DECL(int) DBGFR3InfoDeregisterDevice(PVM pVM, PPDMDEVINS pDevIns, const char *pszName);
+-VMMR3_INT_DECL(int) DBGFR3InfoDeregisterDriver(PVM pVM, PPDMDRVINS pDrvIns, const char *pszName);
+-VMMR3_INT_DECL(int) DBGFR3InfoDeregisterInternal(PVM pVM, const char *pszName);
++VMMR3_INT_DECL(int) DBGFR3InfoDeregisterDevice(vbox_PVM pVM, PPDMDEVINS pDevIns, const char *pszName);
++VMMR3_INT_DECL(int) DBGFR3InfoDeregisterDriver(vbox_PVM pVM, PPDMDRVINS pDrvIns, const char *pszName);
++VMMR3_INT_DECL(int) DBGFR3InfoDeregisterInternal(vbox_PVM pVM, const char *pszName);
+ VMMR3DECL(int) DBGFR3InfoDeregisterExternal(PUVM pUVM, const char *pszName);
+ VMMR3DECL(int) DBGFR3Info(PUVM pUVM, const char *pszName, const char *pszArgs, PCDBGFINFOHLP pHlp);
+ VMMR3DECL(int) DBGFR3InfoEx(PUVM pUVM, VMCPUID idCpu, const char *pszName, const char *pszArgs, PCDBGFINFOHLP pHlp);
+ VMMR3DECL(int) DBGFR3InfoLogRel(PUVM pUVM, const char *pszName, const char *pszArgs);
+ VMMR3DECL(int) DBGFR3InfoStdErr(PUVM pUVM, const char *pszName, const char *pszArgs);
+-VMMR3_INT_DECL(int) DBGFR3InfoMulti(PVM pVM, const char *pszIncludePat, const char *pszExcludePat,
++VMMR3_INT_DECL(int) DBGFR3InfoMulti(vbox_PVM pVM, const char *pszIncludePat, const char *pszExcludePat,
+ const char *pszSepFmt, PCDBGFINFOHLP pHlp);
+
+ /** @def DBGFR3_INFO_LOG
+@@ -1486,8 +1486,8 @@ VMMR3DECL(int) DBGFR3RegCpuSetBatch( PUV
+
+ VMMR3DECL(const char *) DBGFR3RegCpuName(PUVM pUVM, DBGFREG enmReg, DBGFREGVALTYPE enmType);
+
+-VMMR3_INT_DECL(int) DBGFR3RegRegisterCpu(PVM pVM, PVMCPU pVCpu, PCDBGFREGDESC paRegisters, bool fGuestRegs);
+-VMMR3_INT_DECL(int) DBGFR3RegRegisterDevice(PVM pVM, PCDBGFREGDESC paRegisters, PPDMDEVINS pDevIns,
++VMMR3_INT_DECL(int) DBGFR3RegRegisterCpu(vbox_PVM pVM, PVMCPU pVCpu, PCDBGFREGDESC paRegisters, bool fGuestRegs);
++VMMR3_INT_DECL(int) DBGFR3RegRegisterDevice(vbox_PVM pVM, PCDBGFREGDESC paRegisters, PPDMDEVINS pDevIns,
+ const char *pszPrefix, uint32_t iInstance);
+
+ /**
+@@ -1794,4 +1794,3 @@ VMMR3DECL(void) DBGFR3PlugInUnloadAll(PU
+ RT_C_DECLS_END
+
+ #endif
+-
diff --git a/virtualbox/patches/patch-include_VBox_vmm_ftm.h b/virtualbox/patches/patch-include_VBox_vmm_ftm.h
new file mode 100644
index 0000000..c015d63
--- /dev/null
+++ b/virtualbox/patches/patch-include_VBox_vmm_ftm.h
@@ -0,0 +1,33 @@
+$NetBSD$
+
+--- include/VBox/vmm/ftm.h.orig 2016-03-04 19:22:58.000000000 +0000
++++ include/VBox/vmm/ftm.h
+@@ -48,8 +48,8 @@ typedef enum FTMCHECKPOINTTYPE
+ FTMCHECKPOINTTYPE_32BIT_HACK = 0x7fffffff
+ } FTMCHECKPOINTTYPE;
+
+-VMM_INT_DECL(bool) FTMIsDeltaLoadSaveActive(PVM pVM);
+-VMM_INT_DECL(int) FTMSetCheckpoint(PVM pVM, FTMCHECKPOINTTYPE enmType);
++VMM_INT_DECL(bool) FTMIsDeltaLoadSaveActive(vbox_PVM pVM);
++VMM_INT_DECL(int) FTMSetCheckpoint(vbox_PVM pVM, FTMCHECKPOINTTYPE enmType);
+
+ #ifdef IN_RING3
+ /** @defgroup grp_ftm_r3 The FTM Host Context Ring-3 API
+@@ -58,9 +58,9 @@ VMM_INT_DECL(int) FTMSetCheckpoint(PVM
+ VMMR3DECL(int) FTMR3PowerOn(PUVM pUVM, bool fMaster, unsigned uInterval, const char *pszAddress, unsigned uPort, const char *pszPassword);
+ VMMR3DECL(int) FTMR3CancelStandby(PUVM pUVM);
+
+-VMMR3_INT_DECL(int) FTMR3Init(PVM pVM);
+-VMMR3_INT_DECL(int) FTMR3Term(PVM pVM);
+-VMMR3_INT_DECL(int) FTMR3SetCheckpoint(PVM pVM, FTMCHECKPOINTTYPE enmType);
++VMMR3_INT_DECL(int) FTMR3Init(vbox_PVM pVM);
++VMMR3_INT_DECL(int) FTMR3Term(vbox_PVM pVM);
++VMMR3_INT_DECL(int) FTMR3SetCheckpoint(vbox_PVM pVM, FTMCHECKPOINTTYPE enmType);
+
+ #endif /* IN_RING3 */
+
+@@ -71,4 +71,3 @@ VMMR3_INT_DECL(int) FTMR3SetCheckpoint(P
+ RT_C_DECLS_END
+
+ #endif
+-
diff --git a/virtualbox/patches/patch-include_VBox_vmm_gvm.h b/virtualbox/patches/patch-include_VBox_vmm_gvm.h
new file mode 100644
index 0000000..6a22459
--- /dev/null
+++ b/virtualbox/patches/patch-include_VBox_vmm_gvm.h
@@ -0,0 +1,18 @@
+$NetBSD$
+
+--- include/VBox/vmm/gvm.h.orig 2016-03-04 19:22:58.000000000 +0000
++++ include/VBox/vmm/gvm.h
+@@ -80,7 +80,7 @@ typedef struct GVM
+ /** The global VM handle for this VM. */
+ uint32_t hSelf;
+ /** The ring-0 mapping of the VM structure. */
+- PVM pVM;
++ vbox_PVM pVM;
+ /** Number of Virtual CPUs, i.e. how many entries there are in aCpus.
+ * Same same as VM::cCpus. */
+ uint32_t cCpus;
+@@ -124,4 +124,3 @@ typedef struct GVM
+ /** @} */
+
+ #endif
+-
diff --git a/virtualbox/patches/patch-include_VBox_vmm_gvmm.h b/virtualbox/patches/patch-include_VBox_vmm_gvmm.h
new file mode 100644
index 0000000..4351f5f
--- /dev/null
+++ b/virtualbox/patches/patch-include_VBox_vmm_gvmm.h
@@ -0,0 +1,84 @@
+$NetBSD$
+
+--- include/VBox/vmm/gvmm.h.orig 2016-03-04 19:22:58.000000000 +0000
++++ include/VBox/vmm/gvmm.h
+@@ -158,27 +158,27 @@ GVMMR0DECL(void) GVMMR0Term(void);
+ GVMMR0DECL(int) GVMMR0SetConfig(PSUPDRVSESSION pSession, const char *pszName, uint64_t u64Value);
+ GVMMR0DECL(int) GVMMR0QueryConfig(PSUPDRVSESSION pSession, const char *pszName, uint64_t *pu64Value);
+
+-GVMMR0DECL(int) GVMMR0CreateVM(PSUPDRVSESSION pSession, uint32_t cCpus, PVM *ppVM);
+-GVMMR0DECL(int) GVMMR0InitVM(PVM pVM);
+-GVMMR0DECL(void) GVMMR0DoneInitVM(PVM pVM);
+-GVMMR0DECL(bool) GVMMR0DoingTermVM(PVM pVM, PGVM pGVM);
+-GVMMR0DECL(int) GVMMR0DestroyVM(PVM pVM);
+-GVMMR0DECL(int) GVMMR0RegisterVCpu(PVM pVM, VMCPUID idCpu);
++GVMMR0DECL(int) GVMMR0CreateVM(PSUPDRVSESSION pSession, uint32_t cCpus, vbox_PVM *ppVM);
++GVMMR0DECL(int) GVMMR0InitVM(vbox_PVM pVM);
++GVMMR0DECL(void) GVMMR0DoneInitVM(vbox_PVM pVM);
++GVMMR0DECL(bool) GVMMR0DoingTermVM(vbox_PVM pVM, PGVM pGVM);
++GVMMR0DECL(int) GVMMR0DestroyVM(vbox_PVM pVM);
++GVMMR0DECL(int) GVMMR0RegisterVCpu(vbox_PVM pVM, VMCPUID idCpu);
+ GVMMR0DECL(PGVM) GVMMR0ByHandle(uint32_t hGVM);
+-GVMMR0DECL(int) GVMMR0ByVM(PVM pVM, PGVM *ppGVM);
+-GVMMR0DECL(int) GVMMR0ByVMAndEMT(PVM pVM, VMCPUID idCpu, PGVM *ppGVM);
+-GVMMR0DECL(PVM) GVMMR0GetVMByHandle(uint32_t hGVM);
+-GVMMR0DECL(PVM) GVMMR0GetVMByEMT(RTNATIVETHREAD hEMT);
+-GVMMR0DECL(int) GVMMR0SchedHalt(PVM pVM, VMCPUID idCpu, uint64_t u64ExpireGipTime);
+-GVMMR0DECL(int) GVMMR0SchedWakeUp(PVM pVM, VMCPUID idCpu);
+-GVMMR0DECL(int) GVMMR0SchedWakeUpEx(PVM pVM, VMCPUID idCpu, bool fTakeUsedLock);
+-GVMMR0DECL(int) GVMMR0SchedPoke(PVM pVM, VMCPUID idCpu);
+-GVMMR0DECL(int) GVMMR0SchedPokeEx(PVM pVM, VMCPUID idCpu, bool fTakeUsedLock);
+-GVMMR0DECL(int) GVMMR0SchedWakeUpAndPokeCpus(PVM pVM, PCVMCPUSET pSleepSet, PCVMCPUSET pPokeSet);
+-GVMMR0DECL(int) GVMMR0SchedPoll(PVM pVM, VMCPUID idCpu, bool fYield);
+-GVMMR0DECL(void) GVMMR0SchedUpdatePeriodicPreemptionTimer(PVM pVM, RTCPUID idHostCpu, uint32_t uHz);
+-GVMMR0DECL(int) GVMMR0QueryStatistics(PGVMMSTATS pStats, PSUPDRVSESSION pSession, PVM pVM);
+-GVMMR0DECL(int) GVMMR0ResetStatistics(PCGVMMSTATS pStats, PSUPDRVSESSION pSession, PVM pVM);
++GVMMR0DECL(int) GVMMR0ByVM(vbox_PVM pVM, PGVM *ppGVM);
++GVMMR0DECL(int) GVMMR0ByVMAndEMT(vbox_PVM pVM, VMCPUID idCpu, PGVM *ppGVM);
++GVMMR0DECL(vbox_PVM) GVMMR0GetVMByHandle(uint32_t hGVM);
++GVMMR0DECL(vbox_PVM) GVMMR0GetVMByEMT(RTNATIVETHREAD hEMT);
++GVMMR0DECL(int) GVMMR0SchedHalt(vbox_PVM pVM, VMCPUID idCpu, uint64_t u64ExpireGipTime);
++GVMMR0DECL(int) GVMMR0SchedWakeUp(vbox_PVM pVM, VMCPUID idCpu);
++GVMMR0DECL(int) GVMMR0SchedWakeUpEx(vbox_PVM pVM, VMCPUID idCpu, bool fTakeUsedLock);
++GVMMR0DECL(int) GVMMR0SchedPoke(vbox_PVM pVM, VMCPUID idCpu);
++GVMMR0DECL(int) GVMMR0SchedPokeEx(vbox_PVM pVM, VMCPUID idCpu, bool fTakeUsedLock);
++GVMMR0DECL(int) GVMMR0SchedWakeUpAndPokeCpus(vbox_PVM pVM, PCVMCPUSET pSleepSet, PCVMCPUSET pPokeSet);
++GVMMR0DECL(int) GVMMR0SchedPoll(vbox_PVM pVM, VMCPUID idCpu, bool fYield);
++GVMMR0DECL(void) GVMMR0SchedUpdatePeriodicPreemptionTimer(vbox_PVM pVM, RTCPUID idHostCpu, uint32_t uHz);
++GVMMR0DECL(int) GVMMR0QueryStatistics(PGVMMSTATS pStats, PSUPDRVSESSION pSession, vbox_PVM pVM);
++GVMMR0DECL(int) GVMMR0ResetStatistics(PCGVMMSTATS pStats, PSUPDRVSESSION pSession, vbox_PVM pVM);
+
+
+ /**
+@@ -219,7 +219,7 @@ typedef struct GVMMSCHEDWAKEUPANDPOKECPU
+ /** Pointer to a GVMMR0QueryStatisticsReq / VMMR0_DO_GVMM_QUERY_STATISTICS request buffer. */
+ typedef GVMMSCHEDWAKEUPANDPOKECPUSREQ *PGVMMSCHEDWAKEUPANDPOKECPUSREQ;
+
+-GVMMR0DECL(int) GVMMR0SchedWakeUpAndPokeCpusReq(PVM pVM, PGVMMSCHEDWAKEUPANDPOKECPUSREQ pReq);
++GVMMR0DECL(int) GVMMR0SchedWakeUpAndPokeCpusReq(vbox_PVM pVM, PGVMMSCHEDWAKEUPANDPOKECPUSREQ pReq);
+
+
+ /**
+@@ -238,7 +238,7 @@ typedef struct GVMMQUERYSTATISTICSSREQ
+ /** Pointer to a GVMMR0QueryStatisticsReq / VMMR0_DO_GVMM_QUERY_STATISTICS request buffer. */
+ typedef GVMMQUERYSTATISTICSSREQ *PGVMMQUERYSTATISTICSSREQ;
+
+-GVMMR0DECL(int) GVMMR0QueryStatisticsReq(PVM pVM, PGVMMQUERYSTATISTICSSREQ pReq);
++GVMMR0DECL(int) GVMMR0QueryStatisticsReq(vbox_PVM pVM, PGVMMQUERYSTATISTICSSREQ pReq);
+
+
+ /**
+@@ -258,7 +258,7 @@ typedef struct GVMMRESETSTATISTICSSREQ
+ /** Pointer to a GVMMR0ResetStatisticsReq / VMMR0_DO_GVMM_RESET_STATISTICS request buffer. */
+ typedef GVMMRESETSTATISTICSSREQ *PGVMMRESETSTATISTICSSREQ;
+
+-GVMMR0DECL(int) GVMMR0ResetStatisticsReq(PVM pVM, PGVMMRESETSTATISTICSSREQ pReq);
++GVMMR0DECL(int) GVMMR0ResetStatisticsReq(vbox_PVM pVM, PGVMMRESETSTATISTICSSREQ pReq);
+
+
+ /** @} */
+@@ -266,4 +266,3 @@ GVMMR0DECL(int) GVMMR0ResetStatistic
+ RT_C_DECLS_END
+
+ #endif
+-
diff --git a/virtualbox/patches/patch-include_VBox_vmm_iom.h b/virtualbox/patches/patch-include_VBox_vmm_iom.h
new file mode 100644
index 0000000..a4fe006
--- /dev/null
+++ b/virtualbox/patches/patch-include_VBox_vmm_iom.h
@@ -0,0 +1,104 @@
+$NetBSD$
+
+--- include/VBox/vmm/iom.h.orig 2016-03-04 19:22:58.000000000 +0000
++++ include/VBox/vmm/iom.h
+@@ -273,28 +273,28 @@ typedef DECLCALLBACK(int) FNIOMMMIOFILL(
+ /** Pointer to a FNIOMMMIOFILL(). */
+ typedef FNIOMMMIOFILL *PFNIOMMMIOFILL;
+
+-VMMDECL(VBOXSTRICTRC) IOMIOPortRead(PVM pVM, PVMCPU pVCpu, RTIOPORT Port, uint32_t *pu32Value, size_t cbValue);
+-VMMDECL(VBOXSTRICTRC) IOMIOPortWrite(PVM pVM, PVMCPU pVCpu, RTIOPORT Port, uint32_t u32Value, size_t cbValue);
+-VMM_INT_DECL(VBOXSTRICTRC) IOMIOPortReadString(PVM pVM, PVMCPU pVCpu, RTIOPORT Port, void *pvDst,
++VMMDECL(VBOXSTRICTRC) IOMIOPortRead(vbox_PVM pVM, PVMCPU pVCpu, RTIOPORT Port, uint32_t *pu32Value, size_t cbValue);
++VMMDECL(VBOXSTRICTRC) IOMIOPortWrite(vbox_PVM pVM, PVMCPU pVCpu, RTIOPORT Port, uint32_t u32Value, size_t cbValue);
++VMM_INT_DECL(VBOXSTRICTRC) IOMIOPortReadString(vbox_PVM pVM, PVMCPU pVCpu, RTIOPORT Port, void *pvDst,
+ uint32_t *pcTransfers, unsigned cb);
+-VMM_INT_DECL(VBOXSTRICTRC) IOMIOPortWriteString(PVM pVM, PVMCPU pVCpu, RTIOPORT uPort, void const *pvSrc,
++VMM_INT_DECL(VBOXSTRICTRC) IOMIOPortWriteString(vbox_PVM pVM, PVMCPU pVCpu, RTIOPORT uPort, void const *pvSrc,
+ uint32_t *pcTransfers, unsigned cb);
+-VMMDECL(VBOXSTRICTRC) IOMInterpretINSEx(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, uint32_t uPort, uint32_t uPrefix, DISCPUMODE enmAddrMode, uint32_t cbTransfer);
+-VMMDECL(VBOXSTRICTRC) IOMInterpretOUTSEx(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, uint32_t uPort, uint32_t uPrefix, DISCPUMODE enmAddrMode, uint32_t cbTransfer);
+-VMMDECL(VBOXSTRICTRC) IOMMMIORead(PVM pVM, PVMCPU pVCpu, RTGCPHYS GCPhys, uint32_t *pu32Value, size_t cbValue);
+-VMMDECL(VBOXSTRICTRC) IOMMMIOWrite(PVM pVM, PVMCPU pVCpu, RTGCPHYS GCPhys, uint32_t u32Value, size_t cbValue);
+-VMMDECL(VBOXSTRICTRC) IOMMMIOPhysHandler(PVM pVM, PVMCPU pVCpu, RTGCUINT uErrorCode, PCPUMCTXCORE pCtxCore, RTGCPHYS GCPhysFault);
+-VMMDECL(VBOXSTRICTRC) IOMInterpretCheckPortIOAccess(PVM pVM, PCPUMCTXCORE pCtxCore, RTIOPORT Port, unsigned cb);
+-VMMDECL(int) IOMMMIOMapMMIO2Page(PVM pVM, RTGCPHYS GCPhys, RTGCPHYS GCPhysRemapped, uint64_t fPageFlags);
+-VMMDECL(int) IOMMMIOMapMMIOHCPage(PVM pVM, PVMCPU pVCpu, RTGCPHYS GCPhys, RTHCPHYS HCPhys, uint64_t fPageFlags);
+-VMMDECL(int) IOMMMIOResetRegion(PVM pVM, RTGCPHYS GCPhys);
+-VMMDECL(bool) IOMIsLockWriteOwner(PVM pVM);
++VMMDECL(VBOXSTRICTRC) IOMInterpretINSEx(vbox_PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, uint32_t uPort, uint32_t uPrefix, DISCPUMODE enmAddrMode, uint32_t cbTransfer);
++VMMDECL(VBOXSTRICTRC) IOMInterpretOUTSEx(vbox_PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, uint32_t uPort, uint32_t uPrefix, DISCPUMODE enmAddrMode, uint32_t cbTransfer);
++VMMDECL(VBOXSTRICTRC) IOMMMIORead(vbox_PVM pVM, PVMCPU pVCpu, RTGCPHYS GCPhys, uint32_t *pu32Value, size_t cbValue);
++VMMDECL(VBOXSTRICTRC) IOMMMIOWrite(vbox_PVM pVM, PVMCPU pVCpu, RTGCPHYS GCPhys, uint32_t u32Value, size_t cbValue);
++VMMDECL(VBOXSTRICTRC) IOMMMIOPhysHandler(vbox_PVM pVM, PVMCPU pVCpu, RTGCUINT uErrorCode, PCPUMCTXCORE pCtxCore, RTGCPHYS GCPhysFault);
++VMMDECL(VBOXSTRICTRC) IOMInterpretCheckPortIOAccess(vbox_PVM pVM, PCPUMCTXCORE pCtxCore, RTIOPORT Port, unsigned cb);
++VMMDECL(int) IOMMMIOMapMMIO2Page(vbox_PVM pVM, RTGCPHYS GCPhys, RTGCPHYS GCPhysRemapped, uint64_t fPageFlags);
++VMMDECL(int) IOMMMIOMapMMIOHCPage(vbox_PVM pVM, PVMCPU pVCpu, RTGCPHYS GCPhys, RTHCPHYS HCPhys, uint64_t fPageFlags);
++VMMDECL(int) IOMMMIOResetRegion(vbox_PVM pVM, RTGCPHYS GCPhys);
++VMMDECL(bool) IOMIsLockWriteOwner(vbox_PVM pVM);
+
+ #ifdef IN_RC
+ /** @defgroup grp_iom_rc The IOM Raw-Mode Context API
+ * @{
+ */
+-VMMRCDECL(VBOXSTRICTRC) IOMRCIOPortHandler(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, PDISCPUSTATE pCpu);
++VMMRCDECL(VBOXSTRICTRC) IOMRCIOPortHandler(vbox_PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, PDISCPUSTATE pCpu);
+ /** @} */
+ #endif /* IN_RC */
+
+@@ -304,38 +304,38 @@ VMMRCDECL(VBOXSTRICTRC) IOMRCIOPortHandl
+ /** @defgroup grp_iom_r3 The IOM Host Context Ring-3 API
+ * @{
+ */
+-VMMR3_INT_DECL(int) IOMR3Init(PVM pVM);
+-VMMR3_INT_DECL(void) IOMR3Reset(PVM pVM);
+-VMMR3_INT_DECL(void) IOMR3Relocate(PVM pVM, RTGCINTPTR offDelta);
+-VMMR3_INT_DECL(int) IOMR3Term(PVM pVM);
+-VMMR3_INT_DECL(int) IOMR3IOPortRegisterR3(PVM pVM, PPDMDEVINS pDevIns, RTIOPORT PortStart, RTUINT cPorts, RTHCPTR pvUser,
++VMMR3_INT_DECL(int) IOMR3Init(vbox_PVM pVM);
++VMMR3_INT_DECL(void) IOMR3Reset(vbox_PVM pVM);
++VMMR3_INT_DECL(void) IOMR3Relocate(vbox_PVM pVM, RTGCINTPTR offDelta);
++VMMR3_INT_DECL(int) IOMR3Term(vbox_PVM pVM);
++VMMR3_INT_DECL(int) IOMR3IOPortRegisterR3(vbox_PVM pVM, PPDMDEVINS pDevIns, RTIOPORT PortStart, RTUINT cPorts, RTHCPTR pvUser,
+ R3PTRTYPE(PFNIOMIOPORTOUT) pfnOutCallback, R3PTRTYPE(PFNIOMIOPORTIN) pfnInCallback,
+ R3PTRTYPE(PFNIOMIOPORTOUTSTRING) pfnOutStringCallback, R3PTRTYPE(PFNIOMIOPORTINSTRING) pfnInStringCallback,
+ const char *pszDesc);
+-VMMR3_INT_DECL(int) IOMR3IOPortRegisterRC(PVM pVM, PPDMDEVINS pDevIns, RTIOPORT PortStart, RTUINT cPorts, RTRCPTR pvUser,
++VMMR3_INT_DECL(int) IOMR3IOPortRegisterRC(vbox_PVM pVM, PPDMDEVINS pDevIns, RTIOPORT PortStart, RTUINT cPorts, RTRCPTR pvUser,
+ RCPTRTYPE(PFNIOMIOPORTOUT) pfnOutCallback, RCPTRTYPE(PFNIOMIOPORTIN) pfnInCallback,
+ RCPTRTYPE(PFNIOMIOPORTOUTSTRING) pfnOutStrCallback, RCPTRTYPE(PFNIOMIOPORTINSTRING) pfnInStrCallback,
+ const char *pszDesc);
+-VMMR3_INT_DECL(int) IOMR3IOPortRegisterR0(PVM pVM, PPDMDEVINS pDevIns, RTIOPORT PortStart, RTUINT cPorts, RTR0PTR pvUser,
++VMMR3_INT_DECL(int) IOMR3IOPortRegisterR0(vbox_PVM pVM, PPDMDEVINS pDevIns, RTIOPORT PortStart, RTUINT cPorts, RTR0PTR pvUser,
+ R0PTRTYPE(PFNIOMIOPORTOUT) pfnOutCallback, R0PTRTYPE(PFNIOMIOPORTIN) pfnInCallback,
+ R0PTRTYPE(PFNIOMIOPORTOUTSTRING) pfnOutStrCallback, R0PTRTYPE(PFNIOMIOPORTINSTRING) pfnInStrCallback,
+ const char *pszDesc);
+-VMMR3_INT_DECL(int) IOMR3IOPortDeregister(PVM pVM, PPDMDEVINS pDevIns, RTIOPORT PortStart, RTUINT cPorts);
++VMMR3_INT_DECL(int) IOMR3IOPortDeregister(vbox_PVM pVM, PPDMDEVINS pDevIns, RTIOPORT PortStart, RTUINT cPorts);
+
+-VMMR3_INT_DECL(int) IOMR3MmioRegisterR3(PVM pVM, PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, uint32_t cbRange, RTHCPTR pvUser,
++VMMR3_INT_DECL(int) IOMR3MmioRegisterR3(vbox_PVM pVM, PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, uint32_t cbRange, RTHCPTR pvUser,
+ R3PTRTYPE(PFNIOMMMIOWRITE) pfnWriteCallback,
+ R3PTRTYPE(PFNIOMMMIOREAD) pfnReadCallback,
+ R3PTRTYPE(PFNIOMMMIOFILL) pfnFillCallback,
+ uint32_t fFlags, const char *pszDesc);
+-VMMR3_INT_DECL(int) IOMR3MmioRegisterR0(PVM pVM, PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, uint32_t cbRange, RTR0PTR pvUser,
++VMMR3_INT_DECL(int) IOMR3MmioRegisterR0(vbox_PVM pVM, PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, uint32_t cbRange, RTR0PTR pvUser,
+ R0PTRTYPE(PFNIOMMMIOWRITE) pfnWriteCallback,
+ R0PTRTYPE(PFNIOMMMIOREAD) pfnReadCallback,
+ R0PTRTYPE(PFNIOMMMIOFILL) pfnFillCallback);
+-VMMR3_INT_DECL(int) IOMR3MmioRegisterRC(PVM pVM, PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, uint32_t cbRange, RTGCPTR pvUser,
++VMMR3_INT_DECL(int) IOMR3MmioRegisterRC(vbox_PVM pVM, PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, uint32_t cbRange, RTGCPTR pvUser,
+ RCPTRTYPE(PFNIOMMMIOWRITE) pfnWriteCallback,
+ RCPTRTYPE(PFNIOMMMIOREAD) pfnReadCallback,
+ RCPTRTYPE(PFNIOMMMIOFILL) pfnFillCallback);
+-VMMR3_INT_DECL(int) IOMR3MmioDeregister(PVM pVM, PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, uint32_t cbRange);
++VMMR3_INT_DECL(int) IOMR3MmioDeregister(vbox_PVM pVM, PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, uint32_t cbRange);
+
+ /** @} */
+ #endif /* IN_RING3 */
+@@ -346,4 +346,3 @@ VMMR3_INT_DECL(int) IOMR3MmioDeregister
+ RT_C_DECLS_END
+
+ #endif
+-
diff --git a/virtualbox/patches/patch-include_VBox_vmm_mm.h b/virtualbox/patches/patch-include_VBox_vmm_mm.h
new file mode 100644
index 0000000..789a468
--- /dev/null
+++ b/virtualbox/patches/patch-include_VBox_vmm_mm.h
@@ -0,0 +1,290 @@
+$NetBSD$
+
+--- include/VBox/vmm/mm.h.orig 2016-03-04 19:22:58.000000000 +0000
++++ include/VBox/vmm/mm.h
+@@ -145,20 +145,20 @@ typedef enum MMTAG
+ /** @defgroup grp_mm_hyper Hypervisor Memory Management
+ * @{ */
+
+-VMMDECL(RTR3PTR) MMHyperR0ToR3(PVM pVM, RTR0PTR R0Ptr);
+-VMMDECL(RTRCPTR) MMHyperR0ToRC(PVM pVM, RTR0PTR R0Ptr);
++VMMDECL(RTR3PTR) MMHyperR0ToR3(vbox_PVM pVM, RTR0PTR R0Ptr);
++VMMDECL(RTRCPTR) MMHyperR0ToRC(vbox_PVM pVM, RTR0PTR R0Ptr);
+ #ifndef IN_RING0
+-VMMDECL(void *) MMHyperR0ToCC(PVM pVM, RTR0PTR R0Ptr);
++VMMDECL(void *) MMHyperR0ToCC(vbox_PVM pVM, RTR0PTR R0Ptr);
+ #endif
+-VMMDECL(RTR0PTR) MMHyperR3ToR0(PVM pVM, RTR3PTR R3Ptr);
+-VMMDECL(RTRCPTR) MMHyperR3ToRC(PVM pVM, RTR3PTR R3Ptr);
+-VMMDECL(RTR3PTR) MMHyperRCToR3(PVM pVM, RTRCPTR RCPtr);
+-VMMDECL(RTR0PTR) MMHyperRCToR0(PVM pVM, RTRCPTR RCPtr);
++VMMDECL(RTR0PTR) MMHyperR3ToR0(vbox_PVM pVM, RTR3PTR R3Ptr);
++VMMDECL(RTRCPTR) MMHyperR3ToRC(vbox_PVM pVM, RTR3PTR R3Ptr);
++VMMDECL(RTR3PTR) MMHyperRCToR3(vbox_PVM pVM, RTRCPTR RCPtr);
++VMMDECL(RTR0PTR) MMHyperRCToR0(vbox_PVM pVM, RTRCPTR RCPtr);
+
+ #ifndef IN_RING3
+-VMMDECL(void *) MMHyperR3ToCC(PVM pVM, RTR3PTR R3Ptr);
++VMMDECL(void *) MMHyperR3ToCC(vbox_PVM pVM, RTR3PTR R3Ptr);
+ #else
+-DECLINLINE(void *) MMHyperR3ToCC(PVM pVM, RTR3PTR R3Ptr)
++DECLINLINE(void *) MMHyperR3ToCC(vbox_PVM pVM, RTR3PTR R3Ptr)
+ {
+ NOREF(pVM);
+ return R3Ptr;
+@@ -167,9 +167,9 @@ DECLINLINE(void *) MMHyperR3ToCC(PVM pV
+
+
+ #ifndef IN_RC
+-VMMDECL(void *) MMHyperRCToCC(PVM pVM, RTRCPTR RCPtr);
++VMMDECL(void *) MMHyperRCToCC(vbox_PVM pVM, RTRCPTR RCPtr);
+ #else
+-DECLINLINE(void *) MMHyperRCToCC(PVM pVM, RTRCPTR RCPtr)
++DECLINLINE(void *) MMHyperRCToCC(vbox_PVM pVM, RTRCPTR RCPtr)
+ {
+ NOREF(pVM);
+ return (void *)RCPtr;
+@@ -177,9 +177,9 @@ DECLINLINE(void *) MMHyperRCToCC(PVM pV
+ #endif
+
+ #ifndef IN_RING3
+-VMMDECL(RTR3PTR) MMHyperCCToR3(PVM pVM, void *pv);
++VMMDECL(RTR3PTR) MMHyperCCToR3(vbox_PVM pVM, void *pv);
+ #else
+-DECLINLINE(RTR3PTR) MMHyperCCToR3(PVM pVM, void *pv)
++DECLINLINE(RTR3PTR) MMHyperCCToR3(vbox_PVM pVM, void *pv)
+ {
+ NOREF(pVM);
+ return pv;
+@@ -187,9 +187,9 @@ DECLINLINE(RTR3PTR) MMHyperCCToR3(PVM pV
+ #endif
+
+ #ifndef IN_RING0
+-VMMDECL(RTR0PTR) MMHyperCCToR0(PVM pVM, void *pv);
++VMMDECL(RTR0PTR) MMHyperCCToR0(vbox_PVM pVM, void *pv);
+ #else
+-DECLINLINE(RTR0PTR) MMHyperCCToR0(PVM pVM, void *pv)
++DECLINLINE(RTR0PTR) MMHyperCCToR0(vbox_PVM pVM, void *pv)
+ {
+ NOREF(pVM);
+ return pv;
+@@ -197,9 +197,9 @@ DECLINLINE(RTR0PTR) MMHyperCCToR0(PVM pV
+ #endif
+
+ #ifndef IN_RC
+-VMMDECL(RTRCPTR) MMHyperCCToRC(PVM pVM, void *pv);
++VMMDECL(RTRCPTR) MMHyperCCToRC(vbox_PVM pVM, void *pv);
+ #else
+-DECLINLINE(RTRCPTR) MMHyperCCToRC(PVM pVM, void *pv)
++DECLINLINE(RTRCPTR) MMHyperCCToRC(vbox_PVM pVM, void *pv)
+ {
+ NOREF(pVM);
+ return (RTRCPTR)pv;
+@@ -207,26 +207,26 @@ DECLINLINE(RTRCPTR) MMHyperCCToRC(PVM pV
+ #endif
+
+
+-VMMDECL(int) MMHyperAlloc(PVM pVM, size_t cb, uint32_t uAlignment, MMTAG enmTag, void **ppv);
+-VMMDECL(int) MMHyperDupMem(PVM pVM, const void *pvSrc, size_t cb, unsigned uAlignment, MMTAG enmTag, void **ppv);
+-VMMDECL(int) MMHyperFree(PVM pVM, void *pv);
+-VMMDECL(void) MMHyperHeapCheck(PVM pVM);
+-VMMDECL(int) MMR3LockCall(PVM pVM);
++VMMDECL(int) MMHyperAlloc(vbox_PVM pVM, size_t cb, uint32_t uAlignment, MMTAG enmTag, void **ppv);
++VMMDECL(int) MMHyperDupMem(vbox_PVM pVM, const void *pvSrc, size_t cb, unsigned uAlignment, MMTAG enmTag, void **ppv);
++VMMDECL(int) MMHyperFree(vbox_PVM pVM, void *pv);
++VMMDECL(void) MMHyperHeapCheck(vbox_PVM pVM);
++VMMDECL(int) MMR3LockCall(vbox_PVM pVM);
+ #ifdef DEBUG
+-VMMDECL(void) MMHyperHeapDump(PVM pVM);
++VMMDECL(void) MMHyperHeapDump(vbox_PVM pVM);
+ #endif
+-VMMDECL(size_t) MMHyperHeapGetFreeSize(PVM pVM);
+-VMMDECL(size_t) MMHyperHeapGetSize(PVM pVM);
+-VMMDECL(void *) MMHyperHeapOffsetToPtr(PVM pVM, uint32_t offHeap);
+-VMMDECL(uint32_t) MMHyperHeapPtrToOffset(PVM pVM, void *pv);
+-VMMDECL(RTGCPTR) MMHyperGetArea(PVM pVM, size_t *pcb);
+-VMMDECL(bool) MMHyperIsInsideArea(PVM pVM, RTGCPTR GCPtr);
++VMMDECL(size_t) MMHyperHeapGetFreeSize(vbox_PVM pVM);
++VMMDECL(size_t) MMHyperHeapGetSize(vbox_PVM pVM);
++VMMDECL(void *) MMHyperHeapOffsetToPtr(vbox_PVM pVM, uint32_t offHeap);
++VMMDECL(uint32_t) MMHyperHeapPtrToOffset(vbox_PVM pVM, void *pv);
++VMMDECL(RTGCPTR) MMHyperGetArea(vbox_PVM pVM, size_t *pcb);
++VMMDECL(bool) MMHyperIsInsideArea(vbox_PVM pVM, RTGCPTR GCPtr);
+
+
+-VMMDECL(RTHCPHYS) MMPage2Phys(PVM pVM, void *pvPage);
+-VMMDECL(void *) MMPagePhys2Page(PVM pVM, RTHCPHYS HCPhysPage);
+-VMMDECL(int) MMPagePhys2PageEx(PVM pVM, RTHCPHYS HCPhysPage, void **ppvPage);
+-VMMDECL(int) MMPagePhys2PageTry(PVM pVM, RTHCPHYS HCPhysPage, void **ppvPage);
++VMMDECL(RTHCPHYS) MMPage2Phys(vbox_PVM pVM, void *pvPage);
++VMMDECL(void *) MMPagePhys2Page(vbox_PVM pVM, RTHCPHYS HCPhysPage);
++VMMDECL(int) MMPagePhys2PageEx(vbox_PVM pVM, RTHCPHYS HCPhysPage, void **ppvPage);
++VMMDECL(int) MMPagePhys2PageTry(vbox_PVM pVM, RTHCPHYS HCPhysPage, void **ppvPage);
+
+
+ /** @def MMHYPER_RC_ASSERT_RCPTR
+@@ -249,81 +249,81 @@ VMMDECL(int) MMPagePhys2PageTry(P
+ */
+
+ VMMR3DECL(int) MMR3InitUVM(PUVM pUVM);
+-VMMR3DECL(int) MMR3Init(PVM pVM);
+-VMMR3DECL(int) MMR3InitPaging(PVM pVM);
+-VMMR3DECL(int) MMR3HyperInitFinalize(PVM pVM);
+-VMMR3DECL(int) MMR3Term(PVM pVM);
++VMMR3DECL(int) MMR3Init(vbox_PVM pVM);
++VMMR3DECL(int) MMR3InitPaging(vbox_PVM pVM);
++VMMR3DECL(int) MMR3HyperInitFinalize(vbox_PVM pVM);
++VMMR3DECL(int) MMR3Term(vbox_PVM pVM);
+ VMMR3DECL(void) MMR3TermUVM(PUVM pUVM);
+-VMMR3_INT_DECL(bool) MMR3IsInitialized(PVM pVM);
+-VMMR3DECL(int) MMR3ReserveHandyPages(PVM pVM, uint32_t cHandyPages);
+-VMMR3DECL(int) MMR3IncreaseBaseReservation(PVM pVM, uint64_t cAddBasePages);
+-VMMR3DECL(int) MMR3AdjustFixedReservation(PVM pVM, int32_t cDeltaFixedPages, const char *pszDesc);
+-VMMR3DECL(int) MMR3UpdateShadowReservation(PVM pVM, uint32_t cShadowPages);
++VMMR3_INT_DECL(bool) MMR3IsInitialized(vbox_PVM pVM);
++VMMR3DECL(int) MMR3ReserveHandyPages(vbox_PVM pVM, uint32_t cHandyPages);
++VMMR3DECL(int) MMR3IncreaseBaseReservation(vbox_PVM pVM, uint64_t cAddBasePages);
++VMMR3DECL(int) MMR3AdjustFixedReservation(vbox_PVM pVM, int32_t cDeltaFixedPages, const char *pszDesc);
++VMMR3DECL(int) MMR3UpdateShadowReservation(vbox_PVM pVM, uint32_t cShadowPages);
+
+-VMMR3DECL(int) MMR3HCPhys2HCVirt(PVM pVM, RTHCPHYS HCPhys, void **ppv);
++VMMR3DECL(int) MMR3HCPhys2HCVirt(vbox_PVM pVM, RTHCPHYS HCPhys, void **ppv);
+
+ /** @defgroup grp_mm_r3_hyper Hypervisor Memory Manager (HC R3 Portion)
+ * @{ */
+-VMMR3DECL(int) MMR3HyperAllocOnceNoRel(PVM pVM, size_t cb, uint32_t uAlignment, MMTAG enmTag, void **ppv);
+-VMMR3DECL(int) MMR3HyperAllocOnceNoRelEx(PVM pVM, size_t cb, uint32_t uAlignment, MMTAG enmTag, uint32_t fFlags, void **ppv);
+-VMMR3DECL(int) MMR3HyperRealloc(PVM pVM, void *pv, size_t cb, unsigned uAlignmentNew, MMTAG enmTagNew, size_t cbNew, void **ppv);
++VMMR3DECL(int) MMR3HyperAllocOnceNoRel(vbox_PVM pVM, size_t cb, uint32_t uAlignment, MMTAG enmTag, void **ppv);
++VMMR3DECL(int) MMR3HyperAllocOnceNoRelEx(vbox_PVM pVM, size_t cb, uint32_t uAlignment, MMTAG enmTag, uint32_t fFlags, void **ppv);
++VMMR3DECL(int) MMR3HyperRealloc(vbox_PVM pVM, void *pv, size_t cb, unsigned uAlignmentNew, MMTAG enmTagNew, size_t cbNew, void **ppv);
+ /** @name MMR3HyperAllocOnceNoRelEx flags
+ * @{ */
+ /** Must have kernel mapping.
+ * If not specified, the R0 pointer may point to the user process mapping. */
+ #define MMHYPER_AONR_FLAGS_KERNEL_MAPPING RT_BIT(0)
+ /** @} */
+-VMMR3DECL(int) MMR3HyperSetGuard(PVM pVM, void *pvStart, size_t cb, bool fSet);
+-VMMR3DECL(int) MMR3HyperMapHCPhys(PVM pVM, void *pvR3, RTR0PTR pvR0, RTHCPHYS HCPhys, size_t cb, const char *pszDesc, PRTGCPTR pGCPtr);
+-VMMR3DECL(int) MMR3HyperMapGCPhys(PVM pVM, RTGCPHYS GCPhys, size_t cb, const char *pszDesc, PRTGCPTR pGCPtr);
+-VMMR3DECL(int) MMR3HyperMapMMIO2(PVM pVM, PPDMDEVINS pDevIns, uint32_t iRegion, RTGCPHYS off, RTGCPHYS cb, const char *pszDesc, PRTRCPTR pRCPtr);
+-VMMR3DECL(int) MMR3HyperMapPages(PVM pVM, void *pvR3, RTR0PTR pvR0, size_t cPages, PCSUPPAGE paPages, const char *pszDesc, PRTGCPTR pGCPtr);
+-VMMR3DECL(int) MMR3HyperReserve(PVM pVM, unsigned cb, const char *pszDesc, PRTGCPTR pGCPtr);
+-VMMR3DECL(RTHCPHYS) MMR3HyperHCVirt2HCPhys(PVM pVM, void *pvHC);
+-VMMR3DECL(int) MMR3HyperHCVirt2HCPhysEx(PVM pVM, void *pvHC, PRTHCPHYS pHCPhys);
+-VMMR3DECL(void *) MMR3HyperHCPhys2HCVirt(PVM pVM, RTHCPHYS HCPhys);
+-VMMR3DECL(int) MMR3HyperHCPhys2HCVirtEx(PVM pVM, RTHCPHYS HCPhys, void **ppv);
+-VMMR3_INT_DECL(int) MMR3HyperQueryInfoFromHCPhys(PVM pVM, RTHCPHYS HCPhys, char *pszWhat, size_t cbWhat, uint32_t *pcbAlloc);
+-VMMR3DECL(int) MMR3HyperReadGCVirt(PVM pVM, void *pvDst, RTGCPTR GCPtr, size_t cb);
++VMMR3DECL(int) MMR3HyperSetGuard(vbox_PVM pVM, void *pvStart, size_t cb, bool fSet);
++VMMR3DECL(int) MMR3HyperMapHCPhys(vbox_PVM pVM, void *pvR3, RTR0PTR pvR0, RTHCPHYS HCPhys, size_t cb, const char *pszDesc, PRTGCPTR pGCPtr);
++VMMR3DECL(int) MMR3HyperMapGCPhys(vbox_PVM pVM, RTGCPHYS GCPhys, size_t cb, const char *pszDesc, PRTGCPTR pGCPtr);
++VMMR3DECL(int) MMR3HyperMapMMIO2(vbox_PVM pVM, PPDMDEVINS pDevIns, uint32_t iRegion, RTGCPHYS off, RTGCPHYS cb, const char *pszDesc, PRTRCPTR pRCPtr);
++VMMR3DECL(int) MMR3HyperMapPages(vbox_PVM pVM, void *pvR3, RTR0PTR pvR0, size_t cPages, PCSUPPAGE paPages, const char *pszDesc, PRTGCPTR pGCPtr);
++VMMR3DECL(int) MMR3HyperReserve(vbox_PVM pVM, unsigned cb, const char *pszDesc, PRTGCPTR pGCPtr);
++VMMR3DECL(RTHCPHYS) MMR3HyperHCVirt2HCPhys(vbox_PVM pVM, void *pvHC);
++VMMR3DECL(int) MMR3HyperHCVirt2HCPhysEx(vbox_PVM pVM, void *pvHC, PRTHCPHYS pHCPhys);
++VMMR3DECL(void *) MMR3HyperHCPhys2HCVirt(vbox_PVM pVM, RTHCPHYS HCPhys);
++VMMR3DECL(int) MMR3HyperHCPhys2HCVirtEx(vbox_PVM pVM, RTHCPHYS HCPhys, void **ppv);
++VMMR3_INT_DECL(int) MMR3HyperQueryInfoFromHCPhys(vbox_PVM pVM, RTHCPHYS HCPhys, char *pszWhat, size_t cbWhat, uint32_t *pcbAlloc);
++VMMR3DECL(int) MMR3HyperReadGCVirt(vbox_PVM pVM, void *pvDst, RTGCPTR GCPtr, size_t cb);
+ /** @} */
+
+
+ /** @defgroup grp_mm_phys Guest Physical Memory Manager
+ * @todo retire this group, elimintating or moving MMR3PhysGetRamSize to PGMPhys.
+ * @{ */
+-VMMR3DECL(uint64_t) MMR3PhysGetRamSize(PVM pVM);
++VMMR3DECL(uint64_t) MMR3PhysGetRamSize(vbox_PVM pVM);
+ /** @} */
+
+
+ /** @defgroup grp_mm_page Physical Page Pool
+ * @{ */
+-VMMR3DECL(void *) MMR3PageAlloc(PVM pVM);
+-VMMR3DECL(RTHCPHYS) MMR3PageAllocPhys(PVM pVM);
+-VMMR3DECL(void) MMR3PageFree(PVM pVM, void *pvPage);
+-VMMR3DECL(void *) MMR3PageAllocLow(PVM pVM);
+-VMMR3DECL(void) MMR3PageFreeLow(PVM pVM, void *pvPage);
+-VMMR3DECL(void) MMR3PageFreeByPhys(PVM pVM, RTHCPHYS HCPhysPage);
+-VMMR3DECL(void *) MMR3PageDummyHCPtr(PVM pVM);
+-VMMR3DECL(RTHCPHYS) MMR3PageDummyHCPhys(PVM pVM);
++VMMR3DECL(void *) MMR3PageAlloc(vbox_PVM pVM);
++VMMR3DECL(RTHCPHYS) MMR3PageAllocPhys(vbox_PVM pVM);
++VMMR3DECL(void) MMR3PageFree(vbox_PVM pVM, void *pvPage);
++VMMR3DECL(void *) MMR3PageAllocLow(vbox_PVM pVM);
++VMMR3DECL(void) MMR3PageFreeLow(vbox_PVM pVM, void *pvPage);
++VMMR3DECL(void) MMR3PageFreeByPhys(vbox_PVM pVM, RTHCPHYS HCPhysPage);
++VMMR3DECL(void *) MMR3PageDummyHCPtr(vbox_PVM pVM);
++VMMR3DECL(RTHCPHYS) MMR3PageDummyHCPhys(vbox_PVM pVM);
+ /** @} */
+
+
+ /** @defgroup grp_mm_heap Heap Manager
+ * @{ */
+-VMMR3DECL(void *) MMR3HeapAlloc(PVM pVM, MMTAG enmTag, size_t cbSize);
++VMMR3DECL(void *) MMR3HeapAlloc(vbox_PVM pVM, MMTAG enmTag, size_t cbSize);
+ VMMR3DECL(void *) MMR3HeapAllocU(PUVM pUVM, MMTAG enmTag, size_t cbSize);
+-VMMR3DECL(int) MMR3HeapAllocEx(PVM pVM, MMTAG enmTag, size_t cbSize, void **ppv);
++VMMR3DECL(int) MMR3HeapAllocEx(vbox_PVM pVM, MMTAG enmTag, size_t cbSize, void **ppv);
+ VMMR3DECL(int) MMR3HeapAllocExU(PUVM pUVM, MMTAG enmTag, size_t cbSize, void **ppv);
+-VMMR3DECL(void *) MMR3HeapAllocZ(PVM pVM, MMTAG enmTag, size_t cbSize);
++VMMR3DECL(void *) MMR3HeapAllocZ(vbox_PVM pVM, MMTAG enmTag, size_t cbSize);
+ VMMR3DECL(void *) MMR3HeapAllocZU(PUVM pUVM, MMTAG enmTag, size_t cbSize);
+-VMMR3DECL(int) MMR3HeapAllocZEx(PVM pVM, MMTAG enmTag, size_t cbSize, void **ppv);
++VMMR3DECL(int) MMR3HeapAllocZEx(vbox_PVM pVM, MMTAG enmTag, size_t cbSize, void **ppv);
+ VMMR3DECL(int) MMR3HeapAllocZExU(PUVM pUVM, MMTAG enmTag, size_t cbSize, void **ppv);
+ VMMR3DECL(void *) MMR3HeapRealloc(void *pv, size_t cbNewSize);
+-VMMR3DECL(char *) MMR3HeapStrDup(PVM pVM, MMTAG enmTag, const char *psz);
++VMMR3DECL(char *) MMR3HeapStrDup(vbox_PVM pVM, MMTAG enmTag, const char *psz);
+ VMMR3DECL(char *) MMR3HeapStrDupU(PUVM pUVM, MMTAG enmTag, const char *psz);
+-VMMR3DECL(char *) MMR3HeapAPrintf(PVM pVM, MMTAG enmTag, const char *pszFormat, ...) RT_IPRT_FORMAT_ATTR(3, 4);
++VMMR3DECL(char *) MMR3HeapAPrintf(vbox_PVM pVM, MMTAG enmTag, const char *pszFormat, ...) RT_IPRT_FORMAT_ATTR(3, 4);
+ VMMR3DECL(char *) MMR3HeapAPrintfU(PUVM pUVM, MMTAG enmTag, const char *pszFormat, ...) RT_IPRT_FORMAT_ATTR(3, 4);
+-VMMR3DECL(char *) MMR3HeapAPrintfV(PVM pVM, MMTAG enmTag, const char *pszFormat, va_list va) RT_IPRT_FORMAT_ATTR(3, 0);
++VMMR3DECL(char *) MMR3HeapAPrintfV(vbox_PVM pVM, MMTAG enmTag, const char *pszFormat, va_list va) RT_IPRT_FORMAT_ATTR(3, 0);
+ VMMR3DECL(char *) MMR3HeapAPrintfVU(PUVM pUVM, MMTAG enmTag, const char *pszFormat, va_list va) RT_IPRT_FORMAT_ATTR(3, 0);
+ VMMR3DECL(void) MMR3HeapFree(void *pv);
+ /** @} */
+@@ -333,11 +333,11 @@ VMMR3DECL(void) MMR3HeapFree(void *p
+ * The memory is safely accessible from kernel context as well as user land.
+ *
+ * @{ */
+-VMMR3DECL(void *) MMR3UkHeapAlloc(PVM pVM, MMTAG enmTag, size_t cbSize, PRTR0PTR pR0Ptr);
+-VMMR3DECL(int) MMR3UkHeapAllocEx(PVM pVM, MMTAG enmTag, size_t cbSize, void **ppv, PRTR0PTR pR0Ptr);
+-VMMR3DECL(void *) MMR3UkHeapAllocZ(PVM pVM, MMTAG enmTag, size_t cbSize, PRTR0PTR pR0Ptr);
+-VMMR3DECL(int) MMR3UkHeapAllocZEx(PVM pVM, MMTAG enmTag, size_t cbSize, void **ppv, PRTR0PTR pR0Ptr);
+-VMMR3DECL(void) MMR3UkHeapFree(PVM pVM, void *pv, MMTAG enmTag);
++VMMR3DECL(void *) MMR3UkHeapAlloc(vbox_PVM pVM, MMTAG enmTag, size_t cbSize, PRTR0PTR pR0Ptr);
++VMMR3DECL(int) MMR3UkHeapAllocEx(vbox_PVM pVM, MMTAG enmTag, size_t cbSize, void **ppv, PRTR0PTR pR0Ptr);
++VMMR3DECL(void *) MMR3UkHeapAllocZ(vbox_PVM pVM, MMTAG enmTag, size_t cbSize, PRTR0PTR pR0Ptr);
++VMMR3DECL(int) MMR3UkHeapAllocZEx(vbox_PVM pVM, MMTAG enmTag, size_t cbSize, void **ppv, PRTR0PTR pR0Ptr);
++VMMR3DECL(void) MMR3UkHeapFree(vbox_PVM pVM, void *pv, MMTAG enmTag);
+ /** @} */
+
+ /** @} */
+@@ -350,15 +350,15 @@ VMMR3DECL(void) MMR3UkHeapFree(PVM p
+ * @{
+ */
+
+-VMMRCDECL(void) MMGCRamRegisterTrapHandler(PVM pVM);
+-VMMRCDECL(void) MMGCRamDeregisterTrapHandler(PVM pVM);
++VMMRCDECL(void) MMGCRamRegisterTrapHandler(vbox_PVM pVM);
++VMMRCDECL(void) MMGCRamDeregisterTrapHandler(vbox_PVM pVM);
+ VMMRCDECL(int) MMGCRamReadNoTrapHandler(void *pDst, void *pSrc, size_t cb);
+ /**
+ * @deprecated Don't use this as it doesn't check the page state.
+ */
+ VMMRCDECL(int) MMGCRamWriteNoTrapHandler(void *pDst, void *pSrc, size_t cb);
+-VMMRCDECL(int) MMGCRamRead(PVM pVM, void *pDst, void *pSrc, size_t cb);
+-VMMRCDECL(int) MMGCRamWrite(PVM pVM, void *pDst, void *pSrc, size_t cb);
++VMMRCDECL(int) MMGCRamRead(vbox_PVM pVM, void *pDst, void *pSrc, size_t cb);
++VMMRCDECL(int) MMGCRamWrite(vbox_PVM pVM, void *pDst, void *pSrc, size_t cb);
+
+ /** @} */
+ #endif /* IN_RC || DOXYGEN_RUNNING */
+@@ -368,4 +368,3 @@ RT_C_DECLS_END
+
+
+ #endif
+-
diff --git a/virtualbox/patches/patch-include_VBox_vmm_pdmapi.h b/virtualbox/patches/patch-include_VBox_vmm_pdmapi.h
new file mode 100644
index 0000000..4861312
--- /dev/null
+++ b/virtualbox/patches/patch-include_VBox_vmm_pdmapi.h
@@ -0,0 +1,155 @@
+$NetBSD$
+
+--- include/VBox/vmm/pdmapi.h.orig 2016-03-04 19:22:58.000000000 +0000
++++ include/VBox/vmm/pdmapi.h
+@@ -42,21 +42,21 @@ RT_C_DECLS_BEGIN
+ */
+
+ VMMDECL(int) PDMGetInterrupt(PVMCPU pVCpu, uint8_t *pu8Interrupt);
+-VMMDECL(int) PDMIsaSetIrq(PVM pVM, uint8_t u8Irq, uint8_t u8Level, uint32_t uTagSrc);
+-VMM_INT_DECL(bool) PDMHasIoApic(PVM pVM);
+-VMM_INT_DECL(int) PDMIoApicSetIrq(PVM pVM, uint8_t u8Irq, uint8_t u8Level, uint32_t uTagSrc);
+-VMM_INT_DECL(int) PDMIoApicSendMsi(PVM pVM, RTGCPHYS GCAddr, uint32_t uValue, uint32_t uTagSrc);
+-VMM_INT_DECL(bool) PDMHasApic(PVM pVM);
+-VMM_INT_DECL(int) PDMApicHasPendingIrq(PVM pVM, bool *pfPending);
++VMMDECL(int) PDMIsaSetIrq(vbox_PVM pVM, uint8_t u8Irq, uint8_t u8Level, uint32_t uTagSrc);
++VMM_INT_DECL(bool) PDMHasIoApic(vbox_PVM pVM);
++VMM_INT_DECL(int) PDMIoApicSetIrq(vbox_PVM pVM, uint8_t u8Irq, uint8_t u8Level, uint32_t uTagSrc);
++VMM_INT_DECL(int) PDMIoApicSendMsi(vbox_PVM pVM, RTGCPHYS GCAddr, uint32_t uValue, uint32_t uTagSrc);
++VMM_INT_DECL(bool) PDMHasApic(vbox_PVM pVM);
++VMM_INT_DECL(int) PDMApicHasPendingIrq(vbox_PVM pVM, bool *pfPending);
+ VMMDECL(int) PDMApicSetBase(PVMCPU pVCpu, uint64_t u64Base);
+ VMMDECL(int) PDMApicGetBase(PVMCPU pVCpu, uint64_t *pu64Base);
+ VMMDECL(int) PDMApicSetTPR(PVMCPU pVCpu, uint8_t u8TPR);
+ VMMDECL(int) PDMApicGetTPR(PVMCPU pVCpu, uint8_t *pu8TPR, bool *pfPending, uint8_t *pu8PendingIrq);
+-VMM_INT_DECL(int) PDMApicWriteMSR(PVM pVM, VMCPUID iCpu, uint32_t u32Reg, uint64_t u64Value);
+-VMM_INT_DECL(int) PDMApicReadMSR(PVM pVM, VMCPUID iCpu, uint32_t u32Reg, uint64_t *pu64Value);
+-VMM_INT_DECL(int) PDMApicGetTimerFreq(PVM pVM, uint64_t *pu64Value);
+-VMM_INT_DECL(int) PDMVmmDevHeapR3ToGCPhys(PVM pVM, RTR3PTR pv, RTGCPHYS *pGCPhys);
+-VMM_INT_DECL(bool) PDMVmmDevHeapIsEnabled(PVM pVM);
++VMM_INT_DECL(int) PDMApicWriteMSR(vbox_PVM pVM, VMCPUID iCpu, uint32_t u32Reg, uint64_t u64Value);
++VMM_INT_DECL(int) PDMApicReadMSR(vbox_PVM pVM, VMCPUID iCpu, uint32_t u32Reg, uint64_t *pu64Value);
++VMM_INT_DECL(int) PDMApicGetTimerFreq(vbox_PVM pVM, uint64_t *pu64Value);
++VMM_INT_DECL(int) PDMVmmDevHeapR3ToGCPhys(vbox_PVM pVM, RTR3PTR pv, RTGCPHYS *pGCPhys);
++VMM_INT_DECL(bool) PDMVmmDevHeapIsEnabled(vbox_PVM pVM);
+
+
+ /** @defgroup grp_pdm_r3 The PDM Host Context Ring-3 API
+@@ -65,16 +65,16 @@ VMM_INT_DECL(bool) PDMVmmDevHeapIsE
+
+ VMMR3_INT_DECL(int) PDMR3InitUVM(PUVM pUVM);
+ VMMR3_INT_DECL(int) PDMR3LdrLoadVMMR0U(PUVM pUVM);
+-VMMR3_INT_DECL(int) PDMR3Init(PVM pVM);
+-VMMR3DECL(void) PDMR3PowerOn(PVM pVM);
++VMMR3_INT_DECL(int) PDMR3Init(vbox_PVM pVM);
++VMMR3DECL(void) PDMR3PowerOn(vbox_PVM pVM);
+ VMMR3_INT_DECL(void) PDMR3ResetCpu(PVMCPU pVCpu);
+-VMMR3_INT_DECL(void) PDMR3Reset(PVM pVM);
+-VMMR3_INT_DECL(void) PDMR3MemSetup(PVM pVM, bool fAtReset);
+-VMMR3_INT_DECL(void) PDMR3Suspend(PVM pVM);
+-VMMR3_INT_DECL(void) PDMR3Resume(PVM pVM);
+-VMMR3DECL(void) PDMR3PowerOff(PVM pVM);
+-VMMR3_INT_DECL(void) PDMR3Relocate(PVM pVM, RTGCINTPTR offDelta);
+-VMMR3_INT_DECL(int) PDMR3Term(PVM pVM);
++VMMR3_INT_DECL(void) PDMR3Reset(vbox_PVM pVM);
++VMMR3_INT_DECL(void) PDMR3MemSetup(vbox_PVM pVM, bool fAtReset);
++VMMR3_INT_DECL(void) PDMR3Suspend(vbox_PVM pVM);
++VMMR3_INT_DECL(void) PDMR3Resume(vbox_PVM pVM);
++VMMR3DECL(void) PDMR3PowerOff(vbox_PVM pVM);
++VMMR3_INT_DECL(void) PDMR3Relocate(vbox_PVM pVM, RTGCINTPTR offDelta);
++VMMR3_INT_DECL(int) PDMR3Term(vbox_PVM pVM);
+ VMMR3_INT_DECL(void) PDMR3TermUVM(PUVM pUVM);
+
+ /** PDM loader context indicator. */
+@@ -108,28 +108,28 @@ typedef enum PDMLDRCTX
+ * @param enmCtx The context the module is loaded into.
+ * @param pvArg User argument.
+ */
+-typedef DECLCALLBACK(int) FNPDMR3ENUM(PVM pVM, const char *pszFilename, const char *pszName,
++typedef DECLCALLBACK(int) FNPDMR3ENUM(vbox_PVM pVM, const char *pszFilename, const char *pszName,
+ RTUINTPTR ImageBase, size_t cbImage, PDMLDRCTX enmCtx, void *pvArg);
+ /** Pointer to a FNPDMR3ENUM() function. */
+ typedef FNPDMR3ENUM *PFNPDMR3ENUM;
+-VMMR3DECL(int) PDMR3LdrEnumModules(PVM pVM, PFNPDMR3ENUM pfnCallback, void *pvArg);
++VMMR3DECL(int) PDMR3LdrEnumModules(vbox_PVM pVM, PFNPDMR3ENUM pfnCallback, void *pvArg);
+ VMMR3_INT_DECL(void) PDMR3LdrRelocateU(PUVM pUVM, RTGCINTPTR offDelta);
+-VMMR3_INT_DECL(int) PDMR3LdrGetSymbolR3(PVM pVM, const char *pszModule, const char *pszSymbol, void **ppvValue);
+-VMMR3DECL(int) PDMR3LdrGetSymbolR0(PVM pVM, const char *pszModule, const char *pszSymbol, PRTR0PTR ppvValue);
+-VMMR3DECL(int) PDMR3LdrGetSymbolR0Lazy(PVM pVM, const char *pszModule, const char *pszSearchPath, const char *pszSymbol, PRTR0PTR ppvValue);
+-VMMR3DECL(int) PDMR3LdrLoadRC(PVM pVM, const char *pszFilename, const char *pszName);
+-VMMR3DECL(int) PDMR3LdrGetSymbolRC(PVM pVM, const char *pszModule, const char *pszSymbol, PRTRCPTR pRCPtrValue);
+-VMMR3DECL(int) PDMR3LdrGetSymbolRCLazy(PVM pVM, const char *pszModule, const char *pszSearchPath, const char *pszSymbol,
++VMMR3_INT_DECL(int) PDMR3LdrGetSymbolR3(vbox_PVM pVM, const char *pszModule, const char *pszSymbol, void **ppvValue);
++VMMR3DECL(int) PDMR3LdrGetSymbolR0(vbox_PVM pVM, const char *pszModule, const char *pszSymbol, PRTR0PTR ppvValue);
++VMMR3DECL(int) PDMR3LdrGetSymbolR0Lazy(vbox_PVM pVM, const char *pszModule, const char *pszSearchPath, const char *pszSymbol, PRTR0PTR ppvValue);
++VMMR3DECL(int) PDMR3LdrLoadRC(vbox_PVM pVM, const char *pszFilename, const char *pszName);
++VMMR3DECL(int) PDMR3LdrGetSymbolRC(vbox_PVM pVM, const char *pszModule, const char *pszSymbol, PRTRCPTR pRCPtrValue);
++VMMR3DECL(int) PDMR3LdrGetSymbolRCLazy(vbox_PVM pVM, const char *pszModule, const char *pszSearchPath, const char *pszSymbol,
+ PRTRCPTR pRCPtrValue);
+-VMMR3_INT_DECL(int) PDMR3LdrQueryRCModFromPC(PVM pVM, RTRCPTR uPC,
++VMMR3_INT_DECL(int) PDMR3LdrQueryRCModFromPC(vbox_PVM pVM, RTRCPTR uPC,
+ char *pszModName, size_t cchModName, PRTRCPTR pMod,
+ char *pszNearSym1, size_t cchNearSym1, PRTRCPTR pNearSym1,
+ char *pszNearSym2, size_t cchNearSym2, PRTRCPTR pNearSym2);
+-VMMR3_INT_DECL(int) PDMR3LdrQueryR0ModFromPC(PVM pVM, RTR0PTR uPC,
++VMMR3_INT_DECL(int) PDMR3LdrQueryR0ModFromPC(vbox_PVM pVM, RTR0PTR uPC,
+ char *pszModName, size_t cchModName, PRTR0PTR pMod,
+ char *pszNearSym1, size_t cchNearSym1, PRTR0PTR pNearSym1,
+ char *pszNearSym2, size_t cchNearSym2, PRTR0PTR pNearSym2);
+-VMMR3_INT_DECL(int) PDMR3LdrGetInterfaceSymbols(PVM pVM, void *pvInterface, size_t cbInterface,
++VMMR3_INT_DECL(int) PDMR3LdrGetInterfaceSymbols(vbox_PVM pVM, void *pvInterface, size_t cbInterface,
+ const char *pszModule, const char *pszSearchPath,
+ const char *pszSymPrefix, const char *pszSymList,
+ bool fRing0OrRC);
+@@ -142,7 +142,7 @@ VMMR3DECL(int) PDMR3QueryDriver
+ VMMR3DECL(int) PDMR3DeviceAttach(PUVM pUVM, const char *pszDevice, unsigned iInstance, unsigned iLun, uint32_t fFlags,
+ PPDMIBASE *ppBase);
+ VMMR3DECL(int) PDMR3DeviceDetach(PUVM pUVM, const char *pszDevice, unsigned iInstance, unsigned iLun, uint32_t fFlags);
+-VMMR3_INT_DECL(PPDMCRITSECT) PDMR3DevGetCritSect(PVM pVM, PPDMDEVINS pDevIns);
++VMMR3_INT_DECL(PPDMCRITSECT) PDMR3DevGetCritSect(vbox_PVM pVM, PPDMDEVINS pDevIns);
+ VMMR3DECL(int) PDMR3DriverAttach(PUVM pUVM, const char *pszDevice, unsigned iDevIns, unsigned iLun, uint32_t fFlags,
+ PPPDMIBASE ppBase);
+ VMMR3DECL(int) PDMR3DriverDetach(PUVM pUVM, const char *pszDevice, unsigned iDevIns, unsigned iLun,
+@@ -150,15 +150,15 @@ VMMR3DECL(int) PDMR3DriverDetac
+ VMMR3DECL(int) PDMR3DriverReattach(PUVM pVM, const char *pszDevice, unsigned iDevIns, unsigned iLun,
+ const char *pszDriver, unsigned iOccurance, uint32_t fFlags, PCFGMNODE pCfg,
+ PPPDMIBASE ppBase);
+-VMMR3DECL(void) PDMR3DmaRun(PVM pVM);
+-VMMR3_INT_DECL(int) PDMR3LockCall(PVM pVM);
+-VMMR3_INT_DECL(int) PDMR3VmmDevHeapRegister(PVM pVM, RTGCPHYS GCPhys, RTR3PTR pvHeap, unsigned cbSize);
+-VMMR3_INT_DECL(int) PDMR3VmmDevHeapUnregister(PVM pVM, RTGCPHYS GCPhys);
+-VMMR3_INT_DECL(int) PDMR3VmmDevHeapAlloc(PVM pVM, size_t cbSize, RTR3PTR *ppv);
+-VMMR3_INT_DECL(int) PDMR3VmmDevHeapFree(PVM pVM, RTR3PTR pv);
+-VMMR3_INT_DECL(int) PDMR3TracingConfig(PVM pVM, const char *pszName, size_t cchName, bool fEnable, bool fApply);
+-VMMR3_INT_DECL(bool) PDMR3TracingAreAll(PVM pVM, bool fEnabled);
+-VMMR3_INT_DECL(int) PDMR3TracingQueryConfig(PVM pVM, char *pszConfig, size_t cbConfig);
++VMMR3DECL(void) PDMR3DmaRun(vbox_PVM pVM);
++VMMR3_INT_DECL(int) PDMR3LockCall(vbox_PVM pVM);
++VMMR3_INT_DECL(int) PDMR3VmmDevHeapRegister(vbox_PVM pVM, RTGCPHYS GCPhys, RTR3PTR pvHeap, unsigned cbSize);
++VMMR3_INT_DECL(int) PDMR3VmmDevHeapUnregister(vbox_PVM pVM, RTGCPHYS GCPhys);
++VMMR3_INT_DECL(int) PDMR3VmmDevHeapAlloc(vbox_PVM pVM, size_t cbSize, RTR3PTR *ppv);
++VMMR3_INT_DECL(int) PDMR3VmmDevHeapFree(vbox_PVM pVM, RTR3PTR pv);
++VMMR3_INT_DECL(int) PDMR3TracingConfig(vbox_PVM pVM, const char *pszName, size_t cchName, bool fEnable, bool fApply);
++VMMR3_INT_DECL(bool) PDMR3TracingAreAll(vbox_PVM pVM, bool fEnabled);
++VMMR3_INT_DECL(int) PDMR3TracingQueryConfig(vbox_PVM pVM, char *pszConfig, size_t cbConfig);
+ /** @} */
+
+
+@@ -195,7 +195,7 @@ typedef struct PDMDRIVERCALLREQHANDLERRE
+ * request buffer. */
+ typedef PDMDRIVERCALLREQHANDLERREQ *PPDMDRIVERCALLREQHANDLERREQ;
+
+-VMMR0_INT_DECL(int) PDMR0DriverCallReqHandler(PVM pVM, PPDMDRIVERCALLREQHANDLERREQ pReq);
++VMMR0_INT_DECL(int) PDMR0DriverCallReqHandler(vbox_PVM pVM, PPDMDRIVERCALLREQHANDLERREQ pReq);
+
+ /**
+ * Request buffer for PDMR0DeviceCallReqHandler / VMMR0_DO_PDM_DEVICE_CALL_REQ_HANDLER.
+@@ -220,7 +220,7 @@ typedef struct PDMDEVICECALLREQHANDLERRE
+ * VMMR0_DO_PDM_DEVICE_CALL_REQ_HANDLER request buffer. */
+ typedef PDMDEVICECALLREQHANDLERREQ *PPDMDEVICECALLREQHANDLERREQ;
+
+-VMMR0_INT_DECL(int) PDMR0DeviceCallReqHandler(PVM pVM, PPDMDEVICECALLREQHANDLERREQ pReq);
++VMMR0_INT_DECL(int) PDMR0DeviceCallReqHandler(vbox_PVM pVM, PPDMDEVICECALLREQHANDLERREQ pReq);
+
+ /** @} */
+
diff --git a/virtualbox/patches/patch-include_VBox_vmm_pdmasynccompletion.h b/virtualbox/patches/patch-include_VBox_vmm_pdmasynccompletion.h
new file mode 100644
index 0000000..f2d0063
--- /dev/null
+++ b/virtualbox/patches/patch-include_VBox_vmm_pdmasynccompletion.h
@@ -0,0 +1,23 @@
+$NetBSD$
+
+--- include/VBox/vmm/pdmasynccompletion.h.orig 2016-03-04 19:22:58.000000000 +0000
++++ include/VBox/vmm/pdmasynccompletion.h
+@@ -100,11 +100,11 @@ typedef FNPDMASYNCCOMPLETEUSB *PFNPDMASY
+ * @param pvUser2 User argument for the template.
+ * @param rc The status code of the completed request.
+ */
+-typedef DECLCALLBACK(void) FNPDMASYNCCOMPLETEINT(PVM pVM, void *pvUser, void *pvUser2, int rc);
++typedef DECLCALLBACK(void) FNPDMASYNCCOMPLETEINT(vbox_PVM pVM, void *pvUser, void *pvUser2, int rc);
+ /** Pointer to a FNPDMASYNCCOMPLETEINT(). */
+ typedef FNPDMASYNCCOMPLETEINT *PFNPDMASYNCCOMPLETEINT;
+
+-VMMR3DECL(int) PDMR3AsyncCompletionTemplateCreateInternal(PVM pVM, PPPDMASYNCCOMPLETIONTEMPLATE ppTemplate,
++VMMR3DECL(int) PDMR3AsyncCompletionTemplateCreateInternal(vbox_PVM pVM, PPPDMASYNCCOMPLETIONTEMPLATE ppTemplate,
+ PFNPDMASYNCCOMPLETEINT pfnCompleted, void *pvUser2, const char *pszDesc);
+ VMMR3DECL(int) PDMR3AsyncCompletionTemplateDestroy(PPDMASYNCCOMPLETIONTEMPLATE pTemplate);
+ VMMR3DECL(int) PDMR3AsyncCompletionEpCreateForFile(PPPDMASYNCCOMPLETIONENDPOINT ppEndpoint,
+@@ -146,4 +146,3 @@ VMMR3DECL(int) PDMR3AsyncCompletionBwMgr
+ RT_C_DECLS_END
+
+ #endif
+-
diff --git a/virtualbox/patches/patch-include_VBox_vmm_pdmblkcache.h b/virtualbox/patches/patch-include_VBox_vmm_pdmblkcache.h
new file mode 100644
index 0000000..5a69328
--- /dev/null
+++ b/virtualbox/patches/patch-include_VBox_vmm_pdmblkcache.h
@@ -0,0 +1,72 @@
+$NetBSD$
+
+--- include/VBox/vmm/pdmblkcache.h.orig 2016-03-04 19:22:58.000000000 +0000
++++ include/VBox/vmm/pdmblkcache.h
+@@ -230,7 +230,7 @@ typedef FNPDMBLKCACHEXFERENQUEUEDISCARDU
+ * @param pfnXferEnqueueDiscard The discard request enqueue callback.
+ * @param pcszId Unique ID used to identify the user.
+ */
+-VMMR3DECL(int) PDMR3BlkCacheRetainDriver(PVM pVM, PPDMDRVINS pDrvIns, PPPDMBLKCACHE ppBlkCache,
++VMMR3DECL(int) PDMR3BlkCacheRetainDriver(vbox_PVM pVM, PPDMDRVINS pDrvIns, PPPDMBLKCACHE ppBlkCache,
+ PFNPDMBLKCACHEXFERCOMPLETEDRV pfnXferComplete,
+ PFNPDMBLKCACHEXFERENQUEUEDRV pfnXferEnqueue,
+ PFNPDMBLKCACHEXFERENQUEUEDISCARDDRV pfnXferEnqueueDiscard,
+@@ -248,7 +248,7 @@ VMMR3DECL(int) PDMR3BlkCacheRetainDriver
+ * @param pfnXferEnqueueDiscard The discard request enqueue callback.
+ * @param pcszId Unique ID used to identify the user.
+ */
+-VMMR3DECL(int) PDMR3BlkCacheRetainDevice(PVM pVM, PPDMDEVINS pDevIns, PPPDMBLKCACHE ppBlkCache,
++VMMR3DECL(int) PDMR3BlkCacheRetainDevice(vbox_PVM pVM, PPDMDEVINS pDevIns, PPPDMBLKCACHE ppBlkCache,
+ PFNPDMBLKCACHEXFERCOMPLETEDEV pfnXferComplete,
+ PFNPDMBLKCACHEXFERENQUEUEDEV pfnXferEnqueue,
+ PFNPDMBLKCACHEXFERENQUEUEDISCARDDEV pfnXferEnqueueDiscard,
+@@ -266,7 +266,7 @@ VMMR3DECL(int) PDMR3BlkCacheRetainDevice
+ * @param pfnXferEnqueueDiscard The discard request enqueue callback.
+ * @param pcszId Unique ID used to identify the user.
+ */
+-VMMR3DECL(int) PDMR3BlkCacheRetainUsb(PVM pVM, PPDMUSBINS pUsbIns, PPPDMBLKCACHE ppBlkCache,
++VMMR3DECL(int) PDMR3BlkCacheRetainUsb(vbox_PVM pVM, PPDMUSBINS pUsbIns, PPPDMBLKCACHE ppBlkCache,
+ PFNPDMBLKCACHEXFERCOMPLETEUSB pfnXferComplete,
+ PFNPDMBLKCACHEXFERENQUEUEUSB pfnXferEnqueue,
+ PFNPDMBLKCACHEXFERENQUEUEDISCARDUSB pfnXferEnqueueDiscard,
+@@ -284,7 +284,7 @@ VMMR3DECL(int) PDMR3BlkCacheRetainUsb(PV
+ * @param pfnXferEnqueueDiscard The discard request enqueue callback.
+ * @param pcszId Unique ID used to identify the user.
+ */
+-VMMR3DECL(int) PDMR3BlkCacheRetainInt(PVM pVM, void *pvUser, PPPDMBLKCACHE ppBlkCache,
++VMMR3DECL(int) PDMR3BlkCacheRetainInt(vbox_PVM pVM, void *pvUser, PPPDMBLKCACHE ppBlkCache,
+ PFNPDMBLKCACHEXFERCOMPLETEINT pfnXferComplete,
+ PFNPDMBLKCACHEXFERENQUEUEINT pfnXferEnqueue,
+ PFNPDMBLKCACHEXFERENQUEUEDISCARDINT pfnXferEnqueueDiscard,
+@@ -305,7 +305,7 @@ VMMR3DECL(void) PDMR3BlkCacheRelease(PPD
+ * @param pVM The cross context VM structure.
+ * @param pDevIns The device instance.
+ */
+-VMMR3DECL(void) PDMR3BlkCacheReleaseDevice(PVM pVM, PPDMDEVINS pDevIns);
++VMMR3DECL(void) PDMR3BlkCacheReleaseDevice(vbox_PVM pVM, PPDMDEVINS pDevIns);
+
+ /**
+ * Releases all block cache handles for a driver instance.
+@@ -314,7 +314,7 @@ VMMR3DECL(void) PDMR3BlkCacheReleaseDevi
+ * @param pVM The cross context VM structure.
+ * @param pDrvIns The driver instance.
+ */
+-VMMR3DECL(void) PDMR3BlkCacheReleaseDriver(PVM pVM, PPDMDRVINS pDrvIns);
++VMMR3DECL(void) PDMR3BlkCacheReleaseDriver(vbox_PVM pVM, PPDMDRVINS pDrvIns);
+
+ /**
+ * Releases all block cache handles for a USB device instance.
+@@ -323,7 +323,7 @@ VMMR3DECL(void) PDMR3BlkCacheReleaseDriv
+ * @param pVM The cross context VM structure.
+ * @param pUsbIns The USB device instance.
+ */
+-VMMR3DECL(void) PDMR3BlkCacheReleaseUsb(PVM pVM, PPDMUSBINS pUsbIns);
++VMMR3DECL(void) PDMR3BlkCacheReleaseUsb(vbox_PVM pVM, PPDMUSBINS pUsbIns);
+
+ /**
+ * Creates a read task on the given endpoint.
+@@ -418,4 +418,3 @@ VMMR3DECL(int) PDMR3BlkCacheClear(PPDMBL
+ RT_C_DECLS_END
+
+ #endif
+-
diff --git a/virtualbox/patches/patch-include_VBox_vmm_pdmcritsect.h b/virtualbox/patches/patch-include_VBox_vmm_pdmcritsect.h
new file mode 100644
index 0000000..d71b3de
--- /dev/null
+++ b/virtualbox/patches/patch-include_VBox_vmm_pdmcritsect.h
@@ -0,0 +1,41 @@
+$NetBSD$
+
+--- include/VBox/vmm/pdmcritsect.h.orig 2016-03-04 19:22:58.000000000 +0000
++++ include/VBox/vmm/pdmcritsect.h
+@@ -51,14 +51,14 @@ typedef union PDMCRITSECT
+ #endif
+ } PDMCRITSECT;
+
+-VMMR3_INT_DECL(int) PDMR3CritSectBothTerm(PVM pVM);
+-VMMR3_INT_DECL(void) PDMR3CritSectLeaveAll(PVM pVM);
++VMMR3_INT_DECL(int) PDMR3CritSectBothTerm(vbox_PVM pVM);
++VMMR3_INT_DECL(void) PDMR3CritSectLeaveAll(vbox_PVM pVM);
+ VMM_INT_DECL(void) PDMCritSectBothFF(PVMCPU pVCpu);
+
+
+-VMMR3DECL(uint32_t) PDMR3CritSectCountOwned(PVM pVM, char *pszNames, size_t cbNames);
++VMMR3DECL(uint32_t) PDMR3CritSectCountOwned(vbox_PVM pVM, char *pszNames, size_t cbNames);
+
+-VMMR3DECL(int) PDMR3CritSectInit(PVM pVM, PPDMCRITSECT pCritSect, RT_SRC_POS_DECL,
++VMMR3DECL(int) PDMR3CritSectInit(vbox_PVM pVM, PPDMCRITSECT pCritSect, RT_SRC_POS_DECL,
+ const char *pszNameFmt, ...) RT_IPRT_FORMAT_ATTR(6, 7);
+ VMMR3DECL(int) PDMR3CritSectEnterEx(PPDMCRITSECT pCritSect, bool fCallRing3);
+ VMMR3DECL(bool) PDMR3CritSectYield(PPDMCRITSECT pCritSect);
+@@ -80,9 +80,9 @@ VMMDECL(bool) PDMCritSectIsInitial
+ VMMDECL(bool) PDMCritSectHasWaiters(PCPDMCRITSECT pCritSect);
+ VMMDECL(uint32_t) PDMCritSectGetRecursion(PCPDMCRITSECT pCritSect);
+
+-VMMR3DECL(PPDMCRITSECT) PDMR3CritSectGetNop(PVM pVM);
+-VMMR3DECL(R0PTRTYPE(PPDMCRITSECT)) PDMR3CritSectGetNopR0(PVM pVM);
+-VMMR3DECL(RCPTRTYPE(PPDMCRITSECT)) PDMR3CritSectGetNopRC(PVM pVM);
++VMMR3DECL(PPDMCRITSECT) PDMR3CritSectGetNop(vbox_PVM pVM);
++VMMR3DECL(R0PTRTYPE(PPDMCRITSECT)) PDMR3CritSectGetNopR0(vbox_PVM pVM);
++VMMR3DECL(RCPTRTYPE(PPDMCRITSECT)) PDMR3CritSectGetNopRC(vbox_PVM pVM);
+
+ /* Strict build: Remap the two enter calls to the debug versions. */
+ #ifdef VBOX_STRICT
+@@ -100,4 +100,3 @@ VMMR3DECL(RCPTRTYPE(PPDMCRITSECT)) PDMR
+ RT_C_DECLS_END
+
+ #endif
+-
diff --git a/virtualbox/patches/patch-include_VBox_vmm_pdmcritsectrw.h b/virtualbox/patches/patch-include_VBox_vmm_pdmcritsectrw.h
new file mode 100644
index 0000000..35b4206
--- /dev/null
+++ b/virtualbox/patches/patch-include_VBox_vmm_pdmcritsectrw.h
@@ -0,0 +1,18 @@
+$NetBSD$
+
+--- include/VBox/vmm/pdmcritsectrw.h.orig 2016-03-04 19:22:59.000000000 +0000
++++ include/VBox/vmm/pdmcritsectrw.h
+@@ -50,7 +50,7 @@ typedef union PDMCRITSECTRW
+ #endif
+ } PDMCRITSECTRW;
+
+-VMMR3DECL(int) PDMR3CritSectRwInit(PVM pVM, PPDMCRITSECTRW pCritSect, RT_SRC_POS_DECL,
++VMMR3DECL(int) PDMR3CritSectRwInit(vbox_PVM pVM, PPDMCRITSECTRW pCritSect, RT_SRC_POS_DECL,
+ const char *pszNameFmt, ...) RT_IPRT_FORMAT_ATTR(6, 7);
+ VMMR3DECL(int) PDMR3CritSectRwDelete(PPDMCRITSECTRW pCritSect);
+ VMMR3DECL(const char *) PDMR3CritSectRwName(PCPDMCRITSECTRW pCritSect);
+@@ -95,4 +95,3 @@ VMMDECL(bool) PDMCritSectRwIsIniti
+ RT_C_DECLS_END
+
+ #endif
+-
diff --git a/virtualbox/patches/patch-include_VBox_vmm_pdmdev.h b/virtualbox/patches/patch-include_VBox_vmm_pdmdev.h
new file mode 100644
index 0000000..b60a6ec
--- /dev/null
+++ b/virtualbox/patches/patch-include_VBox_vmm_pdmdev.h
@@ -0,0 +1,40 @@
+$NetBSD$
+
+--- include/VBox/vmm/pdmdev.h.orig 2016-03-04 19:22:59.000000000 +0000
++++ include/VBox/vmm/pdmdev.h
+@@ -3524,7 +3524,7 @@ typedef struct PDMDEVHLPR3
+ * @returns VM Handle.
+ * @param pDevIns The device instance.
+ */
+- DECLR3CALLBACKMEMBER(PVM, pfnGetVM,(PPDMDEVINS pDevIns));
++ DECLR3CALLBACKMEMBER(vbox_PVM, pfnGetVM,(PPDMDEVINS pDevIns));
+
+ /**
+ * Gets the VMCPU handle. Restricted API.
+@@ -3847,7 +3847,7 @@ typedef struct PDMDEVHLPRC
+ * @returns VM Handle.
+ * @param pDevIns Device instance.
+ */
+- DECLRCCALLBACKMEMBER(PVM, pfnGetVM,(PPDMDEVINS pDevIns));
++ DECLRCCALLBACKMEMBER(vbox_PVM, pfnGetVM,(PPDMDEVINS pDevIns));
+
+ /**
+ * Gets the VMCPU handle. Restricted API.
+@@ -4076,7 +4076,7 @@ typedef struct PDMDEVHLPR0
+ * @returns VM Handle.
+ * @param pDevIns Device instance.
+ */
+- DECLR0CALLBACKMEMBER(PVM, pfnGetVM,(PPDMDEVINS pDevIns));
++ DECLR0CALLBACKMEMBER(vbox_PVM, pfnGetVM,(PPDMDEVINS pDevIns));
+
+ /**
+ * Checks if our current CPU state allows for IO block emulation fallback to the recompiler
+@@ -5218,7 +5218,7 @@ DECLINLINE(PUVM) PDMDevHlpGetUVM(PPDMDEV
+ /**
+ * @copydoc PDMDEVHLPR3::pfnGetVM
+ */
+-DECLINLINE(PVM) PDMDevHlpGetVM(PPDMDEVINS pDevIns)
++DECLINLINE(vbox_PVM) PDMDevHlpGetVM(PPDMDEVINS pDevIns)
+ {
+ return pDevIns->CTX_SUFF(pHlp)->pfnGetVM(pDevIns);
+ }
diff --git a/virtualbox/patches/patch-include_VBox_vmm_pdmpci.h b/virtualbox/patches/patch-include_VBox_vmm_pdmpci.h
new file mode 100644
index 0000000..aad7cb0
--- /dev/null
+++ b/virtualbox/patches/patch-include_VBox_vmm_pdmpci.h
@@ -0,0 +1,28 @@
+$NetBSD$
+
+--- include/VBox/vmm/pdmpci.h.orig 2016-03-04 19:22:59.000000000 +0000
++++ include/VBox/vmm/pdmpci.h
+@@ -353,7 +353,7 @@ PCIRAWR0DECL(int) PciRawR0Init(void);
+ /**
+ * Process request (in R0).
+ */
+-PCIRAWR0DECL(int) PciRawR0ProcessReq(PSUPDRVSESSION pSession, PVM pVM, PPCIRAWSENDREQ pReq);
++PCIRAWR0DECL(int) PciRawR0ProcessReq(PSUPDRVSESSION pSession, vbox_PVM pVM, PPCIRAWSENDREQ pReq);
+ /**
+ * Terminate R0 PCI module.
+ */
+@@ -362,12 +362,12 @@ PCIRAWR0DECL(void) PciRawR0Term(void);
+ /**
+ * Per-VM R0 module init.
+ */
+-PCIRAWR0DECL(int) PciRawR0InitVM(PVM pVM);
++PCIRAWR0DECL(int) PciRawR0InitVM(vbox_PVM pVM);
+
+ /**
+ * Per-VM R0 module termination routine.
+ */
+-PCIRAWR0DECL(void) PciRawR0TermVM(PVM pVM);
++PCIRAWR0DECL(void) PciRawR0TermVM(vbox_PVM pVM);
+
+ /**
+ * Flags returned by pfnPciDeviceConstructStart(), to notify device
diff --git a/virtualbox/patches/patch-include_VBox_vmm_pdmqueue.h b/virtualbox/patches/patch-include_VBox_vmm_pdmqueue.h
new file mode 100644
index 0000000..2c98ef4
--- /dev/null
+++ b/virtualbox/patches/patch-include_VBox_vmm_pdmqueue.h
@@ -0,0 +1,44 @@
+$NetBSD$
+
+--- include/VBox/vmm/pdmqueue.h.orig 2016-03-04 19:22:59.000000000 +0000
++++ include/VBox/vmm/pdmqueue.h
+@@ -111,7 +111,7 @@ typedef FNPDMQUEUEDRV *PFNPDMQUEUEDRV;
+ * @remarks No locks will be held, but for now it's safe to assume that only one
+ * EMT will do queue callbacks at any one time.
+ */
+-typedef DECLCALLBACK(bool) FNPDMQUEUEINT(PVM pVM, PPDMQUEUEITEMCORE pItem);
++typedef DECLCALLBACK(bool) FNPDMQUEUEINT(vbox_PVM pVM, PPDMQUEUEITEMCORE pItem);
+ /** Pointer to a FNPDMQUEUEINT(). */
+ typedef FNPDMQUEUEINT *PFNPDMQUEUEINT;
+
+@@ -130,18 +130,18 @@ typedef DECLCALLBACK(bool) FNPDMQUEUEEXT
+ typedef FNPDMQUEUEEXT *PFNPDMQUEUEEXT;
+
+ #ifdef VBOX_IN_VMM
+-VMMR3_INT_DECL(int) PDMR3QueueCreateDevice(PVM pVM, PPDMDEVINS pDevIns, size_t cbItem, uint32_t cItems, uint32_t cMilliesInterval,
++VMMR3_INT_DECL(int) PDMR3QueueCreateDevice(vbox_PVM pVM, PPDMDEVINS pDevIns, size_t cbItem, uint32_t cItems, uint32_t cMilliesInterval,
+ PFNPDMQUEUEDEV pfnCallback, bool fRZEnabled, const char *pszName, PPDMQUEUE *ppQueue);
+-VMMR3_INT_DECL(int) PDMR3QueueCreateDriver(PVM pVM, PPDMDRVINS pDrvIns, size_t cbItem, uint32_t cItems, uint32_t cMilliesInterval,
++VMMR3_INT_DECL(int) PDMR3QueueCreateDriver(vbox_PVM pVM, PPDMDRVINS pDrvIns, size_t cbItem, uint32_t cItems, uint32_t cMilliesInterval,
+ PFNPDMQUEUEDRV pfnCallback, const char *pszName, PPDMQUEUE *ppQueue);
+-VMMR3_INT_DECL(int) PDMR3QueueCreateInternal(PVM pVM, size_t cbItem, uint32_t cItems, uint32_t cMilliesInterval,
++VMMR3_INT_DECL(int) PDMR3QueueCreateInternal(vbox_PVM pVM, size_t cbItem, uint32_t cItems, uint32_t cMilliesInterval,
+ PFNPDMQUEUEINT pfnCallback, bool fGCEnabled, const char *pszName, PPDMQUEUE *ppQueue);
+-VMMR3_INT_DECL(int) PDMR3QueueCreateExternal(PVM pVM, size_t cbItem, uint32_t cItems, uint32_t cMilliesInterval,
++VMMR3_INT_DECL(int) PDMR3QueueCreateExternal(vbox_PVM pVM, size_t cbItem, uint32_t cItems, uint32_t cMilliesInterval,
+ PFNPDMQUEUEEXT pfnCallback, void *pvUser, const char *pszName, PPDMQUEUE *ppQueue);
+ VMMR3_INT_DECL(int) PDMR3QueueDestroy(PPDMQUEUE pQueue);
+-VMMR3_INT_DECL(int) PDMR3QueueDestroyDevice(PVM pVM, PPDMDEVINS pDevIns);
+-VMMR3_INT_DECL(int) PDMR3QueueDestroyDriver(PVM pVM, PPDMDRVINS pDrvIns);
+-VMMR3_INT_DECL(void) PDMR3QueueFlushAll(PVM pVM);
++VMMR3_INT_DECL(int) PDMR3QueueDestroyDevice(vbox_PVM pVM, PPDMDEVINS pDevIns);
++VMMR3_INT_DECL(int) PDMR3QueueDestroyDriver(vbox_PVM pVM, PPDMDRVINS pDrvIns);
++VMMR3_INT_DECL(void) PDMR3QueueFlushAll(vbox_PVM pVM);
+ #endif /* VBOX_IN_VMM */
+
+ VMMDECL(PPDMQUEUEITEMCORE) PDMQueueAlloc(PPDMQUEUE pQueue);
+@@ -156,4 +156,3 @@ VMMDECL(bool) PDMQueueFl
+ RT_C_DECLS_END
+
+ #endif
+-
diff --git a/virtualbox/patches/patch-include_VBox_vmm_pdmthread.h b/virtualbox/patches/patch-include_VBox_vmm_pdmthread.h
new file mode 100644
index 0000000..e4ccc72
--- /dev/null
+++ b/virtualbox/patches/patch-include_VBox_vmm_pdmthread.h
@@ -0,0 +1,34 @@
+$NetBSD$
+
+--- include/VBox/vmm/pdmthread.h.orig 2016-03-04 19:22:59.000000000 +0000
++++ include/VBox/vmm/pdmthread.h
+@@ -123,7 +123,7 @@ typedef FNPDMTHREADDRV *PFNPDMTHREADDRV;
+ * @param pVM The cross context VM structure.
+ * @param pThread The PDM thread data.
+ */
+-typedef DECLCALLBACK(int) FNPDMTHREADINT(PVM pVM, PPDMTHREAD pThread);
++typedef DECLCALLBACK(int) FNPDMTHREADINT(vbox_PVM pVM, PPDMTHREAD pThread);
+ /** Pointer to a FNPDMTHREADINT(). */
+ typedef FNPDMTHREADINT *PFNPDMTHREADINT;
+
+@@ -179,7 +179,7 @@ typedef FNPDMTHREADWAKEUPDRV *PFNPDMTHRE
+ * @param pVM The cross context VM structure.
+ * @param pThread The PDM thread data.
+ */
+-typedef DECLCALLBACK(int) FNPDMTHREADWAKEUPINT(PVM pVM, PPDMTHREAD pThread);
++typedef DECLCALLBACK(int) FNPDMTHREADWAKEUPINT(vbox_PVM pVM, PPDMTHREAD pThread);
+ /** Pointer to a FNPDMTHREADWAKEUPINT(). */
+ typedef FNPDMTHREADWAKEUPINT *PFNPDMTHREADWAKEUPINT;
+
+@@ -279,9 +279,9 @@ typedef struct PDMTHREAD
+ #define PDMTHREAD_VERSION PDM_VERSION_MAKE(0xefff, 1, 0)
+
+ #ifdef IN_RING3
+-VMMR3DECL(int) PDMR3ThreadCreate(PVM pVM, PPPDMTHREAD ppThread, void *pvUser, PFNPDMTHREADINT pfnThread,
++VMMR3DECL(int) PDMR3ThreadCreate(vbox_PVM pVM, PPPDMTHREAD ppThread, void *pvUser, PFNPDMTHREADINT pfnThread,
+ PFNPDMTHREADWAKEUPINT pfnWakeUp, size_t cbStack, RTTHREADTYPE enmType, const char *pszName);
+-VMMR3DECL(int) PDMR3ThreadCreateExternal(PVM pVM, PPPDMTHREAD ppThread, void *pvUser, PFNPDMTHREADEXT pfnThread,
++VMMR3DECL(int) PDMR3ThreadCreateExternal(vbox_PVM pVM, PPPDMTHREAD ppThread, void *pvUser, PFNPDMTHREADEXT pfnThread,
+ PFNPDMTHREADWAKEUPEXT pfnWakeUp, size_t cbStack, RTTHREADTYPE enmType, const char *pszName);
+ VMMR3DECL(int) PDMR3ThreadDestroy(PPDMTHREAD pThread, int *pRcThread);
+ VMMR3DECL(int) PDMR3ThreadIAmSuspending(PPDMTHREAD pThread);
diff --git a/virtualbox/patches/patch-include_VBox_vmm_ssm.h b/virtualbox/patches/patch-include_VBox_vmm_ssm.h
new file mode 100644
index 0000000..1065683
--- /dev/null
+++ b/virtualbox/patches/patch-include_VBox_vmm_ssm.h
@@ -0,0 +1,152 @@
+$NetBSD$
+
+--- include/VBox/vmm/ssm.h.orig 2016-03-04 19:22:59.000000000 +0000
++++ include/VBox/vmm/ssm.h
+@@ -818,7 +818,7 @@ typedef FNSSMDRVLOADDONE *PFNSSMDRVLOADD
+ * @param pSSM SSM operation handle.
+ * @thread Any.
+ */
+-typedef DECLCALLBACK(int) FNSSMINTLIVEPREP(PVM pVM, PSSMHANDLE pSSM);
++typedef DECLCALLBACK(int) FNSSMINTLIVEPREP(vbox_PVM pVM, PSSMHANDLE pSSM);
+ /** Pointer to a FNSSMINTLIVEPREP() function. */
+ typedef FNSSMINTLIVEPREP *PFNSSMINTLIVEPREP;
+
+@@ -834,7 +834,7 @@ typedef FNSSMINTLIVEPREP *PFNSSMINTLIVEP
+ * @param uPass The data pass.
+ * @thread Any.
+ */
+-typedef DECLCALLBACK(int) FNSSMINTLIVEEXEC(PVM pVM, PSSMHANDLE pSSM, uint32_t uPass);
++typedef DECLCALLBACK(int) FNSSMINTLIVEEXEC(vbox_PVM pVM, PSSMHANDLE pSSM, uint32_t uPass);
+ /** Pointer to a FNSSMINTLIVEEXEC() function. */
+ typedef FNSSMINTLIVEEXEC *PFNSSMINTLIVEEXEC;
+
+@@ -856,7 +856,7 @@ typedef FNSSMINTLIVEEXEC *PFNSSMINTLIVEE
+ * @param uPass The data pass.
+ * @thread Any.
+ */
+-typedef DECLCALLBACK(int) FNSSMINTLIVEVOTE(PVM pVM, PSSMHANDLE pSSM, uint32_t uPass);
++typedef DECLCALLBACK(int) FNSSMINTLIVEVOTE(vbox_PVM pVM, PSSMHANDLE pSSM, uint32_t uPass);
+ /** Pointer to a FNSSMINTLIVEVOTE() function. */
+ typedef FNSSMINTLIVEVOTE *PFNSSMINTLIVEVOTE;
+
+@@ -867,7 +867,7 @@ typedef FNSSMINTLIVEVOTE *PFNSSMINTLIVEV
+ * @param pVM The cross context VM structure.
+ * @param pSSM SSM operation handle.
+ */
+-typedef DECLCALLBACK(int) FNSSMINTSAVEPREP(PVM pVM, PSSMHANDLE pSSM);
++typedef DECLCALLBACK(int) FNSSMINTSAVEPREP(vbox_PVM pVM, PSSMHANDLE pSSM);
+ /** Pointer to a FNSSMINTSAVEPREP() function. */
+ typedef FNSSMINTSAVEPREP *PFNSSMINTSAVEPREP;
+
+@@ -878,7 +878,7 @@ typedef FNSSMINTSAVEPREP *PFNSSMINTSAVEP
+ * @param pVM The cross context VM structure.
+ * @param pSSM SSM operation handle.
+ */
+-typedef DECLCALLBACK(int) FNSSMINTSAVEEXEC(PVM pVM, PSSMHANDLE pSSM);
++typedef DECLCALLBACK(int) FNSSMINTSAVEEXEC(vbox_PVM pVM, PSSMHANDLE pSSM);
+ /** Pointer to a FNSSMINTSAVEEXEC() function. */
+ typedef FNSSMINTSAVEEXEC *PFNSSMINTSAVEEXEC;
+
+@@ -889,7 +889,7 @@ typedef FNSSMINTSAVEEXEC *PFNSSMINTSAVEE
+ * @param pVM The cross context VM structure.
+ * @param pSSM SSM operation handle.
+ */
+-typedef DECLCALLBACK(int) FNSSMINTSAVEDONE(PVM pVM, PSSMHANDLE pSSM);
++typedef DECLCALLBACK(int) FNSSMINTSAVEDONE(vbox_PVM pVM, PSSMHANDLE pSSM);
+ /** Pointer to a FNSSMINTSAVEDONE() function. */
+ typedef FNSSMINTSAVEDONE *PFNSSMINTSAVEDONE;
+
+@@ -900,7 +900,7 @@ typedef FNSSMINTSAVEDONE *PFNSSMINTSAVED
+ * @param pVM The cross context VM structure.
+ * @param pSSM SSM operation handle.
+ */
+-typedef DECLCALLBACK(int) FNSSMINTLOADPREP(PVM pVM, PSSMHANDLE pSSM);
++typedef DECLCALLBACK(int) FNSSMINTLOADPREP(vbox_PVM pVM, PSSMHANDLE pSSM);
+ /** Pointer to a FNSSMINTLOADPREP() function. */
+ typedef FNSSMINTLOADPREP *PFNSSMINTLOADPREP;
+
+@@ -914,7 +914,7 @@ typedef FNSSMINTLOADPREP *PFNSSMINTLOADP
+ * @param uPass The pass. This is always SSM_PASS_FINAL for units
+ * that doesn't specify a pfnSaveLive callback.
+ */
+-typedef DECLCALLBACK(int) FNSSMINTLOADEXEC(PVM pVM, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass);
++typedef DECLCALLBACK(int) FNSSMINTLOADEXEC(vbox_PVM pVM, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass);
+ /** Pointer to a FNSSMINTLOADEXEC() function. */
+ typedef FNSSMINTLOADEXEC *PFNSSMINTLOADEXEC;
+
+@@ -925,7 +925,7 @@ typedef FNSSMINTLOADEXEC *PFNSSMINTLOADE
+ * @param pVM The cross context VM structure.
+ * @param pSSM SSM operation handle.
+ */
+-typedef DECLCALLBACK(int) FNSSMINTLOADDONE(PVM pVM, PSSMHANDLE pSSM);
++typedef DECLCALLBACK(int) FNSSMINTLOADDONE(vbox_PVM pVM, PSSMHANDLE pSSM);
+ /** Pointer to a FNSSMINTLOADDONE() function. */
+ typedef FNSSMINTLOADDONE *PFNSSMINTLOADDONE;
+
+@@ -1155,25 +1155,25 @@ typedef struct SSMSTRMOPS
+ #define SSMSTRMOPS_VERSION UINT32_C(0x55aa0001)
+
+
+-VMMR3_INT_DECL(void) SSMR3Term(PVM pVM);
++VMMR3_INT_DECL(void) SSMR3Term(vbox_PVM pVM);
+ VMMR3_INT_DECL(int)
+-SSMR3RegisterDevice(PVM pVM, PPDMDEVINS pDevIns, const char *pszName, uint32_t uInstance, uint32_t uVersion,
++SSMR3RegisterDevice(vbox_PVM pVM, PPDMDEVINS pDevIns, const char *pszName, uint32_t uInstance, uint32_t uVersion,
+ size_t cbGuess, const char *pszBefore,
+ PFNSSMDEVLIVEPREP pfnLivePrep, PFNSSMDEVLIVEEXEC pfnLiveExec, PFNSSMDEVLIVEVOTE pfnLiveVote,
+ PFNSSMDEVSAVEPREP pfnSavePrep, PFNSSMDEVSAVEEXEC pfnSaveExec, PFNSSMDEVSAVEDONE pfnSaveDone,
+ PFNSSMDEVLOADPREP pfnLoadPrep, PFNSSMDEVLOADEXEC pfnLoadExec, PFNSSMDEVLOADDONE pfnLoadDone);
+ VMMR3_INT_DECL(int)
+-SSMR3RegisterDriver(PVM pVM, PPDMDRVINS pDrvIns, const char *pszName, uint32_t uInstance, uint32_t uVersion, size_t cbGuess,
++SSMR3RegisterDriver(vbox_PVM pVM, PPDMDRVINS pDrvIns, const char *pszName, uint32_t uInstance, uint32_t uVersion, size_t cbGuess,
+ PFNSSMDRVLIVEPREP pfnLivePrep, PFNSSMDRVLIVEEXEC pfnLiveExec, PFNSSMDRVLIVEVOTE pfnLiveVote,
+ PFNSSMDRVSAVEPREP pfnSavePrep, PFNSSMDRVSAVEEXEC pfnSaveExec, PFNSSMDRVSAVEDONE pfnSaveDone,
+ PFNSSMDRVLOADPREP pfnLoadPrep, PFNSSMDRVLOADEXEC pfnLoadExec, PFNSSMDRVLOADDONE pfnLoadDone);
+ VMMR3_INT_DECL(int)
+-SSMR3RegisterUsb(PVM pVM, PPDMUSBINS pUsbIns, const char *pszName, uint32_t uInstance, uint32_t uVersion, size_t cbGuess,
++SSMR3RegisterUsb(vbox_PVM pVM, PPDMUSBINS pUsbIns, const char *pszName, uint32_t uInstance, uint32_t uVersion, size_t cbGuess,
+ PFNSSMUSBLIVEPREP pfnLivePrep, PFNSSMUSBLIVEEXEC pfnLiveExec, PFNSSMUSBLIVEVOTE pfnLiveVote,
+ PFNSSMUSBSAVEPREP pfnSavePrep, PFNSSMUSBSAVEEXEC pfnSaveExec, PFNSSMUSBSAVEDONE pfnSaveDone,
+ PFNSSMUSBLOADPREP pfnLoadPrep, PFNSSMUSBLOADEXEC pfnLoadExec, PFNSSMUSBLOADDONE pfnLoadDone);
+ VMMR3DECL(int)
+-SSMR3RegisterInternal(PVM pVM, const char *pszName, uint32_t uInstance, uint32_t uVersion, size_t cbGuess,
++SSMR3RegisterInternal(vbox_PVM pVM, const char *pszName, uint32_t uInstance, uint32_t uVersion, size_t cbGuess,
+ PFNSSMINTLIVEPREP pfnLivePrep, PFNSSMINTLIVEEXEC pfnLiveExec, PFNSSMINTLIVEVOTE pfnLiveVote,
+ PFNSSMINTSAVEPREP pfnSavePrep, PFNSSMINTSAVEEXEC pfnSaveExec, PFNSSMINTSAVEDONE pfnSaveDone,
+ PFNSSMINTLOADPREP pfnLoadPrep, PFNSSMINTLOADEXEC pfnLoadExec, PFNSSMINTLOADDONE pfnLoadDone);
+@@ -1182,21 +1182,21 @@ SSMR3RegisterExternal(PUVM pUVM, const c
+ PFNSSMEXTLIVEPREP pfnLivePrep, PFNSSMEXTLIVEEXEC pfnLiveExec, PFNSSMEXTLIVEVOTE pfnLiveVote,
+ PFNSSMEXTSAVEPREP pfnSavePrep, PFNSSMEXTSAVEEXEC pfnSaveExec, PFNSSMEXTSAVEDONE pfnSaveDone,
+ PFNSSMEXTLOADPREP pfnLoadPrep, PFNSSMEXTLOADEXEC pfnLoadExec, PFNSSMEXTLOADDONE pfnLoadDone, void *pvUser);
+-VMMR3DECL(int) SSMR3RegisterStub(PVM pVM, const char *pszName, uint32_t uInstance);
+-VMMR3_INT_DECL(int) SSMR3DeregisterDevice(PVM pVM, PPDMDEVINS pDevIns, const char *pszName, uint32_t uInstance);
+-VMMR3_INT_DECL(int) SSMR3DeregisterDriver(PVM pVM, PPDMDRVINS pDrvIns, const char *pszName, uint32_t uInstance);
+-VMMR3_INT_DECL(int) SSMR3DeregisterUsb(PVM pVM, PPDMUSBINS pUsbIns, const char *pszName, uint32_t uInstance);
+-VMMR3DECL(int) SSMR3DeregisterInternal(PVM pVM, const char *pszName);
+-VMMR3DECL(int) SSMR3DeregisterExternal(PVM pVM, const char *pszName);
+-VMMR3DECL(int) SSMR3Save(PVM pVM, const char *pszFilename, PCSSMSTRMOPS pStreamOps, void *pvStreamOpsUser, SSMAFTER enmAfter, PFNVMPROGRESS pfnProgress, void *pvUser);
+-VMMR3_INT_DECL(int) SSMR3LiveSave(PVM pVM, uint32_t cMsMaxDowntime,
++VMMR3DECL(int) SSMR3RegisterStub(vbox_PVM pVM, const char *pszName, uint32_t uInstance);
++VMMR3_INT_DECL(int) SSMR3DeregisterDevice(vbox_PVM pVM, PPDMDEVINS pDevIns, const char *pszName, uint32_t uInstance);
++VMMR3_INT_DECL(int) SSMR3DeregisterDriver(vbox_PVM pVM, PPDMDRVINS pDrvIns, const char *pszName, uint32_t uInstance);
++VMMR3_INT_DECL(int) SSMR3DeregisterUsb(vbox_PVM pVM, PPDMUSBINS pUsbIns, const char *pszName, uint32_t uInstance);
++VMMR3DECL(int) SSMR3DeregisterInternal(vbox_PVM pVM, const char *pszName);
++VMMR3DECL(int) SSMR3DeregisterExternal(vbox_PVM pVM, const char *pszName);
++VMMR3DECL(int) SSMR3Save(vbox_PVM pVM, const char *pszFilename, PCSSMSTRMOPS pStreamOps, void *pvStreamOpsUser, SSMAFTER enmAfter, PFNVMPROGRESS pfnProgress, void *pvUser);
++VMMR3_INT_DECL(int) SSMR3LiveSave(vbox_PVM pVM, uint32_t cMsMaxDowntime,
+ const char *pszFilename, PCSSMSTRMOPS pStreamOps, void *pvStreamOps,
+ SSMAFTER enmAfter, PFNVMPROGRESS pfnProgress, void *pvProgressUser,
+ PSSMHANDLE *ppSSM);
+ VMMR3_INT_DECL(int) SSMR3LiveDoStep1(PSSMHANDLE pSSM);
+ VMMR3_INT_DECL(int) SSMR3LiveDoStep2(PSSMHANDLE pSSM);
+ VMMR3_INT_DECL(int) SSMR3LiveDone(PSSMHANDLE pSSM);
+-VMMR3DECL(int) SSMR3Load(PVM pVM, const char *pszFilename, PCSSMSTRMOPS pStreamOps, void *pvStreamOpsUser,
++VMMR3DECL(int) SSMR3Load(vbox_PVM pVM, const char *pszFilename, PCSSMSTRMOPS pStreamOps, void *pvStreamOpsUser,
+ SSMAFTER enmAfter, PFNVMPROGRESS pfnProgress, void *pvProgressUser);
+ VMMR3DECL(int) SSMR3ValidateFile(const char *pszFilename, bool fChecksumIt);
+ VMMR3DECL(int) SSMR3Open(const char *pszFilename, unsigned fFlags, PSSMHANDLE *ppSSM);
+@@ -1299,4 +1299,3 @@ VMMR3DECL(int) SSMR3SetCfgError(PSSMHAND
+ RT_C_DECLS_END
+
+ #endif
+-
diff --git a/virtualbox/patches/patch-include_VBox_vmm_stam.h b/virtualbox/patches/patch-include_VBox_vmm_stam.h
new file mode 100644
index 0000000..57612dc
--- /dev/null
+++ b/virtualbox/patches/patch-include_VBox_vmm_stam.h
@@ -0,0 +1,59 @@
+$NetBSD$
+
+--- include/VBox/vmm/stam.h.orig 2016-03-04 19:22:59.000000000 +0000
++++ include/VBox/vmm/stam.h
+@@ -1106,7 +1106,7 @@ VMMR3DECL(int) STAMR3InitUVM(PUVM pUVM)
+ VMMR3DECL(void) STAMR3TermUVM(PUVM pUVM);
+ VMMR3DECL(int) STAMR3RegisterU(PUVM pUVM, void *pvSample, STAMTYPE enmType, STAMVISIBILITY enmVisibility,
+ const char *pszName, STAMUNIT enmUnit, const char *pszDesc);
+-VMMR3DECL(int) STAMR3Register(PVM pVM, void *pvSample, STAMTYPE enmType, STAMVISIBILITY enmVisibility,
++VMMR3DECL(int) STAMR3Register(vbox_PVM pVM, void *pvSample, STAMTYPE enmType, STAMVISIBILITY enmVisibility,
+ const char *pszName, STAMUNIT enmUnit, const char *pszDesc);
+
+ /** @def STAM_REL_REG
+@@ -1167,11 +1167,11 @@ VMMR3DECL(int) STAMR3Register(PVM pVM,
+
+ VMMR3DECL(int) STAMR3RegisterFU(PUVM pUVM, void *pvSample, STAMTYPE enmType, STAMVISIBILITY enmVisibility, STAMUNIT enmUnit,
+ const char *pszDesc, const char *pszName, ...) RT_IPRT_FORMAT_ATTR(7, 8);
+-VMMR3DECL(int) STAMR3RegisterF(PVM pVM, void *pvSample, STAMTYPE enmType, STAMVISIBILITY enmVisibility, STAMUNIT enmUnit,
++VMMR3DECL(int) STAMR3RegisterF(vbox_PVM pVM, void *pvSample, STAMTYPE enmType, STAMVISIBILITY enmVisibility, STAMUNIT enmUnit,
+ const char *pszDesc, const char *pszName, ...) RT_IPRT_FORMAT_ATTR(7, 8);
+ VMMR3DECL(int) STAMR3RegisterVU(PUVM pUVM, void *pvSample, STAMTYPE enmType, STAMVISIBILITY enmVisibility, STAMUNIT enmUnit,
+ const char *pszDesc, const char *pszName, va_list args) RT_IPRT_FORMAT_ATTR(7, 0);
+-VMMR3DECL(int) STAMR3RegisterV(PVM pVM, void *pvSample, STAMTYPE enmType, STAMVISIBILITY enmVisibility, STAMUNIT enmUnit,
++VMMR3DECL(int) STAMR3RegisterV(vbox_PVM pVM, void *pvSample, STAMTYPE enmType, STAMVISIBILITY enmVisibility, STAMUNIT enmUnit,
+ const char *pszDesc, const char *pszName, va_list args) RT_IPRT_FORMAT_ATTR(7, 0);
+
+ /**
+@@ -1179,7 +1179,7 @@ VMMR3DECL(int) STAMR3RegisterV(PVM pVM,
+ * @param pVM The cross context VM structure.
+ * @param pvSample The sample registered using STAMR3RegisterCallback.
+ */
+-typedef void FNSTAMR3CALLBACKRESET(PVM pVM, void *pvSample);
++typedef void FNSTAMR3CALLBACKRESET(vbox_PVM pVM, void *pvSample);
+ /** Pointer to a STAM sample reset callback. */
+ typedef FNSTAMR3CALLBACKRESET *PFNSTAMR3CALLBACKRESET;
+
+@@ -1191,14 +1191,14 @@ typedef FNSTAMR3CALLBACKRESET *PFNSTAMR3
+ * @param pszBuf The buffer to print into.
+ * @param cchBuf The size of the buffer.
+ */
+-typedef void FNSTAMR3CALLBACKPRINT(PVM pVM, void *pvSample, char *pszBuf, size_t cchBuf);
++typedef void FNSTAMR3CALLBACKPRINT(vbox_PVM pVM, void *pvSample, char *pszBuf, size_t cchBuf);
+ /** Pointer to a STAM sample print callback. */
+ typedef FNSTAMR3CALLBACKPRINT *PFNSTAMR3CALLBACKPRINT;
+
+-VMMR3DECL(int) STAMR3RegisterCallback(PVM pVM, void *pvSample, STAMVISIBILITY enmVisibility, STAMUNIT enmUnit,
++VMMR3DECL(int) STAMR3RegisterCallback(vbox_PVM pVM, void *pvSample, STAMVISIBILITY enmVisibility, STAMUNIT enmUnit,
+ PFNSTAMR3CALLBACKRESET pfnReset, PFNSTAMR3CALLBACKPRINT pfnPrint,
+ const char *pszDesc, const char *pszName, ...) RT_IPRT_FORMAT_ATTR(8, 9);
+-VMMR3DECL(int) STAMR3RegisterCallbackV(PVM pVM, void *pvSample, STAMVISIBILITY enmVisibility, STAMUNIT enmUnit,
++VMMR3DECL(int) STAMR3RegisterCallbackV(vbox_PVM pVM, void *pvSample, STAMVISIBILITY enmVisibility, STAMUNIT enmUnit,
+ PFNSTAMR3CALLBACKRESET pfnReset, PFNSTAMR3CALLBACKPRINT pfnPrint,
+ const char *pszDesc, const char *pszName, va_list args) RT_IPRT_FORMAT_ATTR(8, 0);
+ VMMR3DECL(int) STAMR3Deregister(PUVM pUVM, const char *pszPat);
+@@ -1241,4 +1241,3 @@ VMMR3DECL(const char *) STAMR3GetUnit(ST
+ RT_C_DECLS_END
+
+ #endif
+-
diff --git a/virtualbox/patches/patch-include_VBox_vmm_tm.h b/virtualbox/patches/patch-include_VBox_vmm_tm.h
new file mode 100644
index 0000000..dd11a08
--- /dev/null
+++ b/virtualbox/patches/patch-include_VBox_vmm_tm.h
@@ -0,0 +1,171 @@
+$NetBSD$
+
+--- include/VBox/vmm/tm.h.orig 2016-03-04 19:22:59.000000000 +0000
++++ include/VBox/vmm/tm.h
+@@ -86,14 +86,14 @@ VMMDECL(void) TMNotifyEndOfExe
+ VMM_INT_DECL(void) TMNotifyStartOfHalt(PVMCPU pVCpu);
+ VMM_INT_DECL(void) TMNotifyEndOfHalt(PVMCPU pVCpu);
+ #ifdef IN_RING3
+-VMMR3DECL(int) TMR3NotifySuspend(PVM pVM, PVMCPU pVCpu);
+-VMMR3DECL(int) TMR3NotifyResume(PVM pVM, PVMCPU pVCpu);
++VMMR3DECL(int) TMR3NotifySuspend(vbox_PVM pVM, PVMCPU pVCpu);
++VMMR3DECL(int) TMR3NotifyResume(vbox_PVM pVM, PVMCPU pVCpu);
+ VMMR3DECL(int) TMR3SetWarpDrive(PUVM pUVM, uint32_t u32Percent);
+ VMMR3DECL(uint32_t) TMR3GetWarpDrive(PUVM pUVM);
+ #endif
+-VMM_INT_DECL(uint32_t) TMCalcHostTimerFrequency(PVM pVM, PVMCPU pVCpu);
++VMM_INT_DECL(uint32_t) TMCalcHostTimerFrequency(vbox_PVM pVM, PVMCPU pVCpu);
+ #ifdef IN_RING3
+-VMMR3DECL(int) TMR3GetCpuLoadTimes(PVM pVM, VMCPUID idCpu, uint64_t *pcNsTotal, uint64_t *pcNsExecuting,
++VMMR3DECL(int) TMR3GetCpuLoadTimes(vbox_PVM pVM, VMCPUID idCpu, uint64_t *pcNsTotal, uint64_t *pcNsExecuting,
+ uint64_t *pcNsHalted, uint64_t *pcNsOther);
+ #endif
+
+@@ -101,31 +101,31 @@ VMMR3DECL(int) TMR3GetCpuLoadTi
+ /** @name Real Clock Methods
+ * @{
+ */
+-VMM_INT_DECL(uint64_t) TMRealGet(PVM pVM);
+-VMM_INT_DECL(uint64_t) TMRealGetFreq(PVM pVM);
++VMM_INT_DECL(uint64_t) TMRealGet(vbox_PVM pVM);
++VMM_INT_DECL(uint64_t) TMRealGetFreq(vbox_PVM pVM);
+ /** @} */
+
+
+ /** @name Virtual Clock Methods
+ * @{
+ */
+-VMM_INT_DECL(uint64_t) TMVirtualGet(PVM pVM);
+-VMM_INT_DECL(uint64_t) TMVirtualGetNoCheck(PVM pVM);
+-VMM_INT_DECL(uint64_t) TMVirtualSyncGetLag(PVM pVM);
+-VMM_INT_DECL(uint32_t) TMVirtualSyncGetCatchUpPct(PVM pVM);
+-VMM_INT_DECL(uint64_t) TMVirtualGetFreq(PVM pVM);
+-VMM_INT_DECL(uint64_t) TMVirtualSyncGet(PVM pVM);
+-VMM_INT_DECL(uint64_t) TMVirtualSyncGetNoCheck(PVM pVM);
+-VMM_INT_DECL(uint64_t) TMVirtualSyncGetEx(PVM pVM, bool fCheckTimers);
+-VMM_INT_DECL(uint64_t) TMVirtualSyncGetWithDeadlineNoCheck(PVM pVM, uint64_t *pcNsToDeadline);
+-VMMDECL(uint64_t) TMVirtualSyncGetNsToDeadline(PVM pVM);
+-VMM_INT_DECL(uint64_t) TMVirtualToNano(PVM pVM, uint64_t u64VirtualTicks);
+-VMM_INT_DECL(uint64_t) TMVirtualToMicro(PVM pVM, uint64_t u64VirtualTicks);
+-VMM_INT_DECL(uint64_t) TMVirtualToMilli(PVM pVM, uint64_t u64VirtualTicks);
+-VMM_INT_DECL(uint64_t) TMVirtualFromNano(PVM pVM, uint64_t u64NanoTS);
+-VMM_INT_DECL(uint64_t) TMVirtualFromMicro(PVM pVM, uint64_t u64MicroTS);
+-VMM_INT_DECL(uint64_t) TMVirtualFromMilli(PVM pVM, uint64_t u64MilliTS);
+-VMM_INT_DECL(bool) TMVirtualIsTicking(PVM pVM);
++VMM_INT_DECL(uint64_t) TMVirtualGet(vbox_PVM pVM);
++VMM_INT_DECL(uint64_t) TMVirtualGetNoCheck(vbox_PVM pVM);
++VMM_INT_DECL(uint64_t) TMVirtualSyncGetLag(vbox_PVM pVM);
++VMM_INT_DECL(uint32_t) TMVirtualSyncGetCatchUpPct(vbox_PVM pVM);
++VMM_INT_DECL(uint64_t) TMVirtualGetFreq(vbox_PVM pVM);
++VMM_INT_DECL(uint64_t) TMVirtualSyncGet(vbox_PVM pVM);
++VMM_INT_DECL(uint64_t) TMVirtualSyncGetNoCheck(vbox_PVM pVM);
++VMM_INT_DECL(uint64_t) TMVirtualSyncGetEx(vbox_PVM pVM, bool fCheckTimers);
++VMM_INT_DECL(uint64_t) TMVirtualSyncGetWithDeadlineNoCheck(vbox_PVM pVM, uint64_t *pcNsToDeadline);
++VMMDECL(uint64_t) TMVirtualSyncGetNsToDeadline(vbox_PVM pVM);
++VMM_INT_DECL(uint64_t) TMVirtualToNano(vbox_PVM pVM, uint64_t u64VirtualTicks);
++VMM_INT_DECL(uint64_t) TMVirtualToMicro(vbox_PVM pVM, uint64_t u64VirtualTicks);
++VMM_INT_DECL(uint64_t) TMVirtualToMilli(vbox_PVM pVM, uint64_t u64VirtualTicks);
++VMM_INT_DECL(uint64_t) TMVirtualFromNano(vbox_PVM pVM, uint64_t u64NanoTS);
++VMM_INT_DECL(uint64_t) TMVirtualFromMicro(vbox_PVM pVM, uint64_t u64MicroTS);
++VMM_INT_DECL(uint64_t) TMVirtualFromMilli(vbox_PVM pVM, uint64_t u64MilliTS);
++VMM_INT_DECL(bool) TMVirtualIsTicking(vbox_PVM pVM);
+ /** @} */
+
+
+@@ -134,12 +134,12 @@ VMM_INT_DECL(bool) TMVirtualIsTicki
+ */
+ VMMDECL(uint64_t) TMCpuTickGet(PVMCPU pVCpu);
+ VMM_INT_DECL(uint64_t) TMCpuTickGetNoCheck(PVMCPU pVCpu);
+-VMM_INT_DECL(bool) TMCpuTickCanUseRealTSC(PVM pVM, PVMCPU pVCpu, uint64_t *poffRealTSC, bool *pfParavirtTsc);
+-VMM_INT_DECL(uint64_t) TMCpuTickGetDeadlineAndTscOffset(PVM pVM, PVMCPU pVCpu, uint64_t *poffRealTSC, bool *pfOffsettedTsc, bool *pfParavirtTsc);
+-VMM_INT_DECL(int) TMCpuTickSet(PVM pVM, PVMCPU pVCpu, uint64_t u64Tick);
++VMM_INT_DECL(bool) TMCpuTickCanUseRealTSC(vbox_PVM pVM, PVMCPU pVCpu, uint64_t *poffRealTSC, bool *pfParavirtTsc);
++VMM_INT_DECL(uint64_t) TMCpuTickGetDeadlineAndTscOffset(vbox_PVM pVM, PVMCPU pVCpu, uint64_t *poffRealTSC, bool *pfOffsettedTsc, bool *pfParavirtTsc);
++VMM_INT_DECL(int) TMCpuTickSet(vbox_PVM pVM, PVMCPU pVCpu, uint64_t u64Tick);
+ VMM_INT_DECL(int) TMCpuTickSetLastSeen(PVMCPU pVCpu, uint64_t u64LastSeenTick);
+ VMM_INT_DECL(uint64_t) TMCpuTickGetLastSeen(PVMCPU pVCpu);
+-VMMDECL(uint64_t) TMCpuTicksPerSecond(PVM pVM);
++VMMDECL(uint64_t) TMCpuTicksPerSecond(vbox_PVM pVM);
+ VMM_INT_DECL(bool) TMCpuTickIsTicking(PVMCPU pVCpu);
+ /** @} */
+
+@@ -198,7 +198,7 @@ typedef FNTMTIMERSRV *PFNTMTIMERSRV;
+ * @param pTimer The timer handle.
+ * @param pvUser User argument specified upon timer creation.
+ */
+-typedef DECLCALLBACK(void) FNTMTIMERINT(PVM pVM, PTMTIMER pTimer, void *pvUser);
++typedef DECLCALLBACK(void) FNTMTIMERINT(vbox_PVM pVM, PTMTIMER pTimer, void *pvUser);
+ /** Pointer to internal timer callback function. */
+ typedef FNTMTIMERINT *PFNTMTIMERINT;
+
+@@ -239,9 +239,9 @@ VMMDECL(uint64_t) TMTimerFromNano(
+ VMMDECL(uint64_t) TMTimerFromMicro(PTMTIMER pTimer, uint64_t cMicroSecs);
+ VMMDECL(uint64_t) TMTimerFromMilli(PTMTIMER pTimer, uint64_t cMilliSecs);
+
+-VMMDECL(bool) TMTimerPollBool(PVM pVM, PVMCPU pVCpu);
+-VMM_INT_DECL(void) TMTimerPollVoid(PVM pVM, PVMCPU pVCpu);
+-VMM_INT_DECL(uint64_t) TMTimerPollGIP(PVM pVM, PVMCPU pVCpu, uint64_t *pu64Delta);
++VMMDECL(bool) TMTimerPollBool(vbox_PVM pVM, PVMCPU pVCpu);
++VMM_INT_DECL(void) TMTimerPollVoid(vbox_PVM pVM, PVMCPU pVCpu);
++VMM_INT_DECL(uint64_t) TMTimerPollGIP(vbox_PVM pVM, PVMCPU pVCpu, uint64_t *pu64Delta);
+ /** @} */
+
+
+@@ -249,31 +249,31 @@ VMM_INT_DECL(uint64_t) TMTimerPollGIP(P
+ /** @defgroup grp_tm_r3 The TM Host Context Ring-3 API
+ * @{
+ */
+-VMM_INT_DECL(int) TMR3Init(PVM pVM);
+-VMM_INT_DECL(int) TMR3InitFinalize(PVM pVM);
+-VMM_INT_DECL(void) TMR3Relocate(PVM pVM, RTGCINTPTR offDelta);
+-VMM_INT_DECL(int) TMR3Term(PVM pVM);
+-VMM_INT_DECL(void) TMR3Reset(PVM pVM);
+-VMM_INT_DECL(int) TMR3GetImportRC(PVM pVM, const char *pszSymbol, PRTRCPTR pRCPtrValue);
+-VMM_INT_DECL(int) TMR3TimerCreateDevice(PVM pVM, PPDMDEVINS pDevIns, TMCLOCK enmClock, PFNTMTIMERDEV pfnCallback, void *pvUser, uint32_t fFlags, const char *pszDesc, PPTMTIMERR3 ppTimer);
+-VMM_INT_DECL(int) TMR3TimerCreateUsb(PVM pVM, PPDMUSBINS pUsbIns, TMCLOCK enmClock, PFNTMTIMERUSB pfnCallback, void *pvUser, uint32_t fFlags, const char *pszDesc, PPTMTIMERR3 ppTimer);
+-VMM_INT_DECL(int) TMR3TimerCreateDriver(PVM pVM, PPDMDRVINS pDrvIns, TMCLOCK enmClock, PFNTMTIMERDRV pfnCallback, void *pvUser, uint32_t fFlags, const char *pszDesc, PPTMTIMERR3 ppTimer);
+-VMMR3DECL(int) TMR3TimerCreateInternal(PVM pVM, TMCLOCK enmClock, PFNTMTIMERINT pfnCallback, void *pvUser, const char *pszDesc, PPTMTIMERR3 ppTimer);
+-VMMR3DECL(PTMTIMERR3) TMR3TimerCreateExternal(PVM pVM, TMCLOCK enmClock, PFNTMTIMEREXT pfnCallback, void *pvUser, const char *pszDesc);
++VMM_INT_DECL(int) TMR3Init(vbox_PVM pVM);
++VMM_INT_DECL(int) TMR3InitFinalize(vbox_PVM pVM);
++VMM_INT_DECL(void) TMR3Relocate(vbox_PVM pVM, RTGCINTPTR offDelta);
++VMM_INT_DECL(int) TMR3Term(vbox_PVM pVM);
++VMM_INT_DECL(void) TMR3Reset(vbox_PVM pVM);
++VMM_INT_DECL(int) TMR3GetImportRC(vbox_PVM pVM, const char *pszSymbol, PRTRCPTR pRCPtrValue);
++VMM_INT_DECL(int) TMR3TimerCreateDevice(vbox_PVM pVM, PPDMDEVINS pDevIns, TMCLOCK enmClock, PFNTMTIMERDEV pfnCallback, void *pvUser, uint32_t fFlags, const char *pszDesc, PPTMTIMERR3 ppTimer);
++VMM_INT_DECL(int) TMR3TimerCreateUsb(vbox_PVM pVM, PPDMUSBINS pUsbIns, TMCLOCK enmClock, PFNTMTIMERUSB pfnCallback, void *pvUser, uint32_t fFlags, const char *pszDesc, PPTMTIMERR3 ppTimer);
++VMM_INT_DECL(int) TMR3TimerCreateDriver(vbox_PVM pVM, PPDMDRVINS pDrvIns, TMCLOCK enmClock, PFNTMTIMERDRV pfnCallback, void *pvUser, uint32_t fFlags, const char *pszDesc, PPTMTIMERR3 ppTimer);
++VMMR3DECL(int) TMR3TimerCreateInternal(vbox_PVM pVM, TMCLOCK enmClock, PFNTMTIMERINT pfnCallback, void *pvUser, const char *pszDesc, PPTMTIMERR3 ppTimer);
++VMMR3DECL(PTMTIMERR3) TMR3TimerCreateExternal(vbox_PVM pVM, TMCLOCK enmClock, PFNTMTIMEREXT pfnCallback, void *pvUser, const char *pszDesc);
+ VMMR3DECL(int) TMR3TimerDestroy(PTMTIMER pTimer);
+-VMM_INT_DECL(int) TMR3TimerDestroyDevice(PVM pVM, PPDMDEVINS pDevIns);
+-VMM_INT_DECL(int) TMR3TimerDestroyUsb(PVM pVM, PPDMUSBINS pUsbIns);
+-VMM_INT_DECL(int) TMR3TimerDestroyDriver(PVM pVM, PPDMDRVINS pDrvIns);
++VMM_INT_DECL(int) TMR3TimerDestroyDevice(vbox_PVM pVM, PPDMDEVINS pDevIns);
++VMM_INT_DECL(int) TMR3TimerDestroyUsb(vbox_PVM pVM, PPDMUSBINS pUsbIns);
++VMM_INT_DECL(int) TMR3TimerDestroyDriver(vbox_PVM pVM, PPDMDRVINS pDrvIns);
+ VMMR3DECL(int) TMR3TimerSave(PTMTIMERR3 pTimer, PSSMHANDLE pSSM);
+ VMMR3DECL(int) TMR3TimerLoad(PTMTIMERR3 pTimer, PSSMHANDLE pSSM);
+ VMMR3DECL(int) TMR3TimerSetCritSect(PTMTIMERR3 pTimer, PPDMCRITSECT pCritSect);
+-VMMR3DECL(void) TMR3TimerQueuesDo(PVM pVM);
+-VMMR3_INT_DECL(void) TMR3VirtualSyncFF(PVM pVM, PVMCPU pVCpu);
+-VMMR3_INT_DECL(PRTTIMESPEC) TMR3UtcNow(PVM pVM, PRTTIMESPEC pTime);
+-
+-VMMR3_INT_DECL(int) TMR3CpuTickParavirtEnable(PVM pVM);
+-VMMR3_INT_DECL(int) TMR3CpuTickParavirtDisable(PVM pVM);
+-VMMR3_INT_DECL(bool) TMR3CpuTickIsFixedRateMonotonic(PVM pVM, bool fWithParavirtEnabled);
++VMMR3DECL(void) TMR3TimerQueuesDo(vbox_PVM pVM);
++VMMR3_INT_DECL(void) TMR3VirtualSyncFF(vbox_PVM pVM, PVMCPU pVCpu);
++VMMR3_INT_DECL(PRTTIMESPEC) TMR3UtcNow(vbox_PVM pVM, PRTTIMESPEC pTime);
++
++VMMR3_INT_DECL(int) TMR3CpuTickParavirtEnable(vbox_PVM pVM);
++VMMR3_INT_DECL(int) TMR3CpuTickParavirtDisable(vbox_PVM pVM);
++VMMR3_INT_DECL(bool) TMR3CpuTickIsFixedRateMonotonic(vbox_PVM pVM, bool fWithParavirtEnabled);
+ /** @} */
+ #endif /* IN_RING3 */
+
+@@ -283,4 +283,3 @@ VMMR3_INT_DECL(bool) TMR3CpuTickIsFix
+ RT_C_DECLS_END
+
+ #endif
+-
diff --git a/virtualbox/patches/patch-include_VBox_vmm_uvm.h b/virtualbox/patches/patch-include_VBox_vmm_uvm.h
new file mode 100644
index 0000000..3c88acd
--- /dev/null
+++ b/virtualbox/patches/patch-include_VBox_vmm_uvm.h
@@ -0,0 +1,27 @@
+$NetBSD$
+
+--- include/VBox/vmm/uvm.h.orig 2016-03-04 19:22:59.000000000 +0000
++++ include/VBox/vmm/uvm.h
+@@ -42,7 +42,7 @@ typedef struct UVMCPU
+ /** Pointer to the UVM structure. */
+ PUVM pUVM;
+ /** Pointer to the VM structure. */
+- PVM pVM;
++ vbox_PVM pVM;
+ /** Pointer to the VMCPU structure. */
+ PVMCPU pVCpu;
+ /** The virtual CPU ID. */
+@@ -87,7 +87,7 @@ typedef struct UVM
+ /** The number of virtual CPUs. */
+ uint32_t cCpus;
+ /** The ring-3 mapping of the shared VM structure. */
+- PVM pVM;
++ vbox_PVM pVM;
+ /** Pointer to the next VM.
+ * We keep a per process list of VM for the event that a process could
+ * contain more than one VM.
+@@ -180,4 +180,3 @@ AssertCompileMemberAlignment(UVM, aCpus,
+
+ /** @} */
+ #endif
+-
diff --git a/virtualbox/patches/patch-include_VBox_vmm_vmapi.h b/virtualbox/patches/patch-include_VBox_vmm_vmapi.h
new file mode 100644
index 0000000..c015896
--- /dev/null
+++ b/virtualbox/patches/patch-include_VBox_vmm_vmapi.h
@@ -0,0 +1,118 @@
+$NetBSD$
+
+--- include/VBox/vmm/vmapi.h.orig 2016-03-04 19:22:59.000000000 +0000
++++ include/VBox/vmm/vmapi.h
+@@ -104,8 +104,8 @@ typedef DECLCALLBACK(void) FNVMATERROR(P
+ /** Pointer to a VM error callback. */
+ typedef FNVMATERROR *PFNVMATERROR;
+
+-VMMDECL(int) VMSetError(PVM pVM, int rc, RT_SRC_POS_DECL, const char *pszFormat, ...) RT_IPRT_FORMAT_ATTR(6, 7);
+-VMMDECL(int) VMSetErrorV(PVM pVM, int rc, RT_SRC_POS_DECL, const char *pszFormat, va_list args) RT_IPRT_FORMAT_ATTR(6, 7);
++VMMDECL(int) VMSetError(vbox_PVM pVM, int rc, RT_SRC_POS_DECL, const char *pszFormat, ...) RT_IPRT_FORMAT_ATTR(6, 7);
++VMMDECL(int) VMSetErrorV(vbox_PVM pVM, int rc, RT_SRC_POS_DECL, const char *pszFormat, va_list args) RT_IPRT_FORMAT_ATTR(6, 7);
+
+ /** @def VM_SET_ERROR
+ * Macro for setting a simple VM error message.
+@@ -155,9 +155,9 @@ typedef DECLCALLBACK(void) FNVMATRUNTIME
+ /** Pointer to a VM runtime error callback. */
+ typedef FNVMATRUNTIMEERROR *PFNVMATRUNTIMEERROR;
+
+-VMMDECL(int) VMSetRuntimeError(PVM pVM, uint32_t fFlags, const char *pszErrorId,
++VMMDECL(int) VMSetRuntimeError(vbox_PVM pVM, uint32_t fFlags, const char *pszErrorId,
+ const char *pszFormat, ...) RT_IPRT_FORMAT_ATTR(4, 5);
+-VMMDECL(int) VMSetRuntimeErrorV(PVM pVM, uint32_t fFlags, const char *pszErrorId,
++VMMDECL(int) VMSetRuntimeErrorV(vbox_PVM pVM, uint32_t fFlags, const char *pszErrorId,
+ const char *pszFormat, va_list args) RT_IPRT_FORMAT_ATTR(4, 0);
+
+ /** @name VMSetRuntimeError fFlags
+@@ -404,7 +404,7 @@ typedef FNVMPROGRESS *PFNVMPROGRESS;
+ VMMR3DECL(int) VMR3Create(uint32_t cCpus, PCVMM2USERMETHODS pVm2UserCbs,
+ PFNVMATERROR pfnVMAtError, void *pvUserVM,
+ PFNCFGMCONSTRUCTOR pfnCFGMConstructor, void *pvUserCFGM,
+- PVM *ppVM, PUVM *ppUVM);
++ vbox_PVM *ppVM, PUVM *ppUVM);
+ VMMR3DECL(int) VMR3PowerOn(PUVM pUVM);
+ VMMR3DECL(int) VMR3Suspend(PUVM pUVM, VMSUSPENDREASON enmReason);
+ VMMR3DECL(VMSUSPENDREASON) VMR3GetSuspendReason(PUVM);
+@@ -421,41 +421,41 @@ VMMR3_INT_DECL(int) VMR3LoadFromStre
+
+ VMMR3DECL(int) VMR3PowerOff(PUVM pUVM);
+ VMMR3DECL(int) VMR3Destroy(PUVM pUVM);
+-VMMR3_INT_DECL(void) VMR3Relocate(PVM pVM, RTGCINTPTR offDelta);
++VMMR3_INT_DECL(void) VMR3Relocate(vbox_PVM pVM, RTGCINTPTR offDelta);
+
+-VMMR3DECL(PVM) VMR3GetVM(PUVM pUVM);
+-VMMR3DECL(PUVM) VMR3GetUVM(PVM pVM);
++VMMR3DECL(vbox_PVM) VMR3GetVM(PUVM pUVM);
++VMMR3DECL(PUVM) VMR3GetUVM(vbox_PVM pVM);
+ VMMR3DECL(uint32_t) VMR3RetainUVM(PUVM pUVM);
+ VMMR3DECL(uint32_t) VMR3ReleaseUVM(PUVM pUVM);
+ VMMR3DECL(const char *) VMR3GetName(PUVM pUVM);
+ VMMR3DECL(PRTUUID) VMR3GetUuid(PUVM pUVM, PRTUUID pUuid);
+-VMMR3DECL(VMSTATE) VMR3GetState(PVM pVM);
++VMMR3DECL(VMSTATE) VMR3GetState(vbox_PVM pVM);
+ VMMR3DECL(VMSTATE) VMR3GetStateU(PUVM pUVM);
+ VMMR3DECL(const char *) VMR3GetStateName(VMSTATE enmState);
+ VMMR3DECL(int) VMR3AtStateRegister(PUVM pUVM, PFNVMATSTATE pfnAtState, void *pvUser);
+ VMMR3DECL(int) VMR3AtStateDeregister(PUVM pUVM, PFNVMATSTATE pfnAtState, void *pvUser);
+-VMMR3_INT_DECL(bool) VMR3TeleportedAndNotFullyResumedYet(PVM pVM);
++VMMR3_INT_DECL(bool) VMR3TeleportedAndNotFullyResumedYet(vbox_PVM pVM);
+ VMMR3DECL(int) VMR3AtErrorRegister(PUVM pUVM, PFNVMATERROR pfnAtError, void *pvUser);
+ VMMR3DECL(int) VMR3AtErrorDeregister(PUVM pUVM, PFNVMATERROR pfnAtError, void *pvUser);
+ VMMR3DECL(int) VMR3SetError(PUVM pUVM, int rc, RT_SRC_POS_DECL, const char *pszFormat, ...) RT_IPRT_FORMAT_ATTR(6, 7);
+ VMMR3DECL(int) VMR3SetErrorV(PUVM pUVM, int rc, RT_SRC_POS_DECL, const char *pszFormat, va_list va) RT_IPRT_FORMAT_ATTR(6, 0);
+-VMMR3_INT_DECL(void) VMR3SetErrorWorker(PVM pVM);
++VMMR3_INT_DECL(void) VMR3SetErrorWorker(vbox_PVM pVM);
+ VMMR3_INT_DECL(uint32_t) VMR3GetErrorCount(PUVM pUVM);
+ VMMR3DECL(int) VMR3AtRuntimeErrorRegister(PUVM pUVM, PFNVMATRUNTIMEERROR pfnAtRuntimeError, void *pvUser);
+ VMMR3DECL(int) VMR3AtRuntimeErrorDeregister(PUVM pUVM, PFNVMATRUNTIMEERROR pfnAtRuntimeError, void *pvUser);
+-VMMR3_INT_DECL(int) VMR3SetRuntimeErrorWorker(PVM pVM);
++VMMR3_INT_DECL(int) VMR3SetRuntimeErrorWorker(vbox_PVM pVM);
+ VMMR3_INT_DECL(uint32_t) VMR3GetRuntimeErrorCount(PUVM pUVM);
+
+ VMMR3DECL(int) VMR3ReqCallU(PUVM pUVM, VMCPUID idDstCpu, PVMREQ *ppReq, RTMSINTERVAL cMillies, uint32_t fFlags, PFNRT pfnFunction, unsigned cArgs, ...);
+ VMMR3DECL(int) VMR3ReqCallVU(PUVM pUVM, VMCPUID idDstCpu, PVMREQ *ppReq, RTMSINTERVAL cMillies, uint32_t fFlags, PFNRT pfnFunction, unsigned cArgs, va_list Args);
+-VMMR3_INT_DECL(int) VMR3ReqCallWait(PVM pVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);
++VMMR3_INT_DECL(int) VMR3ReqCallWait(vbox_PVM pVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);
+ VMMR3DECL(int) VMR3ReqCallWaitU(PUVM pUVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);
+-VMMR3DECL(int) VMR3ReqCallNoWait(PVM pVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);
++VMMR3DECL(int) VMR3ReqCallNoWait(vbox_PVM pVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);
+ VMMR3DECL(int) VMR3ReqCallNoWaitU(PUVM pUVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);
+-VMMR3_INT_DECL(int) VMR3ReqCallVoidWait(PVM pVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);
++VMMR3_INT_DECL(int) VMR3ReqCallVoidWait(vbox_PVM pVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);
+ VMMR3DECL(int) VMR3ReqCallVoidWaitU(PUVM pUVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);
+-VMMR3DECL(int) VMR3ReqCallVoidNoWait(PVM pVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);
+-VMMR3DECL(int) VMR3ReqPriorityCallWait(PVM pVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);
++VMMR3DECL(int) VMR3ReqCallVoidNoWait(vbox_PVM pVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);
++VMMR3DECL(int) VMR3ReqPriorityCallWait(vbox_PVM pVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);
+ VMMR3DECL(int) VMR3ReqPriorityCallWaitU(PUVM pUVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);
+ VMMR3DECL(int) VMR3ReqPriorityCallVoidWaitU(PUVM pUVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);
+ VMMR3DECL(int) VMR3ReqAlloc(PUVM pUVM, PVMREQ *ppReq, VMREQTYPE enmType, VMCPUID idDstCpu);
+@@ -473,16 +473,16 @@ VMMR3_INT_DECL(int) VMR3ReqProcessU(
+ /** @} */
+ VMMR3_INT_DECL(void) VMR3NotifyGlobalFFU(PUVM pUVM, uint32_t fFlags);
+ VMMR3_INT_DECL(void) VMR3NotifyCpuFFU(PUVMCPU pUVMCpu, uint32_t fFlags);
+-VMMR3DECL(int) VMR3NotifyCpuDeviceReady(PVM pVM, VMCPUID idCpu);
+-VMMR3_INT_DECL(int) VMR3WaitHalted(PVM pVM, PVMCPU pVCpu, bool fIgnoreInterrupts);
++VMMR3DECL(int) VMR3NotifyCpuDeviceReady(vbox_PVM pVM, VMCPUID idCpu);
++VMMR3_INT_DECL(int) VMR3WaitHalted(vbox_PVM pVM, PVMCPU pVCpu, bool fIgnoreInterrupts);
+ VMMR3_INT_DECL(int) VMR3WaitU(PUVMCPU pUVMCpu);
+-VMMR3DECL(int) VMR3WaitForDeviceReady(PVM pVM, VMCPUID idCpu);
++VMMR3DECL(int) VMR3WaitForDeviceReady(vbox_PVM pVM, VMCPUID idCpu);
+ VMMR3_INT_DECL(int) VMR3AsyncPdmNotificationWaitU(PUVMCPU pUVCpu);
+ VMMR3_INT_DECL(void) VMR3AsyncPdmNotificationWakeupU(PUVM pUVM);
+-VMMR3_INT_DECL(RTCPUID) VMR3GetVMCPUId(PVM pVM);
+-VMMR3_INT_DECL(bool) VMR3IsLongModeAllowed(PVM pVM);
++VMMR3_INT_DECL(RTCPUID) VMR3GetVMCPUId(vbox_PVM pVM);
++VMMR3_INT_DECL(bool) VMR3IsLongModeAllowed(vbox_PVM pVM);
+ VMMR3DECL(RTTHREAD) VMR3GetVMCPUThread(PUVM pUVM);
+-VMMR3DECL(RTNATIVETHREAD) VMR3GetVMCPUNativeThread(PVM pVM);
++VMMR3DECL(RTNATIVETHREAD) VMR3GetVMCPUNativeThread(vbox_PVM pVM);
+ VMMR3DECL(RTNATIVETHREAD) VMR3GetVMCPUNativeThreadU(PUVM pUVM);
+ VMMR3DECL(int) VMR3GetCpuCoreAndPackageIdFromCpuId(PUVM pUVM, VMCPUID idCpu, uint32_t *pidCpuCore, uint32_t *pidCpuPackage);
+ VMMR3DECL(int) VMR3HotUnplugCpu(PUVM pUVM, VMCPUID idCpu);
+@@ -506,4 +506,3 @@ RT_C_DECLS_END
+ /** @} */
+
+ #endif
+-
diff --git a/virtualbox/patches/patch-include_VBox_vmm_vmm.h b/virtualbox/patches/patch-include_VBox_vmm_vmm.h
new file mode 100644
index 0000000..2f481fa
--- /dev/null
+++ b/virtualbox/patches/patch-include_VBox_vmm_vmm.h
@@ -0,0 +1,151 @@
+$NetBSD$
+
+--- include/VBox/vmm/vmm.h.orig 2016-03-04 19:22:59.000000000 +0000
++++ include/VBox/vmm/vmm.h
+@@ -148,7 +148,7 @@ typedef FNVMMR0CALLRING3NOTIFICATION *PF
+ * @param pVCpu The cross context virtual CPU structure of the calling EMT.
+ * @param pvUser The user argument.
+ */
+-typedef DECLCALLBACK(VBOXSTRICTRC) FNVMMEMTRENDEZVOUS(PVM pVM, PVMCPU pVCpu, void *pvUser);
++typedef DECLCALLBACK(VBOXSTRICTRC) FNVMMEMTRENDEZVOUS(vbox_PVM pVM, PVMCPU pVCpu, void *pvUser);
+ /** Pointer to a rendezvous callback function. */
+ typedef FNVMMEMTRENDEZVOUS *PFNVMMEMTRENDEZVOUS;
+
+@@ -262,16 +262,16 @@ typedef struct VMM2USERMETHODS
+
+
+ VMM_INT_DECL(RTRCPTR) VMMGetStackRC(PVMCPU pVCpu);
+-VMMDECL(VMCPUID) VMMGetCpuId(PVM pVM);
+-VMMDECL(PVMCPU) VMMGetCpu(PVM pVM);
+-VMMDECL(PVMCPU) VMMGetCpu0(PVM pVM);
+-VMMDECL(PVMCPU) VMMGetCpuById(PVM pVM, VMCPUID idCpu);
++VMMDECL(VMCPUID) VMMGetCpuId(vbox_PVM pVM);
++VMMDECL(PVMCPU) VMMGetCpu(vbox_PVM pVM);
++VMMDECL(PVMCPU) VMMGetCpu0(vbox_PVM pVM);
++VMMDECL(PVMCPU) VMMGetCpuById(vbox_PVM pVM, VMCPUID idCpu);
+ VMMR3DECL(PVMCPU) VMMR3GetCpuByIdU(PUVM pVM, VMCPUID idCpu);
+ VMM_INT_DECL(uint32_t) VMMGetSvnRev(void);
+-VMM_INT_DECL(VMMSWITCHER) VMMGetSwitcher(PVM pVM);
++VMM_INT_DECL(VMMSWITCHER) VMMGetSwitcher(vbox_PVM pVM);
+ VMM_INT_DECL(bool) VMMIsInRing3Call(PVMCPU pVCpu);
+ VMM_INT_DECL(void) VMMTrashVolatileXMMRegs(void);
+-VMM_INT_DECL(int) VMMPatchHypercall(PVM pVM, void *pvBuf, size_t cbBuf, size_t *pcbWritten);
++VMM_INT_DECL(int) VMMPatchHypercall(vbox_PVM pVM, void *pvBuf, size_t cbBuf, size_t *pcbWritten);
+ VMM_INT_DECL(void) VMMHypercallsEnable(PVMCPU pVCpu);
+ VMM_INT_DECL(void) VMMHypercallsDisable(PVMCPU pVCpu);
+
+@@ -280,37 +280,37 @@ VMM_INT_DECL(void) VMMHypercall
+ /** @defgroup grp_vmm_api_r3 The VMM Host Context Ring 3 API
+ * @{
+ */
+-VMMR3_INT_DECL(int) VMMR3Init(PVM pVM);
+-VMMR3_INT_DECL(int) VMMR3InitR0(PVM pVM);
++VMMR3_INT_DECL(int) VMMR3Init(vbox_PVM pVM);
++VMMR3_INT_DECL(int) VMMR3InitR0(vbox_PVM pVM);
+ # ifdef VBOX_WITH_RAW_MODE
+-VMMR3_INT_DECL(int) VMMR3InitRC(PVM pVM);
++VMMR3_INT_DECL(int) VMMR3InitRC(vbox_PVM pVM);
+ # endif
+-VMMR3_INT_DECL(int) VMMR3InitCompleted(PVM pVM, VMINITCOMPLETED enmWhat);
+-VMMR3_INT_DECL(int) VMMR3Term(PVM pVM);
+-VMMR3_INT_DECL(void) VMMR3Relocate(PVM pVM, RTGCINTPTR offDelta);
+-VMMR3_INT_DECL(int) VMMR3UpdateLoggers(PVM pVM);
+-VMMR3DECL(const char *) VMMR3GetRZAssertMsg1(PVM pVM);
+-VMMR3DECL(const char *) VMMR3GetRZAssertMsg2(PVM pVM);
+-VMMR3_INT_DECL(int) VMMR3SelectSwitcher(PVM pVM, VMMSWITCHER enmSwitcher);
+-VMMR3_INT_DECL(RTR0PTR) VMMR3GetHostToGuestSwitcher(PVM pVM, VMMSWITCHER enmSwitcher);
+-VMMR3_INT_DECL(int) VMMR3HmRunGC(PVM pVM, PVMCPU pVCpu);
++VMMR3_INT_DECL(int) VMMR3InitCompleted(vbox_PVM pVM, VMINITCOMPLETED enmWhat);
++VMMR3_INT_DECL(int) VMMR3Term(vbox_PVM pVM);
++VMMR3_INT_DECL(void) VMMR3Relocate(vbox_PVM pVM, RTGCINTPTR offDelta);
++VMMR3_INT_DECL(int) VMMR3UpdateLoggers(vbox_PVM pVM);
++VMMR3DECL(const char *) VMMR3GetRZAssertMsg1(vbox_PVM pVM);
++VMMR3DECL(const char *) VMMR3GetRZAssertMsg2(vbox_PVM pVM);
++VMMR3_INT_DECL(int) VMMR3SelectSwitcher(vbox_PVM pVM, VMMSWITCHER enmSwitcher);
++VMMR3_INT_DECL(RTR0PTR) VMMR3GetHostToGuestSwitcher(vbox_PVM pVM, VMMSWITCHER enmSwitcher);
++VMMR3_INT_DECL(int) VMMR3HmRunGC(vbox_PVM pVM, PVMCPU pVCpu);
+ # ifdef VBOX_WITH_RAW_MODE
+-VMMR3_INT_DECL(int) VMMR3RawRunGC(PVM pVM, PVMCPU pVCpu);
+-VMMR3DECL(int) VMMR3ResumeHyper(PVM pVM, PVMCPU pVCpu);
+-VMMR3_INT_DECL(int) VMMR3GetImportRC(PVM pVM, const char *pszSymbol, PRTRCPTR pRCPtrValue);
+-VMMR3DECL(int) VMMR3CallRC(PVM pVM, RTRCPTR RCPtrEntry, unsigned cArgs, ...);
+-VMMR3DECL(int) VMMR3CallRCV(PVM pVM, RTRCPTR RCPtrEntry, unsigned cArgs, va_list args);
++VMMR3_INT_DECL(int) VMMR3RawRunGC(vbox_PVM pVM, PVMCPU pVCpu);
++VMMR3DECL(int) VMMR3ResumeHyper(vbox_PVM pVM, PVMCPU pVCpu);
++VMMR3_INT_DECL(int) VMMR3GetImportRC(vbox_PVM pVM, const char *pszSymbol, PRTRCPTR pRCPtrValue);
++VMMR3DECL(int) VMMR3CallRC(vbox_PVM pVM, RTRCPTR RCPtrEntry, unsigned cArgs, ...);
++VMMR3DECL(int) VMMR3CallRCV(vbox_PVM pVM, RTRCPTR RCPtrEntry, unsigned cArgs, va_list args);
+ # endif
+-VMMR3DECL(int) VMMR3CallR0(PVM pVM, uint32_t uOperation, uint64_t u64Arg, PSUPVMMR0REQHDR pReqHdr);
+-VMMR3DECL(void) VMMR3FatalDump(PVM pVM, PVMCPU pVCpu, int rcErr);
+-VMMR3_INT_DECL(void) VMMR3YieldSuspend(PVM pVM);
+-VMMR3_INT_DECL(void) VMMR3YieldStop(PVM pVM);
+-VMMR3_INT_DECL(void) VMMR3YieldResume(PVM pVM);
+-VMMR3_INT_DECL(void) VMMR3SendSipi(PVM pVM, VMCPUID idCpu, uint32_t uVector);
+-VMMR3_INT_DECL(void) VMMR3SendInitIpi(PVM pVM, VMCPUID idCpu);
+-VMMR3DECL(int) VMMR3RegisterPatchMemory(PVM pVM, RTGCPTR pPatchMem, unsigned cbPatchMem);
+-VMMR3DECL(int) VMMR3DeregisterPatchMemory(PVM pVM, RTGCPTR pPatchMem, unsigned cbPatchMem);
+-VMMR3DECL(int) VMMR3EmtRendezvous(PVM pVM, uint32_t fFlags, PFNVMMEMTRENDEZVOUS pfnRendezvous, void *pvUser);
++VMMR3DECL(int) VMMR3CallR0(vbox_PVM pVM, uint32_t uOperation, uint64_t u64Arg, PSUPVMMR0REQHDR pReqHdr);
++VMMR3DECL(void) VMMR3FatalDump(vbox_PVM pVM, PVMCPU pVCpu, int rcErr);
++VMMR3_INT_DECL(void) VMMR3YieldSuspend(vbox_PVM pVM);
++VMMR3_INT_DECL(void) VMMR3YieldStop(vbox_PVM pVM);
++VMMR3_INT_DECL(void) VMMR3YieldResume(vbox_PVM pVM);
++VMMR3_INT_DECL(void) VMMR3SendSipi(vbox_PVM pVM, VMCPUID idCpu, uint32_t uVector);
++VMMR3_INT_DECL(void) VMMR3SendInitIpi(vbox_PVM pVM, VMCPUID idCpu);
++VMMR3DECL(int) VMMR3RegisterPatchMemory(vbox_PVM pVM, RTGCPTR pPatchMem, unsigned cbPatchMem);
++VMMR3DECL(int) VMMR3DeregisterPatchMemory(vbox_PVM pVM, RTGCPTR pPatchMem, unsigned cbPatchMem);
++VMMR3DECL(int) VMMR3EmtRendezvous(vbox_PVM pVM, uint32_t fFlags, PFNVMMEMTRENDEZVOUS pfnRendezvous, void *pvUser);
+ VMMR3_INT_DECL(bool) VMMR3EmtRendezvousSetDisabled(PVMCPU pVCpu, bool fDisabled);
+ /** @defgroup grp_VMMR3EmtRendezvous_fFlags VMMR3EmtRendezvous flags
+ * @{ */
+@@ -335,8 +335,8 @@ VMMR3_INT_DECL(bool) VMMR3EmtRendezvo
+ /** The valid flags. */
+ #define VMMEMTRENDEZVOUS_FLAGS_VALID_MASK UINT32_C(0x0000000f)
+ /** @} */
+-VMMR3_INT_DECL(int) VMMR3EmtRendezvousFF(PVM pVM, PVMCPU pVCpu);
+-VMMR3_INT_DECL(int) VMMR3ReadR0Stack(PVM pVM, VMCPUID idCpu, RTHCUINTPTR R0Addr, void *pvBuf, size_t cbRead);
++VMMR3_INT_DECL(int) VMMR3EmtRendezvousFF(vbox_PVM pVM, PVMCPU pVCpu);
++VMMR3_INT_DECL(int) VMMR3ReadR0Stack(vbox_PVM pVM, VMCPUID idCpu, RTHCUINTPTR R0Addr, void *pvBuf, size_t cbRead);
+ /** @} */
+ #endif /* IN_RING3 */
+
+@@ -509,10 +509,10 @@ typedef struct GCFGMVALUEREQ
+ typedef GCFGMVALUEREQ *PGCFGMVALUEREQ;
+
+ #if defined(IN_RING0) || defined(DOXYGEN_RUNNING)
+-VMMR0DECL(int) VMMR0EntryInt(PVM pVM, VMMR0OPERATION enmOperation, void *pvArg);
+-VMMR0DECL(void) VMMR0EntryFast(PVM pVM, VMCPUID idCpu, VMMR0OPERATION enmOperation);
+-VMMR0DECL(int) VMMR0EntryEx(PVM pVM, VMCPUID idCpu, VMMR0OPERATION enmOperation, PSUPVMMR0REQHDR pReq, uint64_t u64Arg, PSUPDRVSESSION);
+-VMMR0_INT_DECL(int) VMMR0TermVM(PVM pVM, PGVM pGVM);
++VMMR0DECL(int) VMMR0EntryInt(vbox_PVM pVM, VMMR0OPERATION enmOperation, void *pvArg);
++VMMR0DECL(void) VMMR0EntryFast(vbox_PVM pVM, VMCPUID idCpu, VMMR0OPERATION enmOperation);
++VMMR0DECL(int) VMMR0EntryEx(vbox_PVM pVM, VMCPUID idCpu, VMMR0OPERATION enmOperation, PSUPVMMR0REQHDR pReq, uint64_t u64Arg, PSUPDRVSESSION);
++VMMR0_INT_DECL(int) VMMR0TermVM(vbox_PVM pVM, PGVM pGVM);
+ VMMR0_INT_DECL(bool) VMMR0IsLongJumpArmed(PVMCPU pVCpu);
+ VMMR0_INT_DECL(bool) VMMR0IsInRing3LongJump(PVMCPU pVCpu);
+ VMMR0_INT_DECL(int) VMMR0ThreadCtxHookCreateForEmt(PVMCPU pVCpu);
+@@ -538,9 +538,9 @@ VMMR0_INT_DECL(bool) VMMR0IsLogFlushDisa
+ /** @defgroup grp_vmm_api_rc The VMM Raw-Mode Context API
+ * @{
+ */
+-VMMRCDECL(int) VMMRCEntry(PVM pVM, unsigned uOperation, unsigned uArg, ...);
+-VMMRCDECL(void) VMMRCGuestToHost(PVM pVM, int rc);
+-VMMRCDECL(void) VMMRCLogFlushIfFull(PVM pVM);
++VMMRCDECL(int) VMMRCEntry(vbox_PVM pVM, unsigned uOperation, unsigned uArg, ...);
++VMMRCDECL(void) VMMRCGuestToHost(vbox_PVM pVM, int rc);
++VMMRCDECL(void) VMMRCLogFlushIfFull(vbox_PVM pVM);
+ /** @} */
+ #endif /* IN_RC */
+
+@@ -548,8 +548,8 @@ VMMRCDECL(void) VMMRCLogFlushIfFull(
+ /** @defgroup grp_vmm_api_rz The VMM Raw-Mode and Ring-0 Context API
+ * @{
+ */
+-VMMRZDECL(int) VMMRZCallRing3(PVM pVM, PVMCPU pVCpu, VMMCALLRING3 enmOperation, uint64_t uArg);
+-VMMRZDECL(int) VMMRZCallRing3NoCpu(PVM pVM, VMMCALLRING3 enmOperation, uint64_t uArg);
++VMMRZDECL(int) VMMRZCallRing3(vbox_PVM pVM, PVMCPU pVCpu, VMMCALLRING3 enmOperation, uint64_t uArg);
++VMMRZDECL(int) VMMRZCallRing3NoCpu(vbox_PVM pVM, VMMCALLRING3 enmOperation, uint64_t uArg);
+ VMMRZDECL(void) VMMRZCallRing3Disable(PVMCPU pVCpu);
+ VMMRZDECL(void) VMMRZCallRing3Enable(PVMCPU pVCpu);
+ VMMRZDECL(bool) VMMRZCallRing3IsEnabled(PVMCPU pVCpu);
diff --git a/virtualbox/patches/patch-src_VBox_Devices_Bus_SrvPciRawR0.cpp b/virtualbox/patches/patch-src_VBox_Devices_Bus_SrvPciRawR0.cpp
new file mode 100644
index 0000000..506df25
--- /dev/null
+++ b/virtualbox/patches/patch-src_VBox_Devices_Bus_SrvPciRawR0.cpp
@@ -0,0 +1,40 @@
+$NetBSD$
+
+--- src/VBox/Devices/Bus/SrvPciRawR0.cpp.orig 2016-03-04 19:25:48.000000000 +0000
++++ src/VBox/Devices/Bus/SrvPciRawR0.cpp
+@@ -169,7 +169,7 @@ PCIRAWR0DECL(void) PciRawR0Term(void)
+ /**
+ * Per-VM R0 module init.
+ */
+-PCIRAWR0DECL(int) PciRawR0InitVM(PVM pVM)
++PCIRAWR0DECL(int) PciRawR0InitVM(vbox_PVM pVM)
+ {
+ PRAWPCIFACTORY pFactory = NULL;
+ int rc;
+@@ -194,7 +194,7 @@ PCIRAWR0DECL(int) PciRawR0InitVM(PVM pV
+ /**
+ * Per-VM R0 module termination routine.
+ */
+-PCIRAWR0DECL(void) PciRawR0TermVM(PVM pVM)
++PCIRAWR0DECL(void) PciRawR0TermVM(vbox_PVM pVM)
+ {
+ PRAWPCIFACTORY pFactory = NULL;
+ int rc;
+@@ -518,7 +518,7 @@ static DECLCALLBACK(void) pcirawr0DevObj
+
+
+ static int pcirawr0OpenDevice(PSUPDRVSESSION pSession,
+- PVM pVM,
++ vbox_PVM pVM,
+ uint32_t HostDevice,
+ uint32_t fFlags,
+ PCIRAWDEVHANDLE *pHandle,
+@@ -925,7 +925,7 @@ static int pcirawr0PowerStateChange(PSUP
+ *
+ * @returns VBox status code.
+ */
+-PCIRAWR0DECL(int) PciRawR0ProcessReq(PSUPDRVSESSION pSession, PVM pVM, PPCIRAWSENDREQ pReq)
++PCIRAWR0DECL(int) PciRawR0ProcessReq(PSUPDRVSESSION pSession, vbox_PVM pVM, PPCIRAWSENDREQ pReq)
+ {
+ LogFlow(("PciRawR0ProcessReq: %d for %x\n", pReq->iRequest, pReq->TargetDevice));
+ int rc = VINF_SUCCESS;
diff --git a/virtualbox/patches/patch-src_VBox_VMM_VMMR3_SSM.cpp b/virtualbox/patches/patch-src_VBox_VMM_VMMR3_SSM.cpp
new file mode 100644
index 0000000..ffc1297
--- /dev/null
+++ b/virtualbox/patches/patch-src_VBox_VMM_VMMR3_SSM.cpp
@@ -0,0 +1,442 @@
+$NetBSD$
+
+--- src/VBox/VMM/VMMR3/SSM.cpp.orig 2016-03-04 19:30:12.000000000 +0000
++++ src/VBox/VMM/VMMR3/SSM.cpp
+@@ -456,7 +456,7 @@ typedef struct SSMHANDLE
+ SSMSTRM Strm;
+
+ /** Pointer to the VM. */
+- PVM pVM;
++ vbox_PVM pVM;
+ /** The current operation. */
+ SSMSTATE enmOp;
+ /** What to do after save completes. (move the enum) */
+@@ -877,12 +877,12 @@ static uint8_t const g_abZero[_1K] =
+ * Internal Functions *
+ *********************************************************************************************************************************/
+ #ifndef SSM_STANDALONE
+-static int ssmR3LazyInit(PVM pVM);
+-static DECLCALLBACK(int) ssmR3SelfLiveExec(PVM pVM, PSSMHANDLE pSSM, uint32_t uPass);
+-static DECLCALLBACK(int) ssmR3SelfSaveExec(PVM pVM, PSSMHANDLE pSSM);
+-static DECLCALLBACK(int) ssmR3SelfLoadExec(PVM pVM, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass);
+-static DECLCALLBACK(int) ssmR3LiveControlLoadExec(PVM pVM, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass);
+-static int ssmR3Register(PVM pVM, const char *pszName, uint32_t uInstance, uint32_t uVersion, size_t cbGuess, const char *pszBefore, PSSMUNIT *ppUnit);
++static int ssmR3LazyInit(vbox_PVM pVM);
++static DECLCALLBACK(int) ssmR3SelfLiveExec(vbox_PVM pVM, PSSMHANDLE pSSM, uint32_t uPass);
++static DECLCALLBACK(int) ssmR3SelfSaveExec(vbox_PVM pVM, PSSMHANDLE pSSM);
++static DECLCALLBACK(int) ssmR3SelfLoadExec(vbox_PVM pVM, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass);
++static DECLCALLBACK(int) ssmR3LiveControlLoadExec(vbox_PVM pVM, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass);
++static int ssmR3Register(vbox_PVM pVM, const char *pszName, uint32_t uInstance, uint32_t uVersion, size_t cbGuess, const char *pszBefore, PSSMUNIT *ppUnit);
+ static int ssmR3LiveControlEmit(PSSMHANDLE pSSM, long double lrdPct, uint32_t uPass);
+ #endif
+
+@@ -902,7 +902,7 @@ static int ssmR3DataRea
+ *
+ * @param pVM The cross context VM structure.
+ */
+-VMMR3_INT_DECL(void) SSMR3Term(PVM pVM)
++VMMR3_INT_DECL(void) SSMR3Term(vbox_PVM pVM)
+ {
+ if (pVM->ssm.s.fInitialized)
+ {
+@@ -918,7 +918,7 @@ VMMR3_INT_DECL(void) SSMR3Term(PVM pVM)
+ * @returns VBox status code.
+ * @param pVM The cross context VM structure.
+ */
+-static int ssmR3LazyInit(PVM pVM)
++static int ssmR3LazyInit(vbox_PVM pVM)
+ {
+ /*
+ * Register a saved state unit which we use to put the VirtualBox version,
+@@ -958,7 +958,7 @@ static int ssmR3LazyInit(PVM pVM)
+ * @param pSSM The SSM handle.
+ * @param uPass The data pass number.
+ */
+-static DECLCALLBACK(int) ssmR3SelfLiveExec(PVM pVM, PSSMHANDLE pSSM, uint32_t uPass)
++static DECLCALLBACK(int) ssmR3SelfLiveExec(vbox_PVM pVM, PSSMHANDLE pSSM, uint32_t uPass)
+ {
+ if (uPass == 0)
+ {
+@@ -980,7 +980,7 @@ static DECLCALLBACK(int) ssmR3SelfLiveEx
+ * @param pVM The cross context VM structure.
+ * @param pSSM The SSM handle.
+ */
+-static DECLCALLBACK(int) ssmR3SelfSaveExec(PVM pVM, PSSMHANDLE pSSM)
++static DECLCALLBACK(int) ssmR3SelfSaveExec(vbox_PVM pVM, PSSMHANDLE pSSM)
+ {
+ NOREF(pVM);
+
+@@ -1012,7 +1012,7 @@ static DECLCALLBACK(int) ssmR3SelfSaveEx
+ * @param uVersion The version (1).
+ * @param uPass The pass.
+ */
+-static DECLCALLBACK(int) ssmR3SelfLoadExec(PVM pVM, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass)
++static DECLCALLBACK(int) ssmR3SelfLoadExec(vbox_PVM pVM, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass)
+ {
+ AssertLogRelMsgReturn(uVersion == 1, ("%d\n", uVersion), VERR_SSM_UNSUPPORTED_DATA_UNIT_VERSION);
+ NOREF(pVM); NOREF(uPass);
+@@ -1076,7 +1076,7 @@ static DECLCALLBACK(int) ssmR3SelfLoadEx
+ * @param uVersion The version (1).
+ * @param uPass The pass.
+ */
+-static DECLCALLBACK(int) ssmR3LiveControlLoadExec(PVM pVM, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass)
++static DECLCALLBACK(int) ssmR3LiveControlLoadExec(vbox_PVM pVM, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass)
+ {
+ AssertLogRelMsgReturn(uVersion == 1, ("%d\n", uVersion), VERR_SSM_UNSUPPORTED_DATA_UNIT_VERSION);
+ NOREF(uPass);
+@@ -1115,7 +1115,7 @@ static DECLCALLBACK(int) ssmR3LiveContro
+ * @param ppUnit Where to store the inserted unit node.
+ * Caller must fill in the missing details.
+ */
+-static int ssmR3Register(PVM pVM, const char *pszName, uint32_t uInstance,
++static int ssmR3Register(vbox_PVM pVM, const char *pszName, uint32_t uInstance,
+ uint32_t uVersion, size_t cbGuess, const char *pszBefore, PSSMUNIT *ppUnit)
+ {
+ /*
+@@ -1235,7 +1235,7 @@ static int ssmR3Register(PVM pVM, const
+ * @param pfnLoadDone Done load callback, optional.
+ */
+ VMMR3_INT_DECL(int)
+-SSMR3RegisterDevice(PVM pVM, PPDMDEVINS pDevIns, const char *pszName,
++SSMR3RegisterDevice(vbox_PVM pVM, PPDMDEVINS pDevIns, const char *pszName,
+ uint32_t uInstance, uint32_t uVersion, size_t cbGuess, const char *pszBefore,
+ PFNSSMDEVLIVEPREP pfnLivePrep, PFNSSMDEVLIVEEXEC pfnLiveExec, PFNSSMDEVLIVEVOTE pfnLiveVote,
+ PFNSSMDEVSAVEPREP pfnSavePrep, PFNSSMDEVSAVEEXEC pfnSaveExec, PFNSSMDEVSAVEDONE pfnSaveDone,
+@@ -1289,7 +1289,7 @@ SSMR3RegisterDevice(PVM pVM, PPDMDEVINS
+ * @param pfnLoadDone Done load callback, optional.
+ */
+ VMMR3_INT_DECL(int)
+-SSMR3RegisterDriver(PVM pVM, PPDMDRVINS pDrvIns, const char *pszName, uint32_t uInstance, uint32_t uVersion, size_t cbGuess,
++SSMR3RegisterDriver(vbox_PVM pVM, PPDMDRVINS pDrvIns, const char *pszName, uint32_t uInstance, uint32_t uVersion, size_t cbGuess,
+ PFNSSMDRVLIVEPREP pfnLivePrep, PFNSSMDRVLIVEEXEC pfnLiveExec, PFNSSMDRVLIVEVOTE pfnLiveVote,
+ PFNSSMDRVSAVEPREP pfnSavePrep, PFNSSMDRVSAVEEXEC pfnSaveExec, PFNSSMDRVSAVEDONE pfnSaveDone,
+ PFNSSMDRVLOADPREP pfnLoadPrep, PFNSSMDRVLOADEXEC pfnLoadExec, PFNSSMDRVLOADDONE pfnLoadDone)
+@@ -1341,7 +1341,7 @@ SSMR3RegisterDriver(PVM pVM, PPDMDRVINS
+ * @param pfnLoadDone Done load callback, optional.
+ */
+ VMMR3_INT_DECL(int)
+-SSMR3RegisterUsb(PVM pVM, PPDMUSBINS pUsbIns, const char *pszName, uint32_t uInstance, uint32_t uVersion, size_t cbGuess,
++SSMR3RegisterUsb(vbox_PVM pVM, PPDMUSBINS pUsbIns, const char *pszName, uint32_t uInstance, uint32_t uVersion, size_t cbGuess,
+ PFNSSMUSBLIVEPREP pfnLivePrep, PFNSSMUSBLIVEEXEC pfnLiveExec, PFNSSMUSBLIVEVOTE pfnLiveVote,
+ PFNSSMUSBSAVEPREP pfnSavePrep, PFNSSMUSBSAVEEXEC pfnSaveExec, PFNSSMUSBSAVEDONE pfnSaveDone,
+ PFNSSMUSBLOADPREP pfnLoadPrep, PFNSSMUSBLOADEXEC pfnLoadExec, PFNSSMUSBLOADDONE pfnLoadDone)
+@@ -1391,7 +1391,7 @@ SSMR3RegisterUsb(PVM pVM, PPDMUSBINS pUs
+ * @param pfnLoadExec Execute load callback, optional.
+ * @param pfnLoadDone Done load callback, optional.
+ */
+-VMMR3DECL(int) SSMR3RegisterInternal(PVM pVM, const char *pszName, uint32_t uInstance, uint32_t uVersion, size_t cbGuess,
++VMMR3DECL(int) SSMR3RegisterInternal(vbox_PVM pVM, const char *pszName, uint32_t uInstance, uint32_t uVersion, size_t cbGuess,
+ PFNSSMINTLIVEPREP pfnLivePrep, PFNSSMINTLIVEEXEC pfnLiveExec, PFNSSMINTLIVEVOTE pfnLiveVote,
+ PFNSSMINTSAVEPREP pfnSavePrep, PFNSSMINTSAVEEXEC pfnSaveExec, PFNSSMINTSAVEDONE pfnSaveDone,
+ PFNSSMINTLOADPREP pfnLoadPrep, PFNSSMINTLOADEXEC pfnLoadExec, PFNSSMINTLOADDONE pfnLoadDone)
+@@ -1447,7 +1447,7 @@ VMMR3DECL(int) SSMR3RegisterExternal(PUV
+ PFNSSMEXTLOADPREP pfnLoadPrep, PFNSSMEXTLOADEXEC pfnLoadExec, PFNSSMEXTLOADDONE pfnLoadDone, void *pvUser)
+ {
+ UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
+- PVM pVM = pUVM->pVM;
++ vbox_PVM pVM = pUVM->pVM;
+ VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
+
+ PSSMUNIT pUnit;
+@@ -1474,7 +1474,7 @@ VMMR3DECL(int) SSMR3RegisterExternal(PUV
+ * @callback_method_impl{FNSSMINTLOADEXEC,
+ * Stub that skips the whole unit (see SSMR3RegisterStub).}
+ */
+-static DECLCALLBACK(int) ssmR3LoadExecStub(PVM pVM, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass)
++static DECLCALLBACK(int) ssmR3LoadExecStub(vbox_PVM pVM, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass)
+ {
+ NOREF(pVM); NOREF(uVersion); NOREF(uPass);
+ return SSMR3SkipToEndOfUnit(pSSM);
+@@ -1492,7 +1492,7 @@ static DECLCALLBACK(int) ssmR3LoadExecSt
+ * @param pszName Data unit name.
+ * @param uInstance Instance number.
+ */
+-VMMR3DECL(int) SSMR3RegisterStub(PVM pVM, const char *pszName, uint32_t uInstance)
++VMMR3DECL(int) SSMR3RegisterStub(vbox_PVM pVM, const char *pszName, uint32_t uInstance)
+ {
+ return SSMR3RegisterInternal(pVM, pszName, uInstance, UINT32_MAX, 0,
+ NULL, NULL, NULL,
+@@ -1514,7 +1514,7 @@ VMMR3DECL(int) SSMR3RegisterStub(PVM pVM
+ * This must together with the name be unique.
+ * @remark Only for dynamic data units and dynamic unloaded modules.
+ */
+-VMMR3_INT_DECL(int) SSMR3DeregisterDevice(PVM pVM, PPDMDEVINS pDevIns, const char *pszName, uint32_t uInstance)
++VMMR3_INT_DECL(int) SSMR3DeregisterDevice(vbox_PVM pVM, PPDMDEVINS pDevIns, const char *pszName, uint32_t uInstance)
+ {
+ /*
+ * Validate input.
+@@ -1590,7 +1590,7 @@ VMMR3_INT_DECL(int) SSMR3DeregisterDevic
+ * This must together with the name be unique. Ignored if pszName is NULL.
+ * @remark Only for dynamic data units and dynamic unloaded modules.
+ */
+-VMMR3_INT_DECL(int) SSMR3DeregisterDriver(PVM pVM, PPDMDRVINS pDrvIns, const char *pszName, uint32_t uInstance)
++VMMR3_INT_DECL(int) SSMR3DeregisterDriver(vbox_PVM pVM, PPDMDRVINS pDrvIns, const char *pszName, uint32_t uInstance)
+ {
+ /*
+ * Validate input.
+@@ -1664,7 +1664,7 @@ VMMR3_INT_DECL(int) SSMR3DeregisterDrive
+ * This must together with the name be unique. Ignored if pszName is NULL.
+ * @remark Only for dynamic data units and dynamic unloaded modules.
+ */
+-VMMR3_INT_DECL(int) SSMR3DeregisterUsb(PVM pVM, PPDMUSBINS pUsbIns, const char *pszName, uint32_t uInstance)
++VMMR3_INT_DECL(int) SSMR3DeregisterUsb(vbox_PVM pVM, PPDMUSBINS pUsbIns, const char *pszName, uint32_t uInstance)
+ {
+ /*
+ * Validate input.
+@@ -1731,7 +1731,7 @@ VMMR3_INT_DECL(int) SSMR3DeregisterUsb(P
+ * @param pszName Data unit name.
+ * @remark Only for dynamic data units.
+ */
+-static int ssmR3DeregisterByNameAndType(PVM pVM, const char *pszName, SSMUNITTYPE enmType)
++static int ssmR3DeregisterByNameAndType(vbox_PVM pVM, const char *pszName, SSMUNITTYPE enmType)
+ {
+ /*
+ * Validate input.
+@@ -1787,7 +1787,7 @@ static int ssmR3DeregisterByNameAndType(
+ * @param pszName Data unit name.
+ * @remark Only for dynamic data units.
+ */
+-VMMR3DECL(int) SSMR3DeregisterInternal(PVM pVM, const char *pszName)
++VMMR3DECL(int) SSMR3DeregisterInternal(vbox_PVM pVM, const char *pszName)
+ {
+ return ssmR3DeregisterByNameAndType(pVM, pszName, SSMUNITTYPE_INTERNAL);
+ }
+@@ -1804,7 +1804,7 @@ VMMR3DECL(int) SSMR3DeregisterInternal(P
+ VMMR3DECL(int) SSMR3DeregisterExternal(PUVM pUVM, const char *pszName)
+ {
+ UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
+- PVM pVM = pUVM->pVM;
++ vbox_PVM pVM = pUVM->pVM;
+ VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
+
+ return ssmR3DeregisterByNameAndType(pVM, pszName, SSMUNITTYPE_EXTERNAL);
+@@ -3206,7 +3206,7 @@ static void ssmR3ProgressByByte(PSSMHAND
+ * @param pSSM The saved state handle. (SSMHANDLE::rc may be set.)
+ * @param fCancellable The new state.
+ */
+-static void ssmR3SetCancellable(PVM pVM, PSSMHANDLE pSSM, bool fCancellable)
++static void ssmR3SetCancellable(vbox_PVM pVM, PSSMHANDLE pSSM, bool fCancellable)
+ {
+ RTCritSectEnter(&pVM->ssm.s.CancelCritSect);
+ if (fCancellable)
+@@ -4508,7 +4508,7 @@ DECLINLINE(void) ssmR3UnitCritSectLeave(
+ * @param pVM The cross context VM structure.
+ * @param pSSM The saved state handle.
+ */
+-static int ssmR3SaveDoDoneRun(PVM pVM, PSSMHANDLE pSSM)
++static int ssmR3SaveDoDoneRun(vbox_PVM pVM, PSSMHANDLE pSSM)
+ {
+ VM_ASSERT_EMT0(pVM);
+
+@@ -4569,7 +4569,7 @@ static int ssmR3SaveDoDoneRun(PVM pVM, P
+ * @param pVM The cross context VM structure.
+ * @param pSSM The saved state handle.
+ */
+-static int ssmR3SaveDoClose(PVM pVM, PSSMHANDLE pSSM)
++static int ssmR3SaveDoClose(vbox_PVM pVM, PSSMHANDLE pSSM)
+ {
+ VM_ASSERT_EMT0(pVM);
+ pVM->ssm.s.uPass = 0;
+@@ -4642,7 +4642,7 @@ VMMR3_INT_DECL(int) SSMR3LiveDone(PSSMHA
+ * Validate input.
+ */
+ AssertPtrReturn(pSSM, VERR_INVALID_POINTER);
+- PVM pVM = pSSM->pVM;
++ vbox_PVM pVM = pSSM->pVM;
+ VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
+ VM_ASSERT_EMT0(pVM);
+ AssertMsgReturn( pSSM->enmAfter == SSMAFTER_DESTROY
+@@ -4669,7 +4669,7 @@ VMMR3_INT_DECL(int) SSMR3LiveDone(PSSMHA
+ * @param pSSM The SSM handle.
+ * @param pcEntries Where to return the number of directory entries.
+ */
+-static int ssmR3WriteDirectory(PVM pVM, PSSMHANDLE pSSM, uint32_t *pcEntries)
++static int ssmR3WriteDirectory(vbox_PVM pVM, PSSMHANDLE pSSM, uint32_t *pcEntries)
+ {
+ VM_ASSERT_EMT0(pVM);
+
+@@ -4723,7 +4723,7 @@ static int ssmR3WriteDirectory(PVM pVM,
+ * @param pVM The cross context VM structure.
+ * @param pSSM The saved state handle.
+ */
+-static int ssmR3SaveDoFinalization(PVM pVM, PSSMHANDLE pSSM)
++static int ssmR3SaveDoFinalization(vbox_PVM pVM, PSSMHANDLE pSSM)
+ {
+ VM_ASSERT_EMT0(pVM);
+ Assert(RT_SUCCESS(pSSM->rc));
+@@ -4814,7 +4814,7 @@ static void ssmR3ProgressByUnit(PSSMHAND
+ * @param pVM The cross context VM structure.
+ * @param pSSM The saved state handle.
+ */
+-static int ssmR3SaveDoExecRun(PVM pVM, PSSMHANDLE pSSM)
++static int ssmR3SaveDoExecRun(vbox_PVM pVM, PSSMHANDLE pSSM)
+ {
+ VM_ASSERT_EMT0(pVM);
+ AssertRC(pSSM->rc);
+@@ -4959,7 +4959,7 @@ static int ssmR3SaveDoExecRun(PVM pVM, P
+ * @param pVM The cross context VM structure.
+ * @param pSSM The saved state handle.
+ */
+-static int ssmR3SaveDoPrepRun(PVM pVM, PSSMHANDLE pSSM)
++static int ssmR3SaveDoPrepRun(vbox_PVM pVM, PSSMHANDLE pSSM)
+ {
+ VM_ASSERT_EMT0(pVM);
+ Assert(RT_SUCCESS(pSSM->rc));
+@@ -5027,7 +5027,7 @@ static int ssmR3SaveDoPrepRun(PVM pVM, P
+ *
+ * @thread EMT(0)
+ */
+-static int ssmR3SaveDoCommon(PVM pVM, PSSMHANDLE pSSM)
++static int ssmR3SaveDoCommon(vbox_PVM pVM, PSSMHANDLE pSSM)
+ {
+ VM_ASSERT_EMT0(pVM);
+
+@@ -5067,7 +5067,7 @@ VMMR3_INT_DECL(int) SSMR3LiveDoStep2(PSS
+ * Validate input.
+ */
+ AssertPtrReturn(pSSM, VERR_INVALID_POINTER);
+- PVM pVM = pSSM->pVM;
++ vbox_PVM pVM = pSSM->pVM;
+ VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
+ VM_ASSERT_EMT0(pVM);
+ AssertMsgReturn( pSSM->enmAfter == SSMAFTER_DESTROY
+@@ -5092,7 +5092,7 @@ VMMR3_INT_DECL(int) SSMR3LiveDoStep2(PSS
+ * @param pVM The cross context VM structure.
+ * @param pSSM The SSM handle.
+ */
+-static int ssmR3WriteHeaderAndClearPerUnitData(PVM pVM, PSSMHANDLE pSSM)
++static int ssmR3WriteHeaderAndClearPerUnitData(vbox_PVM pVM, PSSMHANDLE pSSM)
+ {
+ /*
+ * Write the header.
+@@ -5148,7 +5148,7 @@ static int ssmR3WriteHeaderAndClearPerUn
+ * handle upon successful return. Free it using
+ * RTMemFree after closing the stream.
+ */
+-static int ssmR3SaveDoCreateFile(PVM pVM, const char *pszFilename, PCSSMSTRMOPS pStreamOps, void *pvStreamOpsUser,
++static int ssmR3SaveDoCreateFile(vbox_PVM pVM, const char *pszFilename, PCSSMSTRMOPS pStreamOps, void *pvStreamOpsUser,
+ SSMAFTER enmAfter, PFNVMPROGRESS pfnProgress, void *pvProgressUser, PSSMHANDLE *ppSSM)
+ {
+ PSSMHANDLE pSSM = (PSSMHANDLE)RTMemAllocZ(sizeof(*pSSM));
+@@ -5212,7 +5212,7 @@ static int ssmR3SaveDoCreateFile(PVM pVM
+ *
+ * @thread EMT
+ */
+-VMMR3DECL(int) SSMR3Save(PVM pVM, const char *pszFilename, PCSSMSTRMOPS pStreamOps, void *pvStreamOpsUser,
++VMMR3DECL(int) SSMR3Save(vbox_PVM pVM, const char *pszFilename, PCSSMSTRMOPS pStreamOps, void *pvStreamOpsUser,
+ SSMAFTER enmAfter, PFNVMPROGRESS pfnProgress, void *pvUser)
+ {
+ LogFlow(("SSMR3Save: pszFilename=%p:{%s} enmAfter=%d pfnProgress=%p pvUser=%p\n", pszFilename, pszFilename, enmAfter, pfnProgress, pvUser));
+@@ -5299,7 +5299,7 @@ VMMR3DECL(void) SSMR3HandleReportLivePer
+ * @param pSSM The saved state handle.
+ * @param uPass The current pass.
+ */
+-static int ssmR3LiveDoVoteRun(PVM pVM, PSSMHANDLE pSSM, uint32_t uPass)
++static int ssmR3LiveDoVoteRun(vbox_PVM pVM, PSSMHANDLE pSSM, uint32_t uPass)
+ {
+ int rcRet = VINF_SUCCESS;
+ AssertRC(pSSM->rc);
+@@ -5405,7 +5405,7 @@ static int ssmR3LiveDoVoteRun(PVM pVM, P
+ * @param pSSM The saved state handle.
+ * @param uPass The current pass.
+ */
+-static int ssmR3LiveDoExecRun(PVM pVM, PSSMHANDLE pSSM, uint32_t uPass)
++static int ssmR3LiveDoExecRun(vbox_PVM pVM, PSSMHANDLE pSSM, uint32_t uPass)
+ {
+ AssertRC(pSSM->rc);
+ pSSM->rc = VINF_SUCCESS;
+@@ -5536,7 +5536,7 @@ static int ssmR3LiveDoExecRun(PVM pVM, P
+ * @param pVM The cross context VM structure.
+ * @param pSSM The saved state handle.
+ */
+-static int ssmR3DoLiveExecVoteLoop(PVM pVM, PSSMHANDLE pSSM)
++static int ssmR3DoLiveExecVoteLoop(vbox_PVM pVM, PSSMHANDLE pSSM)
+ {
+ /*
+ * Calc the max saved state size before we should give up because of insane
+@@ -5608,7 +5608,7 @@ static int ssmR3DoLiveExecVoteLoop(PVM p
+ * @param pVM The cross context VM structure.
+ * @param pSSM The saved state handle.
+ */
+-static int ssmR3DoLivePrepRun(PVM pVM, PSSMHANDLE pSSM)
++static int ssmR3DoLivePrepRun(vbox_PVM pVM, PSSMHANDLE pSSM)
+ {
+ /*
+ * Do the prepare run.
+@@ -5686,7 +5686,7 @@ VMMR3_INT_DECL(int) SSMR3LiveDoStep1(PSS
+ * Validate input.
+ */
+ AssertPtrReturn(pSSM, VERR_INVALID_POINTER);
+- PVM pVM = pSSM->pVM;
++ vbox_PVM pVM = pSSM->pVM;
+ VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
+ VM_ASSERT_OTHER_THREAD(pVM);
+ AssertMsgReturn( pSSM->enmAfter == SSMAFTER_DESTROY
+@@ -5731,7 +5731,7 @@ VMMR3_INT_DECL(int) SSMR3LiveDoStep1(PSS
+ *
+ * @thread EMT0
+ */
+-VMMR3_INT_DECL(int) SSMR3LiveSave(PVM pVM, uint32_t cMsMaxDowntime,
++VMMR3_INT_DECL(int) SSMR3LiveSave(vbox_PVM pVM, uint32_t cMsMaxDowntime,
+ const char *pszFilename, PCSSMSTRMOPS pStreamOps, void *pvStreamOpsUser,
+ SSMAFTER enmAfter, PFNVMPROGRESS pfnProgress, void *pvProgressUser,
+ PSSMHANDLE *ppSSM)
+@@ -8011,7 +8011,7 @@ static int ssmR3HeaderAndValidate(PSSMHA
+ * completely initialized on success.
+ * @param cBuffers The number of stream buffers.
+ */
+-static int ssmR3OpenFile(PVM pVM, const char *pszFilename, PCSSMSTRMOPS pStreamOps, void *pvUser,
++static int ssmR3OpenFile(vbox_PVM pVM, const char *pszFilename, PCSSMSTRMOPS pStreamOps, void *pvUser,
+ bool fChecksumIt, bool fChecksumOnRead, uint32_t cBuffers, PSSMHANDLE pSSM)
+ {
+ /*
+@@ -8283,7 +8283,7 @@ static void ssmR3StrmLogUnitContent(PSSM
+ * @param pszName Data unit name.
+ * @param uInstance The data unit instance id.
+ */
+-static PSSMUNIT ssmR3Find(PVM pVM, const char *pszName, uint32_t uInstance)
++static PSSMUNIT ssmR3Find(vbox_PVM pVM, const char *pszName, uint32_t uInstance)
+ {
+ size_t cchName = strlen(pszName);
+ PSSMUNIT pUnit = pVM->ssm.s.pHead;
+@@ -8303,7 +8303,7 @@ static PSSMUNIT ssmR3Find(PVM pVM, const
+ * @param pVM The cross context VM structure.
+ * @param pSSM The saved state handle.
+ */
+-static int ssmR3LoadExecV1(PVM pVM, PSSMHANDLE pSSM)
++static int ssmR3LoadExecV1(vbox_PVM pVM, PSSMHANDLE pSSM)
+ {
+ int rc;
+ char *pszName = NULL;
+@@ -8566,7 +8566,7 @@ static int ssmR3LoadDirectoryAndFooter(P
+ * @param pVM The cross context VM structure.
+ * @param pSSM The saved state handle.
+ */
+-static int ssmR3LoadExecV2(PVM pVM, PSSMHANDLE pSSM)
++static int ssmR3LoadExecV2(vbox_PVM pVM, PSSMHANDLE pSSM)
+ {
+ pSSM->enmOp = SSMSTATE_LOAD_EXEC;
+ for (;;)
+@@ -8757,7 +8757,7 @@ static int ssmR3LoadExecV2(PVM pVM, PSSM
+ *
+ * @thread EMT
+ */
+-VMMR3DECL(int) SSMR3Load(PVM pVM, const char *pszFilename, PCSSMSTRMOPS pStreamOps, void *pvStreamOpsUser,
++VMMR3DECL(int) SSMR3Load(vbox_PVM pVM, const char *pszFilename, PCSSMSTRMOPS pStreamOps, void *pvStreamOpsUser,
+ SSMAFTER enmAfter, PFNVMPROGRESS pfnProgress, void *pvProgressUser)
+ {
+ LogFlow(("SSMR3Load: pszFilename=%p:{%s} pStreamOps=%p pvStreamOpsUser=%p enmAfter=%d pfnProgress=%p pvProgressUser=%p\n",
+@@ -9641,7 +9641,7 @@ VMMR3DECL(const char *) SSMR3HandleHostO
+ VMMR3DECL(int) SSMR3Cancel(PUVM pUVM)
+ {
+ UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
+- PVM pVM = pUVM->pVM;
++ vbox_PVM pVM = pUVM->pVM;
+ VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
+
+ int rc = RTCritSectEnter(&pVM->ssm.s.CancelCritSect);
+@@ -9671,4 +9671,3 @@ VMMR3DECL(int) SSMR3Cancel(PUVM pUVM)
+ return rc;
+ }
+ #endif /* !SSM_STANDALONE */
+-
diff --git a/virtualbox/patches/patch-src_VBox_VMM_include_CPUMInternal.h b/virtualbox/patches/patch-src_VBox_VMM_include_CPUMInternal.h
new file mode 100644
index 0000000..a674e90
--- /dev/null
+++ b/virtualbox/patches/patch-src_VBox_VMM_include_CPUMInternal.h
@@ -0,0 +1,46 @@
+$NetBSD$
+
+--- src/VBox/VMM/include/CPUMInternal.h.orig 2016-03-04 19:30:14.000000000 +0000
++++ src/VBox/VMM/include/CPUMInternal.h
+@@ -506,24 +506,24 @@ typedef CPUMCPU *PCPUMCPU;
+ #ifndef VBOX_FOR_DTRACE_LIB
+ RT_C_DECLS_BEGIN
+
+-PCPUMCPUIDLEAF cpumCpuIdGetLeaf(PVM pVM, uint32_t uLeaf);
+-PCPUMCPUIDLEAF cpumCpuIdGetLeafEx(PVM pVM, uint32_t uLeaf, uint32_t uSubLeaf, bool *pfExactSubLeafHit);
++PCPUMCPUIDLEAF cpumCpuIdGetLeaf(vbox_PVM pVM, uint32_t uLeaf);
++PCPUMCPUIDLEAF cpumCpuIdGetLeafEx(vbox_PVM pVM, uint32_t uLeaf, uint32_t uSubLeaf, bool *pfExactSubLeafHit);
+
+ #ifdef IN_RING3
+-int cpumR3DbgInit(PVM pVM);
++int cpumR3DbgInit(vbox_PVM pVM);
+ int cpumR3CpuIdExplodeFeatures(PCCPUMCPUIDLEAF paLeaves, uint32_t cLeaves, PCPUMFEATURES pFeatures);
+-int cpumR3InitCpuIdAndMsrs(PVM pVM);
+-void cpumR3SaveCpuId(PVM pVM, PSSMHANDLE pSSM);
+-int cpumR3LoadCpuId(PVM pVM, PSSMHANDLE pSSM, uint32_t uVersion);
+-int cpumR3LoadCpuIdPre32(PVM pVM, PSSMHANDLE pSSM, uint32_t uVersion);
+-DECLCALLBACK(void) cpumR3CpuIdInfo(PVM pVM, PCDBGFINFOHLP pHlp, const char *pszArgs);
++int cpumR3InitCpuIdAndMsrs(vbox_PVM pVM);
++void cpumR3SaveCpuId(vbox_PVM pVM, PSSMHANDLE pSSM);
++int cpumR3LoadCpuId(vbox_PVM pVM, PSSMHANDLE pSSM, uint32_t uVersion);
++int cpumR3LoadCpuIdPre32(vbox_PVM pVM, PSSMHANDLE pSSM, uint32_t uVersion);
++DECLCALLBACK(void) cpumR3CpuIdInfo(vbox_PVM pVM, PCDBGFINFOHLP pHlp, const char *pszArgs);
+
+ int cpumR3DbGetCpuInfo(const char *pszName, PCPUMINFO pInfo);
+-int cpumR3MsrRangesInsert(PVM pVM, PCPUMMSRRANGE *ppaMsrRanges, uint32_t *pcMsrRanges, PCCPUMMSRRANGE pNewRange);
+-int cpumR3MsrApplyFudge(PVM pVM);
+-int cpumR3MsrRegStats(PVM pVM);
++int cpumR3MsrRangesInsert(vbox_PVM pVM, PCPUMMSRRANGE *ppaMsrRanges, uint32_t *pcMsrRanges, PCCPUMMSRRANGE pNewRange);
++int cpumR3MsrApplyFudge(vbox_PVM pVM);
++int cpumR3MsrRegStats(vbox_PVM pVM);
+ int cpumR3MsrStrictInitChecks(void);
+-PCPUMMSRRANGE cpumLookupMsrRange(PVM pVM, uint32_t idMsr);
++PCPUMMSRRANGE cpumLookupMsrRange(vbox_PVM pVM, uint32_t idMsr);
+ #endif
+
+ #ifdef IN_RC
+@@ -551,4 +551,3 @@ RT_C_DECLS_END
+ /** @} */
+
+ #endif
+-
Home |
Main Index |
Thread Index |
Old Index