diff options
Diffstat (limited to 'src/VBox/HostDrivers/Support')
67 files changed, 518 insertions, 194 deletions
diff --git a/src/VBox/HostDrivers/Support/Makefile.kmk b/src/VBox/HostDrivers/Support/Makefile.kmk index 7b89936d2..77cd26fe8 100644 --- a/src/VBox/HostDrivers/Support/Makefile.kmk +++ b/src/VBox/HostDrivers/Support/Makefile.kmk @@ -1,4 +1,4 @@ -# $Id: Makefile.kmk $ +# $Id: Makefile.kmk 38004 2011-07-18 10:17:18Z vboxsync $ ## @file # Sub-Makefile for the support library and the drivers/modules/kexts it uses. # @@ -219,7 +219,7 @@ VBoxDrv-inf_SOURCES += \ $(PATH_TARGET)/VBoxDrvCat.dir/VBoxDrv.sys \ $(PATH_TARGET)/VBoxDrvCat.dir/VBoxDrv.cat -$(PATH_TARGET)/VBoxDrvCat.dir/VBoxDrv.sys: $$(TARGET_VBoxDrv) | $$(dir $$@) +$(PATH_TARGET)/VBoxDrvCat.dir/VBoxDrv.sys: $$(VBoxDrv_1_TARGET) | $$(dir $$@) $(INSTALL) -m 644 $< $(@D) $(PATH_TARGET)/VBoxDrvCat.dir/VBoxDrv.cat: \ @@ -267,7 +267,7 @@ vboxdrv-mod_SOURCES += \ vboxdrv-mod_CLEAN = \ $(vboxdrv-mod_0_OUTDIR)/Makefile -vboxdrv-sh_INST = bin/src/vboxdrv +vboxdrv-sh_INST = bin/src/vboxdrv/ vboxdrv-sh_MODE = a+rx,u+w vboxdrv-sh_SOURCES = $(subst ",,$(FILES_VBOXDRV_BIN)) #" vboxdrv-sh_SOURCES += \ @@ -377,7 +377,7 @@ VBoxDrv_SOURCES = \ os2/SUPDrvA-os2.asm \ os2/SUPDrv-os2.def VBoxDrv_LIBS = \ - $(TARGET_VBoxDrvLib) \ + $(VBoxDrvLib_1_TARGET) \ $(PATH_LIB)/RuntimeR0Drv$(VBOX_SUFF_LIB) \ $(VBOX_GCC_LIBGCC) \ end @@ -441,11 +441,13 @@ ifeq ($(KBUILD_TARGET),solaris) # vboxdrv.o - The Solaris Kernel Module. # vboxdrv_TEMPLATE = VBOXR0DRV -vboxdrv_DEFS = IN_RT_R0 IN_SUP_R0 SUPDRV_WITH_RELEASE_LOGGER +vboxdrv_DEFS = IN_RT_R0 IN_SUP_R0 SUPDRV_WITH_RELEASE_LOGGER VBOX_SVN_REV=$(VBOX_SVN_REV) ifdef VBOX_WITH_NETFLT vboxdrv_DEFS += VBOX_WITH_NETFLT endif -vboxdrv_DEFS += VBOX_SVN_REV=$(VBOX_SVN_REV) +ifdef VBOX_WITH_NATIVE_SOLARIS_LOADING + vboxdrv_DEFS += VBOX_WITH_NATIVE_SOLARIS_LOADING +endif vboxdrv_DEPS += $(VBOX_SVN_REV_KMK) vboxdrv_INCS := $(PATH_SUB_CURRENT) vboxdrv_LIBS = $(PATH_LIB)/RuntimeR0Drv$(VBOX_SUFF_LIB) @@ -453,6 +455,7 @@ vboxdrv_SOURCES = \ $(KBUILD_TARGET)/SUPDrv-$(KBUILD_TARGET).c \ SUPDrv.c \ SUPDrvSem.c +vboxdrv_LDFLAGS += -N misc/ctf endif # solaris diff --git a/src/VBox/HostDrivers/Support/SUPDrv-dtrace.d b/src/VBox/HostDrivers/Support/SUPDrv-dtrace.d index 2a0535cc4..4a2aaf270 100644 --- a/src/VBox/HostDrivers/Support/SUPDrv-dtrace.d +++ b/src/VBox/HostDrivers/Support/SUPDrv-dtrace.d @@ -1,4 +1,4 @@ -/* $Id: SUPDrv-dtrace.d $ */ +/* $Id: SUPDrv-dtrace.d 33375 2010-10-24 12:29:42Z vboxsync $ */ /** @file * SUPDrv - Static dtrace probes */ diff --git a/src/VBox/HostDrivers/Support/SUPDrv.c b/src/VBox/HostDrivers/Support/SUPDrv.c index bec56c2ac..683904bc1 100644 --- a/src/VBox/HostDrivers/Support/SUPDrv.c +++ b/src/VBox/HostDrivers/Support/SUPDrv.c @@ -1,4 +1,4 @@ -/* $Revision: 71409 $ */ +/* $Revision: 37955 $ */ /** @file * VBoxDrv - The VirtualBox Support Driver - Common code. */ @@ -54,13 +54,13 @@ # include <iprt/rand.h> # include <iprt/path.h> #endif +#include <iprt/x86.h> #include <VBox/param.h> #include <VBox/log.h> #include <VBox/err.h> #include <VBox/vmm/hwacc_svm.h> #include <VBox/vmm/hwacc_vmx.h> -#include <VBox/x86.h> #ifdef VBOX_WITH_DTRACE # include "SUPDrv-dtrace.h" @@ -278,7 +278,6 @@ static SUPFUNC g_aFunctions[] = { "RTThreadNativeSelf", (void *)RTThreadNativeSelf }, { "RTThreadSleep", (void *)RTThreadSleep }, { "RTThreadYield", (void *)RTThreadYield }, -#if 0 /* Thread APIs, Part 2. */ { "RTThreadSelf", (void *)RTThreadSelf }, { "RTThreadCreate", (void *)RTThreadCreate }, { "RTThreadGetNative", (void *)RTThreadGetNative }, @@ -291,7 +290,6 @@ static SUPFUNC g_aFunctions[] = { "RTThreadUserReset", (void *)RTThreadUserReset }, { "RTThreadUserWait", (void *)RTThreadUserWait }, { "RTThreadUserWaitNoResume", (void *)RTThreadUserWaitNoResume }, -#endif { "RTThreadPreemptIsEnabled", (void *)RTThreadPreemptIsEnabled }, { "RTThreadPreemptIsPending", (void *)RTThreadPreemptIsPending }, { "RTThreadPreemptIsPendingTrusty", (void *)RTThreadPreemptIsPendingTrusty }, @@ -323,6 +321,8 @@ static SUPFUNC g_aFunctions[] = { "RTMpGetSet", (void *)RTMpGetSet }, { "RTMpIsCpuOnline", (void *)RTMpIsCpuOnline }, { "RTMpIsCpuWorkPending", (void *)RTMpIsCpuWorkPending }, + { "RTMpNotificationRegister", (void *)RTMpNotificationRegister }, + { "RTMpNotificationDeregister", (void *)RTMpNotificationDeregister }, { "RTMpOnAll", (void *)RTMpOnAll }, { "RTMpOnOthers", (void *)RTMpOnOthers }, { "RTMpOnSpecific", (void *)RTMpOnSpecific }, @@ -336,6 +336,7 @@ static SUPFUNC g_aFunctions[] = { "RTR0AssertPanicSystem", (void *)RTR0AssertPanicSystem }, { "RTAssertMsg1", (void *)RTAssertMsg1 }, { "RTAssertMsg2V", (void *)RTAssertMsg2V }, + { "RTAssertMsg2AddV", (void *)RTAssertMsg2AddV }, { "RTAssertSetQuiet", (void *)RTAssertSetQuiet }, { "RTAssertMayPanic", (void *)RTAssertMayPanic }, { "RTAssertSetMayPanic", (void *)RTAssertSetMayPanic }, @@ -1399,8 +1400,8 @@ int VBOXCALL supdrvIOCtl(uintptr_t uIOCtl, PSUPDRVDEVEXT pDevExt, PSUPDRVSESSION case SUP_CTL_CODE_NO_SIZE(SUP_IOCTL_CALL_VMMR0_BIG): { /* validate */ + PSUPCALLVMMR0 pReq = (PSUPCALLVMMR0)pReqHdr; PSUPVMMR0REQHDR pVMMReq; - PSUPCALLVMMR0 pReq = (PSUPCALLVMMR0)pReqHdr; Log4(("SUP_IOCTL_CALL_VMMR0_BIG: op=%u in=%u arg=%RX64 p/t=%RTproc/%RTthrd\n", pReq->u.In.uOperation, pReq->Hdr.cbIn, pReq->u.In.u64Arg, RTProcSelf(), RTThreadNativeSelf())); @@ -4064,7 +4065,7 @@ static int supdrvIOCtl_LdrLoad(PSUPDRVDEVEXT pDevExt, PSUPDRVSESSION pSession, P pImage->pfnModuleTerm = pReq->u.In.pfnModuleTerm; if (pImage->fNative) - rc = supdrvOSLdrLoad(pDevExt, pImage, pReq->u.In.abImage); + rc = supdrvOSLdrLoad(pDevExt, pImage, pReq->u.In.abImage, pReq); else memcpy(pImage->pvImage, &pReq->u.In.abImage[0], pImage->cbImageBits); } @@ -4276,16 +4277,18 @@ static int supdrvIOCtl_LdrGetSymbol(PSUPDRVDEVEXT pDevExt, PSUPDRVSESSION pSessi /* * Search the symbol strings. + * + * Note! The int32_t is for native loading on solaris where the data + * and text segments are in very different places. */ pchStrings = pImage->pachStrTab; paSyms = pImage->paSymbols; for (i = 0; i < pImage->cSymbols; i++) { - if ( paSyms[i].offSymbol < pImage->cbImageBits /* paranoia */ - && paSyms[i].offName + cbSymbol <= pImage->cbStrTab + if ( paSyms[i].offName + cbSymbol <= pImage->cbStrTab && !memcmp(pchStrings + paSyms[i].offName, pReq->u.In.szSymbol, cbSymbol)) { - pvSymbol = (uint8_t *)pImage->pvImage + paSyms[i].offSymbol; + pvSymbol = (uint8_t *)pImage->pvImage + (int32_t)paSyms[i].offSymbol; rc = VINF_SUCCESS; break; } @@ -4365,14 +4368,13 @@ static int supdrvIDC_LdrGetSymbol(PSUPDRVDEVEXT pDevExt, PSUPDRVSESSION pSession PCSUPLDRSYM paSyms = pImage->paSymbols; for (i = 0; i < pImage->cSymbols; i++) { - if ( paSyms[i].offSymbol < pImage->cbImageBits /* paranoia */ - && paSyms[i].offName + cbSymbol <= pImage->cbStrTab + if ( paSyms[i].offName + cbSymbol <= pImage->cbStrTab && !memcmp(pchStrings + paSyms[i].offName, pszSymbol, cbSymbol)) { /* * Found it! Calc the symbol address and add a reference to the module. */ - pReq->u.Out.pfnSymbol = (PFNRT)((uint8_t *)pImage->pvImage + paSyms[i].offSymbol); + pReq->u.Out.pfnSymbol = (PFNRT)((uint8_t *)pImage->pvImage + (int32_t)paSyms[i].offSymbol); rc = supdrvLdrAddUsage(pSession, pImage); break; } @@ -4991,6 +4993,40 @@ static DECLCALLBACK(void) supdrvGipAsyncTimer(PRTTIMER pTimer, void *pvUser, uin /** + * Finds our (@a idCpu) entry, or allocates a new one if not found. + * + * @returns Index of the CPU in the cache set. + * @param pGip The GIP. + * @param idCpu The CPU ID. + */ +static uint32_t supdrvGipCpuIndexFromCpuId(PSUPGLOBALINFOPAGE pGip, RTCPUID idCpu) +{ + uint32_t i, cTries; + + /* + * ASSUMES that CPU IDs are constant. + */ + for (i = 0; i < pGip->cCpus; i++) + if (pGip->aCPUs[i].idCpu == idCpu) + return i; + + cTries = 0; + do + { + for (i = 0; i < pGip->cCpus; i++) + { + bool fRc; + ASMAtomicCmpXchgSize(&pGip->aCPUs[i].idCpu, idCpu, NIL_RTCPUID, fRc); + if (fRc) + return i; + } + } while (cTries++ < 32); + AssertReleaseFailed(); + return i - 1; +} + + +/** * The calling CPU should be accounted as online, update GIP accordingly. * * This is used by supdrvGipMpEvent as well as the supdrvGipCreate. @@ -5000,11 +5036,11 @@ static DECLCALLBACK(void) supdrvGipAsyncTimer(PRTTIMER pTimer, void *pvUser, uin */ static void supdrvGipMpEventOnline(PSUPGLOBALINFOPAGE pGip, RTCPUID idCpu) { - int iCpuSet; - uint8_t idApic; - uint32_t i; + int iCpuSet = 0; + uint16_t idApic = UINT16_MAX; + uint32_t i = 0; - Assert(idCpu == RTMpCpuId()); + AssertRelease(idCpu == RTMpCpuId()); Assert(pGip->cPossibleCpus == RTMpGetCount()); /* @@ -5021,38 +5057,22 @@ static void supdrvGipMpEventOnline(PSUPGLOBALINFOPAGE pGip, RTCPUID idCpu) } /* - * Find our entry, or allocate one if not found. - * ASSUMES that CPU IDs are constant. - */ - for (i = 0; i < pGip->cCpus; i++) - if (pGip->aCPUs[i].idCpu == idCpu) - break; - - if (i >= pGip->cCpus) - for (i = 0; i < pGip->cCpus; i++) - { - bool fRc; - ASMAtomicCmpXchgSize(&pGip->aCPUs[i].idCpu, idCpu, NIL_RTCPUID, fRc); - if (fRc) - break; - } - - AssertReturnVoid(i < pGip->cCpus); - - /* * Update the entry. */ + i = supdrvGipCpuIndexFromCpuId(pGip, idCpu); idApic = ASMGetApicId(); ASMAtomicUoWriteU16(&pGip->aCPUs[i].idApic, idApic); ASMAtomicUoWriteS16(&pGip->aCPUs[i].iCpuSet, (int16_t)iCpuSet); ASMAtomicUoWriteSize(&pGip->aCPUs[i].idCpu, idCpu); - ASMAtomicWriteSize(&pGip->aCPUs[i].enmState, SUPGIPCPUSTATE_ONLINE); /* * Update the APIC ID and CPU set index mappings. */ ASMAtomicWriteU16(&pGip->aiCpuFromApicId[idApic], i); ASMAtomicWriteU16(&pGip->aiCpuFromCpuSetIdx[iCpuSet], i); + + /* commit it */ + ASMAtomicWriteSize(&pGip->aCPUs[i].enmState, SUPGIPCPUSTATE_ONLINE); } @@ -5077,8 +5097,10 @@ static void supdrvGipMpEventOffline(PSUPGLOBALINFOPAGE pGip, RTCPUID idCpu) AssertReturnVoid(pGip->aCPUs[i].idCpu == idCpu); Assert(RTCpuSetIsMemberByIndex(&pGip->PossibleCpuSet, iCpuSet)); - ASMAtomicWriteSize(&pGip->aCPUs[i].enmState, SUPGIPCPUSTATE_OFFLINE); RTCpuSetDelByIndex(&pGip->OnlineCpuSet, iCpuSet); + + /* commit it */ + ASMAtomicWriteSize(&pGip->aCPUs[i].enmState, SUPGIPCPUSTATE_OFFLINE); } @@ -5097,6 +5119,9 @@ static DECLCALLBACK(void) supdrvGipMpEvent(RTMPEVENT enmEvent, RTCPUID idCpu, vo PSUPDRVDEVEXT pDevExt = (PSUPDRVDEVEXT)pvUser; PSUPGLOBALINFOPAGE pGip = pDevExt->pGip; + AssertRelease(idCpu == RTMpCpuId()); + AssertRelease(!RTThreadPreemptIsEnabled(NIL_RTTHREAD)); + /* * Update the GIP CPU data. */ @@ -5119,8 +5144,7 @@ static DECLCALLBACK(void) supdrvGipMpEvent(RTMPEVENT enmEvent, RTCPUID idCpu, vo */ if (enmEvent == RTMPEVENT_OFFLINE) { - RTCPUID idGipMaster; - ASMAtomicReadSize(&pDevExt->idGipMaster, &idGipMaster); + RTCPUID idGipMaster = ASMAtomicReadU32(&pDevExt->idGipMaster); if (idGipMaster == idCpu) { /* @@ -5360,7 +5384,7 @@ static void supdrvGipInit(PSUPDRVDEVEXT pDevExt, PSUPGLOBALINFOPAGE pGip, RTHCPH pGip->aCPUs[i].enmState = SUPGIPCPUSTATE_INVALID; pGip->aCPUs[i].idCpu = NIL_RTCPUID; pGip->aCPUs[i].iCpuSet = -1; - pGip->aCPUs[i].idApic = UINT8_MAX; + pGip->aCPUs[i].idApic = UINT16_MAX; /* * We don't know the following values until we've executed updates. @@ -5619,14 +5643,26 @@ static void supdrvGipUpdate(PSUPGLOBALINFOPAGE pGip, uint64_t u64NanoTS, uint64_ static void supdrvGipUpdatePerCpu(PSUPGLOBALINFOPAGE pGip, uint64_t u64NanoTS, uint64_t u64TSC, RTCPUID idCpu, uint8_t idApic, uint64_t iTick) { - unsigned iCpu = pGip->aiCpuFromApicId[idApic]; + uint32_t iCpu; + /* + * Avoid a potential race when a CPU online notification doesn't fire on + * the onlined CPU but the tick creeps in before the event notification is + * run. + */ + if (RT_UNLIKELY(iTick == 1)) + { + iCpu = supdrvGipCpuIndexFromCpuId(pGip, idCpu); + if (pGip->aCPUs[iCpu].enmState == SUPGIPCPUSTATE_OFFLINE) + supdrvGipMpEventOnline(pGip, idCpu); + } + + iCpu = pGip->aiCpuFromApicId[idApic]; if (RT_LIKELY(iCpu < pGip->cCpus)) { PSUPGIPCPU pGipCpu = &pGip->aCPUs[iCpu]; if (pGipCpu->idCpu == idCpu) { - /* * Start update transaction. */ diff --git a/src/VBox/HostDrivers/Support/SUPDrvIDC.h b/src/VBox/HostDrivers/Support/SUPDrvIDC.h index ca9fe3148..524e6bdfb 100644 --- a/src/VBox/HostDrivers/Support/SUPDrvIDC.h +++ b/src/VBox/HostDrivers/Support/SUPDrvIDC.h @@ -1,4 +1,4 @@ -/* $Id: SUPDrvIDC.h $ */ +/* $Id: SUPDrvIDC.h 33540 2010-10-28 09:27:05Z vboxsync $ */ /** @file * VirtualBox Support Driver - Inter-Driver Communication (IDC) definitions. */ diff --git a/src/VBox/HostDrivers/Support/SUPDrvIOC.h b/src/VBox/HostDrivers/Support/SUPDrvIOC.h index b4d0f54b7..806107953 100644 --- a/src/VBox/HostDrivers/Support/SUPDrvIOC.h +++ b/src/VBox/HostDrivers/Support/SUPDrvIOC.h @@ -1,4 +1,4 @@ -/* $Revision: 70529 $ */ +/* $Revision: 37591 $ */ /** @file * VirtualBox Support Driver - IOCtl definitions. */ @@ -192,7 +192,7 @@ typedef SUPREQHDR *PSUPREQHDR; * @todo Pending work on next major version change: * - None. */ -#define SUPDRV_IOC_VERSION 0x00180000 +#define SUPDRV_IOC_VERSION 0x00190000 /** SUP_IOCTL_COOKIE. */ typedef struct SUPCOOKIE @@ -345,7 +345,11 @@ typedef struct SUPLDRSYM { /** Offset into of the string table. */ uint32_t offName; - /** Offset of the symbol relative to the image load address. */ + /** Offset of the symbol relative to the image load address. + * @remarks When used inside the SUPDrv to calculate real addresses, it + * must be cast to int32_t for the sake of native loader support + * on Solaris. (The loader puts the and data in different + * memory areans, and the text one is generally higher.) */ uint32_t offSymbol; } SUPLDRSYM; /** Pointer to a symbol table entry. */ diff --git a/src/VBox/HostDrivers/Support/SUPDrvInternal.h b/src/VBox/HostDrivers/Support/SUPDrvInternal.h index f3674ed8b..5eb135350 100644 --- a/src/VBox/HostDrivers/Support/SUPDrvInternal.h +++ b/src/VBox/HostDrivers/Support/SUPDrvInternal.h @@ -1,4 +1,4 @@ -/* $Revision: 69603 $ */ +/* $Revision: 37249 $ */ /** @file * VirtualBox Support Driver - Internal header. */ @@ -298,6 +298,12 @@ typedef struct SUPDRVLDRIMAGE /** Lock object. */ RTR0MEMOBJ hMemLock; #endif +#if defined(RT_OS_SOLARIS) && defined(VBOX_WITH_NATIVE_SOLARIS_LOADING) + /** The Solaris module ID. */ + int idSolMod; + /** Pointer to the module control structure. */ + struct modctl *pSolModCtl; +#endif /** Whether it's loaded by the native loader or not. */ bool fNative; /** Image name. */ @@ -570,11 +576,13 @@ int VBOXCALL supdrvOSLdrValidatePointer(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAG * * @returns IPRT status code. * @param pDevExt The device globals. - * @param pImage The image data (up to date except for some - * entry point pointers). + * @param pImage The image data (up to date). Adjust entrypoints + * and exports if necessary. * @param pbImageBits The image bits as loaded by ring-3. + * @param pReq Pointer to the request packet so that the VMMR0 + * entry points can be adjusted. */ -int VBOXCALL supdrvOSLdrLoad(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage, const uint8_t *pbImageBits); +int VBOXCALL supdrvOSLdrLoad(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage, const uint8_t *pbImageBits, PSUPLDRLOAD pReq); /** diff --git a/src/VBox/HostDrivers/Support/SUPDrvSem.c b/src/VBox/HostDrivers/Support/SUPDrvSem.c index f546f56fb..b0c7901c7 100644 --- a/src/VBox/HostDrivers/Support/SUPDrvSem.c +++ b/src/VBox/HostDrivers/Support/SUPDrvSem.c @@ -1,4 +1,4 @@ -/* $Revision: 66703 $ */ +/* $Revision: 33167 $ */ /** @file * VBoxDrv - The VirtualBox Support Driver - Common OS agnostic. */ diff --git a/src/VBox/HostDrivers/Support/SUPLib.cpp b/src/VBox/HostDrivers/Support/SUPLib.cpp index 17ba3a353..4c3821961 100644 --- a/src/VBox/HostDrivers/Support/SUPLib.cpp +++ b/src/VBox/HostDrivers/Support/SUPLib.cpp @@ -1,4 +1,4 @@ -/* $Id: SUPLib.cpp $ */ +/* $Id: SUPLib.cpp 37955 2011-07-14 12:23:02Z vboxsync $ */ /** @file * VirtualBox Support Library - Common code. */ @@ -50,7 +50,6 @@ #include <VBox/err.h> #include <VBox/param.h> #include <VBox/log.h> -#include <VBox/x86.h> #include <iprt/assert.h> #include <iprt/alloc.h> @@ -65,6 +64,7 @@ #include <iprt/string.h> #include <iprt/env.h> #include <iprt/rand.h> +#include <iprt/x86.h> #include "SUPLibInternal.h" #include "SUPDrvIOC.h" @@ -96,7 +96,7 @@ static bool g_fPreInited = false; * via the pre-init mechanism from the hardened executable stub. */ SUPLIBDATA g_supLibData = { - NIL_RTFILE + SUP_HDEVICE_NIL #if defined(RT_OS_DARWIN) , NULL #elif defined(RT_OS_LINUX) @@ -184,10 +184,10 @@ DECLEXPORT(int) supR3PreInit(PSUPPREINITDATA pPreInitData, uint32_t fFlags) || pPreInitData->u32EndMagic != SUPPREINITDATA_MAGIC) return VERR_INVALID_MAGIC; if ( !(fFlags & SUPSECMAIN_FLAGS_DONT_OPEN_DEV) - && pPreInitData->Data.hDevice == NIL_RTFILE) + && pPreInitData->Data.hDevice == SUP_HDEVICE_NIL) return VERR_INVALID_HANDLE; if ( (fFlags & SUPSECMAIN_FLAGS_DONT_OPEN_DEV) - && pPreInitData->Data.hDevice != NIL_RTFILE) + && pPreInitData->Data.hDevice != SUP_HDEVICE_NIL) return VERR_INVALID_PARAMETER; /* @@ -266,9 +266,9 @@ SUPR3DECL(int) SUPR3Init(PSUPDRVSESSION *ppSession) CookieReq.Hdr.rc = VERR_INTERNAL_ERROR; strcpy(CookieReq.u.In.szMagic, SUPCOOKIE_MAGIC); CookieReq.u.In.u32ReqVersion = SUPDRV_IOC_VERSION; - const uint32_t uMinVersion = /*(SUPDRV_IOC_VERSION & 0xffff0000) == 0x00160000 - ? 0x00160001 - : */ SUPDRV_IOC_VERSION & 0xffff0000; + const uint32_t uMinVersion = (SUPDRV_IOC_VERSION & 0xffff0000) == 0x00170000 + ? 0x00170002 + : SUPDRV_IOC_VERSION & 0xffff0000; CookieReq.u.In.u32MinVersion = uMinVersion; rc = suplibOsIOCtl(&g_supLibData, SUP_IOCTL_COOKIE, &CookieReq, SUP_IOCTL_COOKIE_SIZE); if ( RT_SUCCESS(rc) @@ -1688,6 +1688,29 @@ static DECLCALLBACK(int) supLoadModuleResolveImport(RTLDRMOD hLdrMod, const char } /* + * Symbols that are undefined by convention. + */ +#ifdef RT_OS_SOLARIS + static const char * const s_apszConvSyms[] = + { + "", "mod_getctl", + "", "mod_install", + "", "mod_remove", + "", "mod_info", + "", "mod_miscops", + }; + for (unsigned i = 0; i < RT_ELEMENTS(s_apszConvSyms); i += 2) + { + if ( !RTStrCmp(s_apszConvSyms[i], pszModule) + && !RTStrCmp(s_apszConvSyms[i + 1], pszSymbol)) + { + *pValue = ~(uintptr_t)0; + return VINF_SUCCESS; + } + } +#endif + + /* * Despair. */ c = g_pFunctions->u.Out.cFunctions; diff --git a/src/VBox/HostDrivers/Support/SUPLibInternal.h b/src/VBox/HostDrivers/Support/SUPLibInternal.h index 490e88161..34e884e7a 100644 --- a/src/VBox/HostDrivers/Support/SUPLibInternal.h +++ b/src/VBox/HostDrivers/Support/SUPLibInternal.h @@ -1,4 +1,4 @@ -/* $Id: SUPLibInternal.h $ */ +/* $Id: SUPLibInternal.h 37596 2011-06-22 19:30:06Z vboxsync $ */ /** @file * VirtualBox Support Library - Internal header. */ @@ -184,7 +184,11 @@ typedef SUPVERIFIEDDIR const *PCSUPVERIFIEDDIR; typedef struct SUPLIBDATA { /** The device handle. */ - RTFILE hDevice; +#if defined(RT_OS_WINDOWS) + void *hDevice; +#else + int hDevice; +#endif #if defined(RT_OS_DARWIN) /** The connection to the VBoxSupDrv service. */ uintptr_t uConnection; @@ -203,6 +207,13 @@ typedef SUPLIBDATA *PSUPLIBDATA; /** Pointer to const pre-init data. */ typedef SUPLIBDATA const *PCSUPLIBDATA; +/** The NIL value of SUPLIBDATA::hDevice. */ +#if defined(RT_OS_WINDOWS) +# define SUP_HDEVICE_NIL NULL +#else +# define SUP_HDEVICE_NIL (-1) +#endif + /** * Pre-init data that is handed over from the hardened executable stub. diff --git a/src/VBox/HostDrivers/Support/SUPLibSem.cpp b/src/VBox/HostDrivers/Support/SUPLibSem.cpp index bd7f2e56c..3f91d60fd 100644 --- a/src/VBox/HostDrivers/Support/SUPLibSem.cpp +++ b/src/VBox/HostDrivers/Support/SUPLibSem.cpp @@ -1,4 +1,4 @@ -/* $Id: SUPLibSem.cpp $ */ +/* $Id: SUPLibSem.cpp 33167 2010-10-15 18:16:59Z vboxsync $ */ /** @file * VirtualBox Support Library - Semaphores, ring-3 implementation. */ diff --git a/src/VBox/HostDrivers/Support/SUPR0.def b/src/VBox/HostDrivers/Support/SUPR0.def index c57b09ab9..9a72a752b 100644 --- a/src/VBox/HostDrivers/Support/SUPR0.def +++ b/src/VBox/HostDrivers/Support/SUPR0.def @@ -1,4 +1,4 @@ -; $Id: SUPR0.def $ +; $Id: SUPR0.def 37410 2011-06-10 15:11:40Z vboxsync $ ;; @file ; VirtualBox Support Driver - Exports. ; @@ -166,6 +166,8 @@ EXPORTS RTMpGetSet RTMpIsCpuOnline RTMpIsCpuWorkPending + RTMpNotificationRegister + RTMpNotificationDeregister RTMpOnAll RTMpOnOthers RTMpOnSpecific @@ -179,6 +181,7 @@ EXPORTS RTLogPrintfV RTAssertMsg1 RTAssertMsg2V + RTAssertMsg2AddV RTAssertSetQuiet RTAssertMayPanic RTAssertSetMayPanic diff --git a/src/VBox/HostDrivers/Support/SUPR0IdcClient.c b/src/VBox/HostDrivers/Support/SUPR0IdcClient.c index 7d7193c57..d63dd1d19 100644 --- a/src/VBox/HostDrivers/Support/SUPR0IdcClient.c +++ b/src/VBox/HostDrivers/Support/SUPR0IdcClient.c @@ -1,4 +1,4 @@ -/* $Id: SUPR0IdcClient.c $ */ +/* $Id: SUPR0IdcClient.c 33540 2010-10-28 09:27:05Z vboxsync $ */ /** @file * VirtualBox Support Driver - IDC Client Lib, Core. */ diff --git a/src/VBox/HostDrivers/Support/SUPR0IdcClientComponent.c b/src/VBox/HostDrivers/Support/SUPR0IdcClientComponent.c index d867a37e1..db7d54ba3 100644 --- a/src/VBox/HostDrivers/Support/SUPR0IdcClientComponent.c +++ b/src/VBox/HostDrivers/Support/SUPR0IdcClientComponent.c @@ -1,4 +1,4 @@ -/* $Id: SUPR0IdcClientComponent.c $ */ +/* $Id: SUPR0IdcClientComponent.c 28800 2010-04-27 08:22:32Z vboxsync $ */ /** @file * VirtualBox Support Driver - IDC Client Lib, Component APIs. */ diff --git a/src/VBox/HostDrivers/Support/SUPR0IdcClientInternal.h b/src/VBox/HostDrivers/Support/SUPR0IdcClientInternal.h index 29ada07f1..c5bde94fe 100644 --- a/src/VBox/HostDrivers/Support/SUPR0IdcClientInternal.h +++ b/src/VBox/HostDrivers/Support/SUPR0IdcClientInternal.h @@ -1,4 +1,4 @@ -/* $Id: SUPR0IdcClientInternal.h $ */ +/* $Id: SUPR0IdcClientInternal.h 28800 2010-04-27 08:22:32Z vboxsync $ */ /** @file * VirtualBox Support Driver - Internal header for the IDC client library. */ diff --git a/src/VBox/HostDrivers/Support/SUPR0IdcClientStubs.c b/src/VBox/HostDrivers/Support/SUPR0IdcClientStubs.c index 595d24740..41ee67d94 100644 --- a/src/VBox/HostDrivers/Support/SUPR0IdcClientStubs.c +++ b/src/VBox/HostDrivers/Support/SUPR0IdcClientStubs.c @@ -1,4 +1,4 @@ -/* $Id: SUPR0IdcClientStubs.c $ */ +/* $Id: SUPR0IdcClientStubs.c 29285 2010-05-10 00:22:29Z vboxsync $ */ /** @file * VirtualBox Support Driver - IDC Client Lib, Stubs for SUPR0 APIs. */ diff --git a/src/VBox/HostDrivers/Support/SUPR3HardenedIPRT.cpp b/src/VBox/HostDrivers/Support/SUPR3HardenedIPRT.cpp index f13e42f67..30378807e 100644 --- a/src/VBox/HostDrivers/Support/SUPR3HardenedIPRT.cpp +++ b/src/VBox/HostDrivers/Support/SUPR3HardenedIPRT.cpp @@ -1,4 +1,4 @@ -/* $Id: SUPR3HardenedIPRT.cpp $ */ +/* $Id: SUPR3HardenedIPRT.cpp 28800 2010-04-27 08:22:32Z vboxsync $ */ /** @file * VirtualBox Support Library - Hardened Support Routines using IPRT. */ diff --git a/src/VBox/HostDrivers/Support/SUPR3HardenedMain.cpp b/src/VBox/HostDrivers/Support/SUPR3HardenedMain.cpp index 655661382..61082b00f 100644 --- a/src/VBox/HostDrivers/Support/SUPR3HardenedMain.cpp +++ b/src/VBox/HostDrivers/Support/SUPR3HardenedMain.cpp @@ -1,4 +1,4 @@ -/* $Id: SUPR3HardenedMain.cpp $ */ +/* $Id: SUPR3HardenedMain.cpp 37596 2011-06-22 19:30:06Z vboxsync $ */ /** @file * VirtualBox Support Library - Hardened main(). */ @@ -1018,9 +1018,9 @@ DECLHIDDEN(int) SUPR3HardenedMain(const char *pszProgName, uint32_t fFlags, int * to basic CRT functions that everyone agree upon. */ g_pszSupLibHardenedProgName = pszProgName; - g_SupPreInitData.u32Magic = SUPPREINITDATA_MAGIC; - g_SupPreInitData.Data.hDevice = NIL_RTFILE; - g_SupPreInitData.u32EndMagic = SUPPREINITDATA_MAGIC; + g_SupPreInitData.u32Magic = SUPPREINITDATA_MAGIC; + g_SupPreInitData.Data.hDevice = SUP_HDEVICE_NIL; + g_SupPreInitData.u32EndMagic = SUPPREINITDATA_MAGIC; #ifdef SUP_HARDENED_SUID # ifdef RT_OS_LINUX diff --git a/src/VBox/HostDrivers/Support/SUPR3HardenedVerify.cpp b/src/VBox/HostDrivers/Support/SUPR3HardenedVerify.cpp index bd820bace..184d0801a 100644 --- a/src/VBox/HostDrivers/Support/SUPR3HardenedVerify.cpp +++ b/src/VBox/HostDrivers/Support/SUPR3HardenedVerify.cpp @@ -1,4 +1,4 @@ -/* $Id: SUPR3HardenedVerify.cpp $ */ +/* $Id: SUPR3HardenedVerify.cpp 37344 2011-06-07 12:23:53Z vboxsync $ */ /** @file * VirtualBox Support Library - Verification of Hardened Installation. */ @@ -1186,11 +1186,10 @@ static int supR3HardenedVerifyFsObject(PCSUPR3HARDENEDFSOBJSTATE pFsObjState, bo full access. So, to work around we relax the hardening a bit and permit grand parents and beyond to be group writable by admin. */ if (pFsObjState->Stat.st_gid != 80 /*admin*/) /** @todo dynamically resolve the admin group? */ -#endif -#ifdef RT_OS_FREEBSD - /* PC-BSD 9 has group-writable application directory, similar to OSX and - their Applications directory */ - if (pFsObjState->Stat.st_gid != 5 /*operators*/) /* Allow operators group-writes */ +#elif defined(RT_OS_FREEBSD) + /* HACK ALERT: PC-BSD 9 has group-writable application directory, + similar to OS X and their /Applications directory (see above). */ + if (pFsObjState->Stat.st_gid != 5 /*operators*/) #endif return supR3HardenedSetError3(VERR_SUPLIB_WRITE_NON_SYS_GROUP, pErrInfo, "The group is not a system group and it has write access to '", pszPath, "'"); diff --git a/src/VBox/HostDrivers/Support/SUPSvc.cpp b/src/VBox/HostDrivers/Support/SUPSvc.cpp index de087be52..9e7eb8a2d 100644 --- a/src/VBox/HostDrivers/Support/SUPSvc.cpp +++ b/src/VBox/HostDrivers/Support/SUPSvc.cpp @@ -1,4 +1,4 @@ -/* $Id: SUPSvc.cpp $ */ +/* $Id: SUPSvc.cpp 33540 2010-10-28 09:27:05Z vboxsync $ */ /** @file * VirtualBox Support Service - Common Code. */ diff --git a/src/VBox/HostDrivers/Support/SUPSvcGlobal.cpp b/src/VBox/HostDrivers/Support/SUPSvcGlobal.cpp index f58a03adb..fa2290b58 100644 --- a/src/VBox/HostDrivers/Support/SUPSvcGlobal.cpp +++ b/src/VBox/HostDrivers/Support/SUPSvcGlobal.cpp @@ -1,4 +1,4 @@ -/* $Id: SUPSvcGlobal.cpp $ */ +/* $Id: SUPSvcGlobal.cpp 28800 2010-04-27 08:22:32Z vboxsync $ */ /** @file * VirtualBox Support Service - The Global Service. */ diff --git a/src/VBox/HostDrivers/Support/SUPSvcGrant.cpp b/src/VBox/HostDrivers/Support/SUPSvcGrant.cpp index 50a9cdef8..7f66afed3 100644 --- a/src/VBox/HostDrivers/Support/SUPSvcGrant.cpp +++ b/src/VBox/HostDrivers/Support/SUPSvcGrant.cpp @@ -1,4 +1,4 @@ -/* $Id: SUPSvcGrant.cpp $ */ +/* $Id: SUPSvcGrant.cpp 33540 2010-10-28 09:27:05Z vboxsync $ */ /** @file * VirtualBox Support Service - The Grant Service. */ diff --git a/src/VBox/HostDrivers/Support/SUPSvcInternal.h b/src/VBox/HostDrivers/Support/SUPSvcInternal.h index afdc78f40..eb0f5f02c 100644 --- a/src/VBox/HostDrivers/Support/SUPSvcInternal.h +++ b/src/VBox/HostDrivers/Support/SUPSvcInternal.h @@ -1,4 +1,4 @@ -/* $Id: SUPSvcInternal.h $ */ +/* $Id: SUPSvcInternal.h 33540 2010-10-28 09:27:05Z vboxsync $ */ /** @file * VirtualBox Support Service - Internal header. */ diff --git a/src/VBox/HostDrivers/Support/darwin/SUPDrv-darwin.cpp b/src/VBox/HostDrivers/Support/darwin/SUPDrv-darwin.cpp index a2c97d020..f6f66574c 100644 --- a/src/VBox/HostDrivers/Support/darwin/SUPDrv-darwin.cpp +++ b/src/VBox/HostDrivers/Support/darwin/SUPDrv-darwin.cpp @@ -1,4 +1,4 @@ -/* $Id: SUPDrv-darwin.cpp $ */ +/* $Id: SUPDrv-darwin.cpp 37970 2011-07-14 14:37:23Z vboxsync $ */ /** @file * VirtualBox Support Driver - Darwin Specific Code. */ @@ -360,8 +360,13 @@ static int VBoxDrvDarwinOpen(dev_t Dev, int fFlags, int fDevType, struct proc *p kauth_cred_t pCred = kauth_cred_proc_ref(pProcess); if (pCred) { - RTUID Uid = pCred->cr_ruid; +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 + RTUID Uid = kauth_cred_getruid(pCred); + RTGID Gid = kauth_cred_getrgid(pCred); +#else + RTUID Uid = pCred->cr_ruid; RTGID Gid = pCred->cr_rgid; +#endif RTPROCESS Process = RTProcSelf(); unsigned iHash = SESSION_HASH(Process); RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER; @@ -770,9 +775,9 @@ int VBOXCALL supdrvOSLdrValidatePointer(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAG } -int VBOXCALL supdrvOSLdrLoad(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage, const uint8_t *pbImageBits) +int VBOXCALL supdrvOSLdrLoad(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage, const uint8_t *pbImageBits, PSUPLDRLOAD pReq) { - NOREF(pDevExt); NOREF(pImage); NOREF(pbImageBits); + NOREF(pDevExt); NOREF(pImage); NOREF(pbImageBits); NOREF(pReq); return VERR_NOT_SUPPORTED; } @@ -809,17 +814,16 @@ static int VBoxDrvDarwinErr2DarwinErr(int rc) } -/** @todo move this to assembly where a simple "jmp printf" will to the trick. */ RTDECL(int) SUPR0Printf(const char *pszFormat, ...) { - va_list args; + va_list va; char szMsg[512]; - va_start(args, pszFormat); - vsnprintf(szMsg, sizeof(szMsg) - 1, pszFormat, args); - va_end(args); - + va_start(va, pszFormat); + RTStrPrintfV(szMsg, sizeof(szMsg) - 1, pszFormat, va); + va_end(va); szMsg[sizeof(szMsg) - 1] = '\0'; + printf("%s", szMsg); return 0; } diff --git a/src/VBox/HostDrivers/Support/darwin/SUPLib-darwin.cpp b/src/VBox/HostDrivers/Support/darwin/SUPLib-darwin.cpp index bf9b87059..d2f2b0122 100644 --- a/src/VBox/HostDrivers/Support/darwin/SUPLib-darwin.cpp +++ b/src/VBox/HostDrivers/Support/darwin/SUPLib-darwin.cpp @@ -1,4 +1,4 @@ -/* $Id: SUPLib-darwin.cpp $ */ +/* $Id: SUPLib-darwin.cpp 37596 2011-06-22 19:30:06Z vboxsync $ */ /** @file * VirtualBox Support Library - Darwin specific parts. */ @@ -193,7 +193,7 @@ int suplibOsInit(PSUPLIBDATA pThis, bool fPreInited) /* * Do the job. */ - Assert(pThis->hDevice == NIL_RTFILE); + Assert(pThis->hDevice == (intptr_t)NIL_RTFILE); int rc = suplibDarwinOpenService(pThis); if (RT_SUCCESS(rc)) { @@ -236,11 +236,11 @@ int suplibOsTerm(PSUPLIBDATA pThis) /* * Check if we're inited at all. */ - if (pThis->hDevice != NIL_RTFILE) + if (pThis->hDevice != (intptr_t)NIL_RTFILE) { if (close(pThis->hDevice)) AssertFailed(); - pThis->hDevice = NIL_RTFILE; + pThis->hDevice = (intptr_t)NIL_RTFILE; } return VINF_SUCCESS; diff --git a/src/VBox/HostDrivers/Support/darwin/SUPR0IdcClient-darwin.c b/src/VBox/HostDrivers/Support/darwin/SUPR0IdcClient-darwin.c index 128a6907c..a9171c940 100644 --- a/src/VBox/HostDrivers/Support/darwin/SUPR0IdcClient-darwin.c +++ b/src/VBox/HostDrivers/Support/darwin/SUPR0IdcClient-darwin.c @@ -1,4 +1,4 @@ -/* $Id: SUPR0IdcClient-darwin.c $ */ +/* $Id: SUPR0IdcClient-darwin.c 28800 2010-04-27 08:22:32Z vboxsync $ */ /** @file * VirtualBox Support Driver - IDC Client Lib, Darwin Specific Code. */ diff --git a/src/VBox/HostDrivers/Support/freebsd/Makefile b/src/VBox/HostDrivers/Support/freebsd/Makefile index 9b0050fc5..5f805155a 100644 --- a/src/VBox/HostDrivers/Support/freebsd/Makefile +++ b/src/VBox/HostDrivers/Support/freebsd/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile $ +# $Id: Makefile 37233 2011-05-27 13:31:57Z vboxsync $ ## @file # Makefile for the VirtualBox FreeBSD Host Driver. # @@ -84,9 +84,9 @@ SRCS += \ .PATH: ${.CURDIR}/common/string SRCS += \ - RTStrCopyP.c \ - RTStrCopy.c \ RTStrNCmp.c \ + RTStrCopy.c \ + RTStrCopyP.c \ strformat.c \ strformatrt.c \ strformattype.c \ @@ -135,6 +135,7 @@ SRCS += \ RTSemEventMultiWait-2-ex-generic.c \ RTSemEventMultiWaitNoResume-2-ex-generic.c \ RTTimerCreate-generic.c \ + errvars-generic.c \ mppresent-generic.c \ timer-generic.c diff --git a/src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c b/src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c index e2e1b46f9..f0780450a 100644 --- a/src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c +++ b/src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c @@ -1,4 +1,4 @@ -/* $Id: SUPDrv-freebsd.c $ */ +/* $Id: SUPDrv-freebsd.c 37249 2011-05-30 10:03:45Z vboxsync $ */ /** @file * VBoxDrv - The VirtualBox Support Driver - FreeBSD specifics. */ @@ -615,9 +615,9 @@ int VBOXCALL supdrvOSLdrValidatePointer(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAG } -int VBOXCALL supdrvOSLdrLoad(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage, const uint8_t *pbImageBits) +int VBOXCALL supdrvOSLdrLoad(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage, const uint8_t *pbImageBits, PSUPLDRLOAD pReq) { - NOREF(pDevExt); NOREF(pImage); NOREF(pbImageBits); + NOREF(pDevExt); NOREF(pImage); NOREF(pbImageBits); NOREF(pReq); return VERR_NOT_SUPPORTED; } diff --git a/src/VBox/HostDrivers/Support/freebsd/SUPLib-freebsd.cpp b/src/VBox/HostDrivers/Support/freebsd/SUPLib-freebsd.cpp index 2b2179041..6e6b28c9f 100644 --- a/src/VBox/HostDrivers/Support/freebsd/SUPLib-freebsd.cpp +++ b/src/VBox/HostDrivers/Support/freebsd/SUPLib-freebsd.cpp @@ -1,4 +1,4 @@ -/* $Id: SUPLib-freebsd.cpp $ */ +/* $Id: SUPLib-freebsd.cpp 37596 2011-06-22 19:30:06Z vboxsync $ */ /** @file * VirtualBox Support Library - FreeBSD specific parts. */ @@ -132,11 +132,11 @@ int suplibOsTerm(PSUPLIBDATA pThis) /* * Check if we're inited at all. */ - if (pThis->hDevice != NIL_RTFILE) + if (pThis->hDevice != (intptr_t)NIL_RTFILE) { if (close(pThis->hDevice)) AssertFailed(); - pThis->hDevice = NIL_RTFILE; + pThis->hDevice = (intptr_t)NIL_RTFILE; } return VINF_SUCCESS; } diff --git a/src/VBox/HostDrivers/Support/freebsd/SUPR0IdcClient-freebsd.c b/src/VBox/HostDrivers/Support/freebsd/SUPR0IdcClient-freebsd.c index b0e39038d..570ce7815 100644 --- a/src/VBox/HostDrivers/Support/freebsd/SUPR0IdcClient-freebsd.c +++ b/src/VBox/HostDrivers/Support/freebsd/SUPR0IdcClient-freebsd.c @@ -1,4 +1,4 @@ -/* $Id: SUPR0IdcClient-freebsd.c $ */ +/* $Id: SUPR0IdcClient-freebsd.c 28800 2010-04-27 08:22:32Z vboxsync $ */ /** @file * VirtualBox Support Driver - IDC Client Lib, FreeBSD Specific Code. */ diff --git a/src/VBox/HostDrivers/Support/freebsd/files_vboxdrv b/src/VBox/HostDrivers/Support/freebsd/files_vboxdrv index aa585e176..ccfee76a4 100755..100644 --- a/src/VBox/HostDrivers/Support/freebsd/files_vboxdrv +++ b/src/VBox/HostDrivers/Support/freebsd/files_vboxdrv @@ -1,5 +1,5 @@ #!/bin/sh -# $Id: files_vboxdrv $ +# $Id: files_vboxdrv 37955 2011-07-14 12:23:02Z vboxsync $ ## @file # Shared file between Makefile.kmk and export_modules # @@ -67,6 +67,7 @@ FILES_VBOXDRV_NOBIN=" \ ${PATH_ROOT}/include/iprt/path.h=>include/iprt/path.h \ ${PATH_ROOT}/include/iprt/once.h=>include/iprt/once.h \ ${PATH_ROOT}/include/iprt/critsect.h=>include/iprt/critsect.h \ + ${PATH_ROOT}/include/iprt/x86.h=>include/iprt/x86.h \ ${PATH_ROOT}/include/iprt/lockvalidator.h=>include/iprt/lockvalidator.h \ ${PATH_ROOT}/include/iprt/nocrt/limits.h=>include/iprt/nocrt/limits.h \ ${PATH_ROOT}/include/VBox/cdefs.h=>include/VBox/cdefs.h \ @@ -79,7 +80,6 @@ FILES_VBOXDRV_NOBIN=" \ ${PATH_ROOT}/include/VBox/SUPDrvMangling.h=>include/VBox/SUPDrvMangling.h \ ${PATH_ROOT}/include/VBox/vmm/hwacc_vmx.h=>include/VBox/vmm/hwacc_vmx.h \ ${PATH_ROOT}/include/VBox/vmm/hwacc_svm.h=>include/VBox/vmm/hwacc_svm.h \ - ${PATH_ROOT}/include/VBox/x86.h=>include/VBox/x86.h \ ${PATH_ROOT}/src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c=>freebsd/SUPDrv-freebsd.c \ ${PATH_ROOT}/src/VBox/HostDrivers/Support/SUPDrv.c=>SUPDrv.c \ ${PATH_ROOT}/src/VBox/HostDrivers/Support/SUPDrvSem.c=>SUPDrvSem.c \ @@ -153,15 +153,16 @@ FILES_VBOXDRV_NOBIN=" \ ${PATH_ROOT}/src/VBox/Runtime/generic/RTLogWriteDebugger-generic.cpp=>generic/RTLogWriteDebugger-generic.c \ ${PATH_ROOT}/src/VBox/Runtime/generic/RTRandAdvCreateSystemFaster-generic.cpp=>generic/RTRandAdvCreateSystemFaster-generic.c \ ${PATH_ROOT}/src/VBox/Runtime/generic/RTRandAdvCreateSystemTruer-generic.cpp=>generic/RTRandAdvCreateSystemTruer-generic.c \ - ${PATH_ROOT}/src/VBox/Runtime/generic/uuid-generic.cpp=>generic/uuid-generic.c \ ${PATH_ROOT}/src/VBox/Runtime/generic/RTSemEventWait-2-ex-generic.cpp=>generic/RTSemEventWait-2-ex-generic.c \ ${PATH_ROOT}/src/VBox/Runtime/generic/RTSemEventWaitNoResume-2-ex-generic.cpp=>generic/RTSemEventWaitNoResume-2-ex-generic.c \ ${PATH_ROOT}/src/VBox/Runtime/generic/RTSemEventMultiWait-2-ex-generic.cpp=>generic/RTSemEventMultiWait-2-ex-generic.c \ ${PATH_ROOT}/src/VBox/Runtime/generic/RTSemEventMultiWaitNoResume-2-ex-generic.cpp=>generic/RTSemEventMultiWaitNoResume-2-ex-generic.c \ ${PATH_ROOT}/src/VBox/Runtime/generic/RTTimerCreate-generic.cpp=>generic/RTTimerCreate-generic.c \ ${PATH_ROOT}/src/VBox/Runtime/generic/RTMpGetArraySize-generic.cpp=>generic/RTMpGetArraySize-generic.c \ + ${PATH_ROOT}/src/VBox/Runtime/generic/errvars-generic.cpp=>generic/errvars-generic.c \ ${PATH_ROOT}/src/VBox/Runtime/generic/mppresent-generic.cpp=>generic/mppresent-generic.c \ ${PATH_ROOT}/src/VBox/Runtime/generic/timer-generic.cpp=>generic/timer-generic.c \ + ${PATH_ROOT}/src/VBox/Runtime/generic/uuid-generic.cpp=>generic/uuid-generic.c \ ${PATH_ROOT}/src/VBox/Runtime/r0drv/alloc-r0drv.cpp=>r0drv/alloc-r0drv.c \ ${PATH_ROOT}/src/VBox/Runtime/r0drv/alloc-r0drv.h=>r0drv/alloc-r0drv.h \ ${PATH_ROOT}/src/VBox/Runtime/r0drv/initterm-r0drv.cpp=>r0drv/initterm-r0drv.c \ diff --git a/src/VBox/HostDrivers/Support/linux/Makefile b/src/VBox/HostDrivers/Support/linux/Makefile index 32faa0a8f..e98dba678 100644 --- a/src/VBox/HostDrivers/Support/linux/Makefile +++ b/src/VBox/HostDrivers/Support/linux/Makefile @@ -1,4 +1,4 @@ -# $Revision: 70883 $ +# $Revision: 37233 $ ## @file # Makefile for the VirtualBox Linux Host Driver. # @@ -118,12 +118,14 @@ OBJS = \ common/misc/assert.o \ common/misc/handletable.o \ common/misc/handletablectx.o \ + common/misc/thread.o \ common/string/RTStrCopyP.o \ common/string/strformat.o \ common/string/strformatrt.o \ common/string/strformattype.o \ common/string/strprintf.o \ common/string/strtonum.o \ + common/table/avlpv.o \ common/time/time.o \ r0drv/linux/RTLogWriteDebugger-r0drv-linux.o \ generic/RTAssertShouldPanic-generic.o \ @@ -136,6 +138,7 @@ OBJS = \ generic/RTSemEventMultiWait-2-ex-generic.o \ generic/RTSemEventMultiWaitNoResume-2-ex-generic.o \ generic/RTTimerCreate-generic.o \ + generic/errvars-generic.o \ generic/mppresent-generic.o \ generic/uuid-generic.o \ VBox/log-vbox.o diff --git a/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c b/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c index f4a60d804..a9ebd1e25 100644 --- a/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c +++ b/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c @@ -1,4 +1,4 @@ -/* $Rev: 69377 $ */ +/* $Rev: 37972 $ */ /** @file * VBoxDrv - The VirtualBox Support Driver - Linux specifics. */ @@ -739,9 +739,9 @@ int VBOXCALL supdrvOSLdrValidatePointer(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAG } -int VBOXCALL supdrvOSLdrLoad(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage, const uint8_t *pbImageBits) +int VBOXCALL supdrvOSLdrLoad(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage, const uint8_t *pbImageBits, PSUPLDRLOAD pReq) { - NOREF(pDevExt); NOREF(pImage); NOREF(pbImageBits); + NOREF(pDevExt); NOREF(pImage); NOREF(pbImageBits); NOREF(pReq); return VERR_NOT_SUPPORTED; } @@ -781,22 +781,15 @@ static int VBoxDrvLinuxErr2LinuxErr(int rc) RTDECL(int) SUPR0Printf(const char *pszFormat, ...) { -#if 1 - va_list args; + va_list va; char szMsg[512]; - va_start(args, pszFormat); - vsnprintf(szMsg, sizeof(szMsg) - 1, pszFormat, args); + va_start(va, pszFormat); + RTStrPrintfV(szMsg, sizeof(szMsg) - 1, pszFormat, va); + va_end(va); szMsg[sizeof(szMsg) - 1] = '\0'; + printk("%s", szMsg); - va_end(args); -#else - /* forward to printf - needs some more GCC hacking to fix ebp... */ - __asm__ __volatile__ ("mov %0, %esp\n\t" - "jmp %1\n\t", - :: "r" ((uintptr_t)&pszFormat - 4), - "m" (printk)); -#endif return 0; } diff --git a/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.mod.c b/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.mod.c index 0aaea1a1c..913869e87 100644 --- a/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.mod.c +++ b/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.mod.c @@ -1,4 +1,4 @@ -/* $Id: SUPDrv-linux.mod.c $ */ +/* $Id: SUPDrv-linux.mod.c 28800 2010-04-27 08:22:32Z vboxsync $ */ /** @file * VBoxDrv - The VirtualBox Support Driver - Autogenerated Linux code. * diff --git a/src/VBox/HostDrivers/Support/linux/SUPLib-linux.cpp b/src/VBox/HostDrivers/Support/linux/SUPLib-linux.cpp index 9d31b7f58..0fd899817 100644 --- a/src/VBox/HostDrivers/Support/linux/SUPLib-linux.cpp +++ b/src/VBox/HostDrivers/Support/linux/SUPLib-linux.cpp @@ -1,4 +1,4 @@ -/* $Id: SUPLib-linux.cpp $ */ +/* $Id: SUPLib-linux.cpp 37596 2011-06-22 19:30:06Z vboxsync $ */ /** @file * VirtualBox Support Library - GNU/Linux specific parts. */ @@ -78,7 +78,7 @@ int suplibOsInit(PSUPLIBDATA pThis, bool fPreInited) */ if (fPreInited) return VINF_SUCCESS; - Assert(pThis->hDevice == NIL_RTFILE); + Assert(pThis->hDevice == (intptr_t)NIL_RTFILE); /* * Check if madvise works. @@ -144,11 +144,11 @@ int suplibOsTerm(PSUPLIBDATA pThis) /* * Close the device if it's actually open. */ - if (pThis->hDevice != NIL_RTFILE) + if (pThis->hDevice != (intptr_t)NIL_RTFILE) { if (close(pThis->hDevice)) AssertFailed(); - pThis->hDevice = NIL_RTFILE; + pThis->hDevice = (intptr_t)NIL_RTFILE; } return 0; @@ -171,7 +171,7 @@ int suplibOsUninstall(void) int suplibOsIOCtl(PSUPLIBDATA pThis, uintptr_t uFunction, void *pvReq, size_t cbReq) { - AssertMsg(pThis->hDevice != NIL_RTFILE, ("SUPLIB not initiated successfully!\n")); + AssertMsg(pThis->hDevice != (intptr_t)NIL_RTFILE, ("SUPLIB not initiated successfully!\n")); /* * Issue device iocontrol. diff --git a/src/VBox/HostDrivers/Support/linux/SUPR0IdcClient-linux.c b/src/VBox/HostDrivers/Support/linux/SUPR0IdcClient-linux.c index 15d9761fe..b9433056c 100644 --- a/src/VBox/HostDrivers/Support/linux/SUPR0IdcClient-linux.c +++ b/src/VBox/HostDrivers/Support/linux/SUPR0IdcClient-linux.c @@ -1,4 +1,4 @@ -/* $Id: SUPR0IdcClient-linux.c $ */ +/* $Id: SUPR0IdcClient-linux.c 28800 2010-04-27 08:22:32Z vboxsync $ */ /** @file * VirtualBox Support Driver - IDC Client Lib, Linux Specific Code. */ diff --git a/src/VBox/HostDrivers/Support/linux/files_vboxdrv b/src/VBox/HostDrivers/Support/linux/files_vboxdrv index e805b1dce..f67be7ce3 100755..100644 --- a/src/VBox/HostDrivers/Support/linux/files_vboxdrv +++ b/src/VBox/HostDrivers/Support/linux/files_vboxdrv @@ -1,5 +1,5 @@ #!/bin/sh -# $Id: files_vboxdrv $ +# $Id: files_vboxdrv 37955 2011-07-14 12:23:02Z vboxsync $ ## @file # Shared file between Makefile.kmk and export_modules # @@ -63,6 +63,7 @@ FILES_VBOXDRV_NOBIN=" \ ${PATH_ROOT}/include/iprt/types.h=>include/iprt/types.h \ ${PATH_ROOT}/include/iprt/uni.h=>include/iprt/uni.h \ ${PATH_ROOT}/include/iprt/uuid.h=>include/iprt/uuid.h \ + ${PATH_ROOT}/include/iprt/x86.h=>include/iprt/x86.h \ ${PATH_ROOT}/include/iprt/nocrt/limits.h=>include/iprt/nocrt/limits.h \ ${PATH_ROOT}/include/VBox/cdefs.h=>include/VBox/cdefs.h \ ${PATH_ROOT}/include/VBox/err.h=>include/VBox/err.h \ @@ -73,7 +74,6 @@ FILES_VBOXDRV_NOBIN=" \ ${PATH_ROOT}/include/VBox/SUPDrvMangling.h=>include/VBox/SUPDrvMangling.h \ ${PATH_ROOT}/include/VBox/vmm/hwacc_vmx.h=>include/VBox/vmm/hwacc_vmx.h \ ${PATH_ROOT}/include/VBox/vmm/hwacc_svm.h=>include/VBox/vmm/hwacc_svm.h \ - ${PATH_ROOT}/include/VBox/x86.h=>include/VBox/x86.h \ ${PATH_ROOT}/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c=>linux/SUPDrv-linux.c \ ${PATH_ROOT}/src/VBox/HostDrivers/Support/SUPDrv.c=>SUPDrv.c \ ${PATH_ROOT}/src/VBox/HostDrivers/Support/SUPDrvSem.c=>SUPDrvSem.c \ @@ -110,12 +110,20 @@ FILES_VBOXDRV_NOBIN=" \ ${PATH_ROOT}/src/VBox/Runtime/common/misc/handletable.cpp=>common/misc/handletable.c \ ${PATH_ROOT}/src/VBox/Runtime/common/misc/handletable.h=>common/misc/handletable.h \ ${PATH_ROOT}/src/VBox/Runtime/common/misc/handletablectx.cpp=>common/misc/handletablectx.c \ + ${PATH_ROOT}/src/VBox/Runtime/common/misc/thread.cpp=>common/misc/thread.c \ ${PATH_ROOT}/src/VBox/Runtime/common/string/RTStrCopyP.cpp=>common/string/RTStrCopyP.c \ ${PATH_ROOT}/src/VBox/Runtime/common/string/strformat.cpp=>common/string/strformat.c \ ${PATH_ROOT}/src/VBox/Runtime/common/string/strformatrt.cpp=>common/string/strformatrt.c \ ${PATH_ROOT}/src/VBox/Runtime/common/string/strformattype.cpp=>common/string/strformattype.c \ ${PATH_ROOT}/src/VBox/Runtime/common/string/strprintf.cpp=>common/string/strprintf.c \ ${PATH_ROOT}/src/VBox/Runtime/common/string/strtonum.cpp=>common/string/strtonum.c \ + ${PATH_ROOT}/src/VBox/Runtime/common/table/avlpv.cpp=>common/table/avlpv.c \ + ${PATH_ROOT}/src/VBox/Runtime/common/table/avl_Base.cpp.h=>common/table/avl_Base.cpp.h \ + ${PATH_ROOT}/src/VBox/Runtime/common/table/avl_Get.cpp.h=>common/table/avl_Get.cpp.h \ + ${PATH_ROOT}/src/VBox/Runtime/common/table/avl_GetBestFit.cpp.h=>common/table/avl_GetBestFit.cpp.h \ + ${PATH_ROOT}/src/VBox/Runtime/common/table/avl_RemoveBestFit.cpp.h=>common/table/avl_RemoveBestFit.cpp.h \ + ${PATH_ROOT}/src/VBox/Runtime/common/table/avl_DoWithAll.cpp.h=>common/table/avl_DoWithAll.cpp.h \ + ${PATH_ROOT}/src/VBox/Runtime/common/table/avl_Destroy.cpp.h=>common/table/avl_Destroy.cpp.h \ ${PATH_ROOT}/src/VBox/Runtime/common/time/time.cpp=>common/time/time.c \ ${PATH_ROOT}/src/VBox/Runtime/include/internal/assert.h=>include/internal/assert.h \ ${PATH_ROOT}/src/VBox/Runtime/include/internal/initterm.h=>include/internal/initterm.h \ @@ -124,6 +132,8 @@ FILES_VBOXDRV_NOBIN=" \ ${PATH_ROOT}/src/VBox/Runtime/include/internal/magics.h=>include/internal/magics.h \ ${PATH_ROOT}/src/VBox/Runtime/include/internal/memobj.h=>include/internal/memobj.h \ ${PATH_ROOT}/src/VBox/Runtime/include/internal/string.h=>include/internal/string.h \ + ${PATH_ROOT}/src/VBox/Runtime/include/internal/sched.h=>include/internal/sched.h \ + ${PATH_ROOT}/src/VBox/Runtime/include/internal/process.h=>include/internal/process.h \ ${PATH_ROOT}/src/VBox/Runtime/include/internal/thread.h=>include/internal/thread.h \ ${PATH_ROOT}/src/VBox/Runtime/include/internal/time.h=>include/internal/time.h \ ${PATH_ROOT}/src/VBox/Runtime/generic/RTAssertShouldPanic-generic.cpp=>generic/RTAssertShouldPanic-generic.c \ @@ -136,6 +146,7 @@ FILES_VBOXDRV_NOBIN=" \ ${PATH_ROOT}/src/VBox/Runtime/generic/RTSemEventMultiWait-2-ex-generic.cpp=>generic/RTSemEventMultiWait-2-ex-generic.c \ ${PATH_ROOT}/src/VBox/Runtime/generic/RTSemEventMultiWaitNoResume-2-ex-generic.cpp=>generic/RTSemEventMultiWaitNoResume-2-ex-generic.c \ ${PATH_ROOT}/src/VBox/Runtime/generic/RTTimerCreate-generic.cpp=>generic/RTTimerCreate-generic.c \ + ${PATH_ROOT}/src/VBox/Runtime/generic/errvars-generic.cpp=>generic/errvars-generic.c \ ${PATH_ROOT}/src/VBox/Runtime/generic/mppresent-generic.cpp=>generic/mppresent-generic.c \ ${PATH_ROOT}/src/VBox/Runtime/generic/uuid-generic.cpp=>generic/uuid-generic.c \ ${PATH_ROOT}/src/VBox/Runtime/r0drv/alloc-r0drv.cpp=>r0drv/alloc-r0drv.c \ diff --git a/src/VBox/HostDrivers/Support/os2/SUPDrv-os2.cpp b/src/VBox/HostDrivers/Support/os2/SUPDrv-os2.cpp index eea542845..de1671e29 100644 --- a/src/VBox/HostDrivers/Support/os2/SUPDrv-os2.cpp +++ b/src/VBox/HostDrivers/Support/os2/SUPDrv-os2.cpp @@ -1,4 +1,4 @@ -/* $Id: SUPDrv-os2.cpp $ */ +/* $Id: SUPDrv-os2.cpp 37249 2011-05-30 10:03:45Z vboxsync $ */ /** @file * VBoxDrv - The VirtualBox Support Driver - OS/2 specifics. */ @@ -396,9 +396,9 @@ int VBOXCALL supdrvOSLdrValidatePointer(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAG } -int VBOXCALL supdrvOSLdrLoad(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage, const uint8_t *pbImageBits) +int VBOXCALL supdrvOSLdrLoad(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage, const uint8_t *pbImageBits, PSUPLDRLOAD pReq) { - NOREF(pDevExt); NOREF(pImage); NOREF(pbImageBits); + NOREF(pDevExt); NOREF(pImage); NOREF(pbImageBits); NOREF(pReq); return VERR_NOT_SUPPORTED; } diff --git a/src/VBox/HostDrivers/Support/os2/SUPDrv-os2.def b/src/VBox/HostDrivers/Support/os2/SUPDrv-os2.def index 420bfd619..51d2899d8 100644 --- a/src/VBox/HostDrivers/Support/os2/SUPDrv-os2.def +++ b/src/VBox/HostDrivers/Support/os2/SUPDrv-os2.def @@ -1,4 +1,4 @@ -; $Id: SUPDrv-os2.def $ +; $Id: SUPDrv-os2.def 28800 2010-04-27 08:22:32Z vboxsync $ ;; @file ; VBoxDrv - OS/2 definition file. ; diff --git a/src/VBox/HostDrivers/Support/os2/SUPDrvA-os2.asm b/src/VBox/HostDrivers/Support/os2/SUPDrvA-os2.asm index 5992ecd16..280470cc4 100644 --- a/src/VBox/HostDrivers/Support/os2/SUPDrvA-os2.asm +++ b/src/VBox/HostDrivers/Support/os2/SUPDrvA-os2.asm @@ -1,4 +1,4 @@ -; $Id: SUPDrvA-os2.asm $ +; $Id: SUPDrvA-os2.asm 22077 2009-08-07 16:01:57Z vboxsync $ ;; @file ; VBoxDrv - OS/2 assembly file, the first file in the link. ; diff --git a/src/VBox/HostDrivers/Support/os2/SUPLib-os2.cpp b/src/VBox/HostDrivers/Support/os2/SUPLib-os2.cpp index 67cc79648..0f72caad2 100644 --- a/src/VBox/HostDrivers/Support/os2/SUPLib-os2.cpp +++ b/src/VBox/HostDrivers/Support/os2/SUPLib-os2.cpp @@ -1,4 +1,4 @@ -/* $Id: SUPLib-os2.cpp $ */ +/* $Id: SUPLib-os2.cpp 37596 2011-06-22 19:30:06Z vboxsync $ */ /** @file * VirtualBox Support Library - OS/2 specific parts. */ @@ -99,7 +99,7 @@ int suplibOsInit(PSUPLIBDATA pThis, bool fPreInited) return vrc; } - pThis->hDevice = (RTFILE)hDevice; + pThis->hDevice = hDevice; return VINF_SUCCESS; } @@ -111,11 +111,11 @@ int suplibOsTerm(PSUPLIBDATA pThis) /* * Check if we're inited at all. */ - if (pThis->hDevice != NIL_RTFILE) + if (pThis->hDevice != (intptr_t)NIL_RTFILE) { APIRET rc = DosClose((HFILE)pThis->hDevice); AssertMsg(rc == NO_ERROR, ("%d\n", rc)); NOREF(rc); - pThis->hDevice = NIL_RTFILE; + pThis->hDevice = (intptr_t)NIL_RTFILE; } return 0; diff --git a/src/VBox/HostDrivers/Support/os2/SUPR0IdcClient-os2.c b/src/VBox/HostDrivers/Support/os2/SUPR0IdcClient-os2.c index a20af4603..5455545bf 100644 --- a/src/VBox/HostDrivers/Support/os2/SUPR0IdcClient-os2.c +++ b/src/VBox/HostDrivers/Support/os2/SUPR0IdcClient-os2.c @@ -1,4 +1,4 @@ -/* $Id: SUPR0IdcClient-os2.c $ */ +/* $Id: SUPR0IdcClient-os2.c 28800 2010-04-27 08:22:32Z vboxsync $ */ /** @file * VirtualBox Support Driver - IDC Client Lib, OS/2 Specific Code. */ diff --git a/src/VBox/HostDrivers/Support/solaris/SUPDrv-solaris.c b/src/VBox/HostDrivers/Support/solaris/SUPDrv-solaris.c index e8ba15a66..6e8b6c385 100644 --- a/src/VBox/HostDrivers/Support/solaris/SUPDrv-solaris.c +++ b/src/VBox/HostDrivers/Support/solaris/SUPDrv-solaris.c @@ -1,4 +1,4 @@ -/* $Id: SUPDrv-solaris.c $ */ +/* $Id: SUPDrv-solaris.c 37280 2011-05-31 21:31:19Z vboxsync $ */ /** @file * VBoxDrv - The VirtualBox Support Driver - Solaris specifics. */ @@ -34,6 +34,8 @@ #include <sys/uio.h> #include <sys/buf.h> #include <sys/modctl.h> +#include <sys/kobj.h> +#include <sys/kobj_impl.h> #include <sys/open.h> #include <sys/conf.h> #include <sys/cmn_err.h> @@ -50,6 +52,7 @@ #include <iprt/semaphore.h> #include <iprt/spinlock.h> #include <iprt/mp.h> +#include <iprt/path.h> #include <iprt/power.h> #include <iprt/process.h> #include <iprt/thread.h> @@ -180,7 +183,7 @@ static PSUPDRVSESSION g_apSessionHashTab[19]; /** Spinlock protecting g_apSessionHashTab. */ static RTSPINLOCK g_Spinlock = NIL_RTSPINLOCK; /** Calculates bucket index into g_apSessionHashTab.*/ -#define SESSION_HASH(sfn) ((sfn) % RT_ELEMENTS(g_apSessionHashTab)) +#define SESSION_HASH(sfn) ((sfn) % RT_ELEMENTS(g_apSessionHashTab)) /** * Kernel entry points @@ -892,11 +895,232 @@ bool VBOXCALL supdrvOSGetForcedAsyncTscMode(PSUPDRVDEVEXT pDevExt) return false; } +#if defined(VBOX_WITH_NATIVE_SOLARIS_LOADING) \ + && !defined(VBOX_WITHOUT_NATIVE_R0_LOADER) + +int VBOXCALL supdrvOSLdrOpen(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage, const char *pszFilename) +{ + pImage->idSolMod = -1; + pImage->pSolModCtl = NULL; + +# if 1 /* This approach requires _init/_fini/_info stubs. */ + /* + * Construct a filename that escapes the module search path and let us + * specify a root path. + */ + /** @todo change this to use modctl and use_path=0. */ + const char *pszName = RTPathFilename(pszFilename); + AssertReturn(pszName, VERR_INVALID_PARAMETER); + char *pszSubDir = RTStrAPrintf2("../../../../../../../../../../..%.*s", pszName - pszFilename - 1, pszFilename); + if (!pszSubDir) + return VERR_NO_STR_MEMORY; + int idMod = modload(pszSubDir, pszName); + if (idMod == -1) + { + /* This is an horrible hack for avoiding the mod-present check in + modrload on S10. Fortunately, nobody else seems to be using that + variable... */ + extern int swaploaded; + int saved_swaploaded = swaploaded; + swaploaded = 0; + idMod = modload(pszSubDir, pszName); + swaploaded = saved_swaploaded; + } + RTStrFree(pszSubDir); + if (idMod == -1) + { + LogRel(("modload(,%s): failed, could be anything...\n", pszFilename)); + return VERR_LDR_GENERAL_FAILURE; + } + + modctl_t *pModCtl = mod_hold_by_id(idMod); + if (!pModCtl) + { + LogRel(("mod_hold_by_id(,%s): failed, weird.\n", pszFilename)); + /* No point in calling modunload. */ + return VERR_LDR_GENERAL_FAILURE; + } + pModCtl->mod_loadflags |= MOD_NOAUTOUNLOAD | MOD_NOUNLOAD; /* paranoia */ + +# else + + const int idMod = -1; + modctl_t *pModCtl = mod_hold_by_name(pszFilename); + if (!pModCtl) + { + LogRel(("mod_hold_by_name failed for '%s'\n", pszFilename)); + return VERR_LDR_GENERAL_FAILURE; + } + + int rc = kobj_load_module(pModCtl, 0 /*use_path*/); + if (rc != 0) + { + LogRel(("kobj_load_module failed with rc=%d for '%s'\n", rc, pszFilename)); + mod_release_mod(pModCtl); + return RTErrConvertFromErrno(rc); + } +# endif + + /* + * Get the module info. + * + * Note! The text section is actually not at mi_base, but and the next + * alignment boundrary and there seems to be no easy way of + * getting at this address. This sabotages supdrvOSLdrLoad. + * Bastards! + */ + struct modinfo ModInfo; + kobj_getmodinfo(pModCtl->mod_mp, &ModInfo); + pImage->pvImage = ModInfo.mi_base; + pImage->idSolMod = idMod; + pImage->pSolModCtl = pModCtl; + + mod_release_mod(pImage->pSolModCtl); + LogRel(("supdrvOSLdrOpen: succeeded for '%s' (mi_base=%p mi_size=%#x), id=%d ctl=%p\n", + pszFilename, ModInfo.mi_base, ModInfo.mi_size, idMod, pModCtl)); + return VINF_SUCCESS; +} + + +int VBOXCALL supdrvOSLdrValidatePointer(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage, void *pv, const uint8_t *pbImageBits) +{ + NOREF(pDevExt); NOREF(pImage); NOREF(pv); NOREF(pbImageBits); + if (kobj_addrcheck(pImage->pSolModCtl->mod_mp, pv)) + return VERR_INVALID_PARAMETER; + return VINF_SUCCESS; +} + + +/** + * Resolves a module entry point address. + * + * @returns VBox status code. + * @param pImage The image. + * @param pszSymbol The symbol name. + * @param ppvValue Where to store the value. On input this holds + * the symbol value SUPLib calculated. + */ +static int supdrvSolLdrResolvEp(PSUPDRVLDRIMAGE pImage, const char *pszSymbol, void **ppvValue) +{ + /* Don't try resolve symbols which, according to SUPLib, aren't there. */ + if (!*ppvValue) + return VINF_SUCCESS; + + uintptr_t uValue = modlookup_by_modctl(pImage->pSolModCtl, pszSymbol); + if (!uValue) + { + LogRel(("supdrvOSLdrLoad on %s failed to resolve %s\n", pImage->szName, pszSymbol)); + return VERR_SYMBOL_NOT_FOUND; + } + *ppvValue = (void *)uValue; + return VINF_SUCCESS; +} + + +int VBOXCALL supdrvOSLdrLoad(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage, const uint8_t *pbImageBits, PSUPLDRLOAD pReq) +{ +#if 0 /* This doesn't work because of text alignment. */ + /* + * Comparing is very very difficult since text and data may be allocated + * separately. + */ + size_t cbCompare = RT_MIN(pImage->cbImageBits, 64); + if (memcmp(pImage->pvImage, pbImageBits, cbCompare)) + { + LogRel(("Image mismatch: %s (%p)\n", pImage->szName, pImage->pvImage)); + LogRel(("Native: %.*Rhxs\n", cbCompare, pImage->pvImage)); + LogRel(("SUPLib: %.*Rhxs\n", cbCompare, pbImageBits)); + return VERR_LDR_MISMATCH_NATIVE; + } +#endif + + /* + * Get the exported symbol addresses. + */ + int rc; + modctl_t *pModCtl = mod_hold_by_id(pImage->idSolMod); + if (pModCtl && pModCtl == pImage->pSolModCtl) + { + uint32_t iSym = pImage->cSymbols; + while (iSym-- > 0) + { + const char *pszSymbol = &pImage->pachStrTab[pImage->paSymbols[iSym].offName]; + uintptr_t uValue = modlookup_by_modctl(pImage->pSolModCtl, pszSymbol); + if (!uValue) + { + LogRel(("supdrvOSLdrLoad on %s failed to resolve the exported symbol: '%s'\n", pImage->szName, pszSymbol)); + break; + } + uintptr_t offSymbol = uValue - (uintptr_t)pImage->pvImage; + pImage->paSymbols[iSym].offSymbol = offSymbol; + if (pImage->paSymbols[iSym].offSymbol != (int32_t)offSymbol) + { + LogRel(("supdrvOSLdrLoad on %s symbol out of range: %p (%s) \n", pImage->szName, offSymbol, pszSymbol)); + break; + } + } + + rc = iSym == UINT32_MAX ? VINF_SUCCESS : VERR_LDR_GENERAL_FAILURE; + + /* + * Get the standard module entry points. + */ + if (RT_SUCCESS(rc)) + { + rc = supdrvSolLdrResolvEp(pImage, "ModuleInit", (void **)&pImage->pfnModuleInit); + if (RT_SUCCESS(rc)) + rc = supdrvSolLdrResolvEp(pImage, "ModuleTerm", (void **)&pImage->pfnModuleTerm); + + switch (pReq->u.In.eEPType) + { + case SUPLDRLOADEP_VMMR0: + { + if (RT_SUCCESS(rc)) + rc = supdrvSolLdrResolvEp(pImage, "VMMR0EntryInt", (void **)&pReq->u.In.EP.VMMR0.pvVMMR0EntryInt); + if (RT_SUCCESS(rc)) + rc = supdrvSolLdrResolvEp(pImage, "VMMR0EntryFast", (void **)&pReq->u.In.EP.VMMR0.pvVMMR0EntryFast); + if (RT_SUCCESS(rc)) + rc = supdrvSolLdrResolvEp(pImage, "VMMR0EntryEx", (void **)&pReq->u.In.EP.VMMR0.pvVMMR0EntryEx); + break; + } + + case SUPLDRLOADEP_SERVICE: + { + /** @todo we need the name of the entry point. */ + return VERR_NOT_SUPPORTED; + } + } + } + + mod_release_mod(pImage->pSolModCtl); + } + else + { + LogRel(("mod_hold_by_id failed in supdrvOSLdrLoad on %s: %p\n", pImage->szName, pModCtl)); + rc = VERR_LDR_MISMATCH_NATIVE; + } + return rc; +} + + +void VBOXCALL supdrvOSLdrUnload(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage) +{ +# if 1 + pImage->pSolModCtl->mod_loadflags &= ~MOD_NOUNLOAD; + int rc = modunload(pImage->idSolMod); + if (rc) + LogRel(("modunload(%u (%s)) failed: %d\n", pImage->idSolMod, pImage->szName, rc)); +# else + kobj_unload_module(pImage->pSolModCtl); +# endif + pImage->pSolModCtl = NULL; + pImage->idSolMod = NULL; +} + +#else /* !VBOX_WITH_NATIVE_SOLARIS_LOADING */ int VBOXCALL supdrvOSLdrOpen(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage, const char *pszFilename) { - /** @todo This is something that shouldn't be impossible to implement - * here and would make a few people happy. */ NOREF(pDevExt); NOREF(pImage); NOREF(pszFilename); return VERR_NOT_SUPPORTED; } @@ -909,9 +1133,9 @@ int VBOXCALL supdrvOSLdrValidatePointer(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAG } -int VBOXCALL supdrvOSLdrLoad(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage, const uint8_t *pbImageBits) +int VBOXCALL supdrvOSLdrLoad(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage, const uint8_t *pbImageBits, PSUPLDRLOAD pReq) { - NOREF(pDevExt); NOREF(pImage); NOREF(pbImageBits); + NOREF(pDevExt); NOREF(pImage); NOREF(pbImageBits); NOREF(pReq); return VERR_NOT_SUPPORTED; } @@ -921,6 +1145,8 @@ void VBOXCALL supdrvOSLdrUnload(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage) NOREF(pDevExt); NOREF(pImage); } +#endif /* !VBOX_WITH_NATIVE_SOLARIS_LOADING */ + RTDECL(int) SUPR0Printf(const char *pszFormat, ...) { diff --git a/src/VBox/HostDrivers/Support/solaris/SUPLib-solaris.cpp b/src/VBox/HostDrivers/Support/solaris/SUPLib-solaris.cpp index db3b55cc7..ef294df06 100644 --- a/src/VBox/HostDrivers/Support/solaris/SUPLib-solaris.cpp +++ b/src/VBox/HostDrivers/Support/solaris/SUPLib-solaris.cpp @@ -1,4 +1,4 @@ -/* $Id: SUPLib-solaris.cpp $ */ +/* $Id: SUPLib-solaris.cpp 37611 2011-06-23 12:32:04Z vboxsync $ */ /** @file * VirtualBox Support Library - Solaris specific parts. */ @@ -157,11 +157,11 @@ int suplibOsTerm(PSUPLIBDATA pThis) /* * Check if we're initialized */ - if (pThis->hDevice != NIL_RTFILE) + if (pThis->hDevice != (intptr_t)NIL_RTFILE) { if (close(pThis->hDevice)) AssertFailed(); - pThis->hDevice = NIL_RTFILE; + pThis->hDevice = (intptr_t)NIL_RTFILE; } return VINF_SUCCESS; diff --git a/src/VBox/HostDrivers/Support/solaris/SUPR0IdcClient-solaris.c b/src/VBox/HostDrivers/Support/solaris/SUPR0IdcClient-solaris.c index 033fcdec5..5b33761d7 100644 --- a/src/VBox/HostDrivers/Support/solaris/SUPR0IdcClient-solaris.c +++ b/src/VBox/HostDrivers/Support/solaris/SUPR0IdcClient-solaris.c @@ -1,4 +1,4 @@ -/* $Id: SUPR0IdcClient-solaris.c $ */ +/* $Id: SUPR0IdcClient-solaris.c 28800 2010-04-27 08:22:32Z vboxsync $ */ /** @file * VirtualBox Support Driver - IDC Client Lib, Solaris Specific Code. */ diff --git a/src/VBox/HostDrivers/Support/solaris/mod.sh b/src/VBox/HostDrivers/Support/solaris/mod.sh index 89069fec5..5ebb39f2c 100755 --- a/src/VBox/HostDrivers/Support/solaris/mod.sh +++ b/src/VBox/HostDrivers/Support/solaris/mod.sh @@ -1,11 +1,11 @@ #!/bin/sh -# $Id: mod.sh $ +# $Id: mod.sh 37314 2011-06-03 09:23:02Z vboxsync $ ## @file # Helper script for installing the solaris module in a development environment. # # -# Copyright (C) 2006-2009 Oracle Corporation +# Copyright (C) 2006-2011 Oracle Corporation # # This file is part of VirtualBox Open Source Edition (OSE), as # available from http://www.virtualbox.org. This file is free software; @@ -70,7 +70,6 @@ old_id=`/usr/sbin/modinfo | /usr/xpg4/bin/grep vbox | grep -v vboxguest | grep - if test -n "$old_id"; then echo "* unloading $old_id..." sync - sync $SUDO /usr/sbin/modunload -i $old_id #else # echo "* If it fails below, run: $SUDO add_drv -m'* 0666 root sys' vboxdrv" @@ -91,7 +90,6 @@ fi echo "* loading vboxdrv..." sync -sync $SUDO /usr/sbin/modload $VBOXDRV_DIR/vboxdrv /usr/sbin/modinfo | /usr/xpg4/bin/grep vboxdrv echo "* dmesg:" diff --git a/src/VBox/HostDrivers/Support/testcase/Makefile.kmk b/src/VBox/HostDrivers/Support/testcase/Makefile.kmk index 5ec98e0df..f66e4ce08 100644 --- a/src/VBox/HostDrivers/Support/testcase/Makefile.kmk +++ b/src/VBox/HostDrivers/Support/testcase/Makefile.kmk @@ -1,4 +1,4 @@ -# $Id: Makefile.kmk $ +# $Id: Makefile.kmk 28800 2010-04-27 08:22:32Z vboxsync $ ## @file # Sub-Makefile for the SUPLib testcases. # diff --git a/src/VBox/HostDrivers/Support/testcase/SUPInstall.cpp b/src/VBox/HostDrivers/Support/testcase/SUPInstall.cpp index 58b3f749b..9b9988c20 100644 --- a/src/VBox/HostDrivers/Support/testcase/SUPInstall.cpp +++ b/src/VBox/HostDrivers/Support/testcase/SUPInstall.cpp @@ -1,4 +1,4 @@ -/* $Id: SUPInstall.cpp $ */ +/* $Id: SUPInstall.cpp 28800 2010-04-27 08:22:32Z vboxsync $ */ /** @file * SUPInstall - Driver Install */ diff --git a/src/VBox/HostDrivers/Support/testcase/SUPLoggerCtl.cpp b/src/VBox/HostDrivers/Support/testcase/SUPLoggerCtl.cpp index 162ae9c06..72e24b0a4 100644 --- a/src/VBox/HostDrivers/Support/testcase/SUPLoggerCtl.cpp +++ b/src/VBox/HostDrivers/Support/testcase/SUPLoggerCtl.cpp @@ -1,4 +1,4 @@ -/* $Id: SUPLoggerCtl.cpp $ */ +/* $Id: SUPLoggerCtl.cpp 28800 2010-04-27 08:22:32Z vboxsync $ */ /** @file * SUPLoggerCtl - Support Driver Logger Control. */ diff --git a/src/VBox/HostDrivers/Support/testcase/SUPUninstall.cpp b/src/VBox/HostDrivers/Support/testcase/SUPUninstall.cpp index 44d7d3db8..d1f7d8dd2 100644 --- a/src/VBox/HostDrivers/Support/testcase/SUPUninstall.cpp +++ b/src/VBox/HostDrivers/Support/testcase/SUPUninstall.cpp @@ -1,4 +1,4 @@ -/* $Id: SUPUninstall.cpp $ */ +/* $Id: SUPUninstall.cpp 28800 2010-04-27 08:22:32Z vboxsync $ */ /** @file * SUPUninstall - Driver Uninstall. */ diff --git a/src/VBox/HostDrivers/Support/testcase/tstContiguous.cpp b/src/VBox/HostDrivers/Support/testcase/tstContiguous.cpp index 328857885..7496dc2e3 100644 --- a/src/VBox/HostDrivers/Support/testcase/tstContiguous.cpp +++ b/src/VBox/HostDrivers/Support/testcase/tstContiguous.cpp @@ -1,4 +1,4 @@ -/* $Id: tstContiguous.cpp $ */ +/* $Id: tstContiguous.cpp 28800 2010-04-27 08:22:32Z vboxsync $ */ /** @file * SUP Testcase - Contiguous Memory Interface (ring-3). */ diff --git a/src/VBox/HostDrivers/Support/testcase/tstGIP-2.cpp b/src/VBox/HostDrivers/Support/testcase/tstGIP-2.cpp index 2039292a6..e198185dd 100644 --- a/src/VBox/HostDrivers/Support/testcase/tstGIP-2.cpp +++ b/src/VBox/HostDrivers/Support/testcase/tstGIP-2.cpp @@ -1,4 +1,4 @@ -/* $Id: tstGIP-2.cpp $ */ +/* $Id: tstGIP-2.cpp 33595 2010-10-29 10:35:00Z vboxsync $ */ /** @file * SUP Testcase - Global Info Page interface (ring 3). */ diff --git a/src/VBox/HostDrivers/Support/testcase/tstGetPagingMode.cpp b/src/VBox/HostDrivers/Support/testcase/tstGetPagingMode.cpp index 1368f0ceb..c48a4fe6c 100644 --- a/src/VBox/HostDrivers/Support/testcase/tstGetPagingMode.cpp +++ b/src/VBox/HostDrivers/Support/testcase/tstGetPagingMode.cpp @@ -1,4 +1,4 @@ -/* $Id: tstGetPagingMode.cpp $ */ +/* $Id: tstGetPagingMode.cpp 28800 2010-04-27 08:22:32Z vboxsync $ */ /** @file * SUP Testcase - Host paging mode interface (ring 3). */ diff --git a/src/VBox/HostDrivers/Support/testcase/tstInit.cpp b/src/VBox/HostDrivers/Support/testcase/tstInit.cpp index 8c46e1adc..81290ec5e 100644 --- a/src/VBox/HostDrivers/Support/testcase/tstInit.cpp +++ b/src/VBox/HostDrivers/Support/testcase/tstInit.cpp @@ -1,4 +1,4 @@ -/* $Id: tstInit.cpp $ */ +/* $Id: tstInit.cpp 28800 2010-04-27 08:22:32Z vboxsync $ */ /** @file * SUP Testcase - Support Library initialization and termination. */ diff --git a/src/VBox/HostDrivers/Support/testcase/tstInt.cpp b/src/VBox/HostDrivers/Support/testcase/tstInt.cpp index d853cc4ae..349bf00ee 100644 --- a/src/VBox/HostDrivers/Support/testcase/tstInt.cpp +++ b/src/VBox/HostDrivers/Support/testcase/tstInt.cpp @@ -1,4 +1,4 @@ -/* $Id: tstInt.cpp $ */ +/* $Id: tstInt.cpp 35346 2010-12-27 16:13:13Z vboxsync $ */ /** @file * SUP Testcase - Test the interrupt gate feature of the support library. */ diff --git a/src/VBox/HostDrivers/Support/testcase/tstLow.cpp b/src/VBox/HostDrivers/Support/testcase/tstLow.cpp index 553c4711a..4983f98d0 100644 --- a/src/VBox/HostDrivers/Support/testcase/tstLow.cpp +++ b/src/VBox/HostDrivers/Support/testcase/tstLow.cpp @@ -1,4 +1,4 @@ -/* $Id: tstLow.cpp $ */ +/* $Id: tstLow.cpp 28800 2010-04-27 08:22:32Z vboxsync $ */ /** @file * SUP Testcase - Low (<4GB) Memory Allocate interface (ring 3). */ diff --git a/src/VBox/HostDrivers/Support/testcase/tstPage.cpp b/src/VBox/HostDrivers/Support/testcase/tstPage.cpp index bcb550312..286679c03 100644 --- a/src/VBox/HostDrivers/Support/testcase/tstPage.cpp +++ b/src/VBox/HostDrivers/Support/testcase/tstPage.cpp @@ -1,4 +1,4 @@ -/* $Id: tstPage.cpp $ */ +/* $Id: tstPage.cpp 28800 2010-04-27 08:22:32Z vboxsync $ */ /** @file * SUP Testcase - Page allocation interface (ring 3). */ diff --git a/src/VBox/HostDrivers/Support/testcase/tstPin.cpp b/src/VBox/HostDrivers/Support/testcase/tstPin.cpp index ff6a36dfd..da4096ae0 100644 --- a/src/VBox/HostDrivers/Support/testcase/tstPin.cpp +++ b/src/VBox/HostDrivers/Support/testcase/tstPin.cpp @@ -1,4 +1,4 @@ -/* $Id: tstPin.cpp $ */ +/* $Id: tstPin.cpp 28800 2010-04-27 08:22:32Z vboxsync $ */ /** @file * SUP Testcase - Memory locking interface (ring 3). */ diff --git a/src/VBox/HostDrivers/Support/testcase/tstSupLoadModule.cpp b/src/VBox/HostDrivers/Support/testcase/tstSupLoadModule.cpp index cbe204ffb..27d748867 100644 --- a/src/VBox/HostDrivers/Support/testcase/tstSupLoadModule.cpp +++ b/src/VBox/HostDrivers/Support/testcase/tstSupLoadModule.cpp @@ -1,4 +1,4 @@ -/* $Id: tstSupLoadModule.cpp $ */ +/* $Id: tstSupLoadModule.cpp 35188 2010-12-16 15:13:07Z vboxsync $ */ /** @file * SUP Testcase - Test SUPR3LoadModule. */ @@ -94,7 +94,7 @@ int main(int argc, char **argv) return 1; case 'V': - RTPrintf("$Revision: 69027 $\n"); + RTPrintf("$Revision: 35188 $\n"); return 0; default: diff --git a/src/VBox/HostDrivers/Support/testcase/tstSupSem-Zombie.cpp b/src/VBox/HostDrivers/Support/testcase/tstSupSem-Zombie.cpp index 844446428..6954c1b17 100644 --- a/src/VBox/HostDrivers/Support/testcase/tstSupSem-Zombie.cpp +++ b/src/VBox/HostDrivers/Support/testcase/tstSupSem-Zombie.cpp @@ -1,4 +1,4 @@ -/* $Id: tstSupSem-Zombie.cpp $ */ +/* $Id: tstSupSem-Zombie.cpp 28800 2010-04-27 08:22:32Z vboxsync $ */ /** @file * Support Library Testcase - Ring-3 Semaphore interface - Zombie bugs. */ diff --git a/src/VBox/HostDrivers/Support/testcase/tstSupSem.cpp b/src/VBox/HostDrivers/Support/testcase/tstSupSem.cpp index 14ee9ef59..81ebf1fa9 100644 --- a/src/VBox/HostDrivers/Support/testcase/tstSupSem.cpp +++ b/src/VBox/HostDrivers/Support/testcase/tstSupSem.cpp @@ -1,4 +1,4 @@ -/* $Id: tstSupSem.cpp $ */ +/* $Id: tstSupSem.cpp 33383 2010-10-24 14:33:13Z vboxsync $ */ /** @file * Support Library Testcase - Ring-3 Semaphore interface. */ diff --git a/src/VBox/HostDrivers/Support/win/SUPDrv-win.cpp b/src/VBox/HostDrivers/Support/win/SUPDrv-win.cpp index cfa7c4c89..5df1502ea 100644 --- a/src/VBox/HostDrivers/Support/win/SUPDrv-win.cpp +++ b/src/VBox/HostDrivers/Support/win/SUPDrv-win.cpp @@ -1,4 +1,4 @@ -/* $Id: SUPDrv-win.cpp $ */ +/* $Id: SUPDrv-win.cpp 37249 2011-05-30 10:03:45Z vboxsync $ */ /** @file * VBoxDrv - The VirtualBox Support Driver - Windows NT specifics. */ @@ -765,9 +765,9 @@ static int supdrvNtCompare(PSUPDRVLDRIMAGE pImage, const uint8_t *pbImageBits, u return iDiff; } -int VBOXCALL supdrvOSLdrLoad(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage, const uint8_t *pbImageBits) +int VBOXCALL supdrvOSLdrLoad(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage, const uint8_t *pbImageBits, PSUPLDRLOAD pReq) { - NOREF(pDevExt); NOREF(pImage); NOREF(pbImageBits); + NOREF(pDevExt); NOREF(pReq); if (pImage->pvNtSectionObj) { /* diff --git a/src/VBox/HostDrivers/Support/win/SUPDrvA-win.asm b/src/VBox/HostDrivers/Support/win/SUPDrvA-win.asm index f7d5e9539..ff2cb4d59 100644 --- a/src/VBox/HostDrivers/Support/win/SUPDrvA-win.asm +++ b/src/VBox/HostDrivers/Support/win/SUPDrvA-win.asm @@ -1,4 +1,4 @@ -; $Id: SUPDrvA-win.asm $ +; $Id: SUPDrvA-win.asm 28800 2010-04-27 08:22:32Z vboxsync $ ;; @file ; VirtualBox Support Driver - Windows NT specific assembly parts. ; diff --git a/src/VBox/HostDrivers/Support/win/SUPLib-win.cpp b/src/VBox/HostDrivers/Support/win/SUPLib-win.cpp index ea60a475e..789641768 100644 --- a/src/VBox/HostDrivers/Support/win/SUPLib-win.cpp +++ b/src/VBox/HostDrivers/Support/win/SUPLib-win.cpp @@ -1,4 +1,4 @@ -/* $Id: SUPLib-win.cpp $ */ +/* $Id: SUPLib-win.cpp 37596 2011-06-22 19:30:06Z vboxsync $ */ /** @file * VirtualBox Support Library - Windows NT specific parts. */ @@ -138,7 +138,7 @@ int suplibOsInit(PSUPLIBDATA pThis, bool fPreInited) /* * We're done. */ - pThis->hDevice = (RTFILE)hDevice; + pThis->hDevice = hDevice; return VINF_SUCCESS; } @@ -474,11 +474,11 @@ int suplibOsTerm(PSUPLIBDATA pThis) /* * Check if we're inited at all. */ - if (pThis->hDevice != NIL_RTFILE) + if (pThis->hDevice != NULL) { if (!CloseHandle((HANDLE)pThis->hDevice)) AssertFailed(); - pThis->hDevice = NIL_RTFILE; + pThis->hDevice = NIL_RTFILE; /* yes, that's right */ } return VINF_SUCCESS; diff --git a/src/VBox/HostDrivers/Support/win/SUPR0IdcClient-win.c b/src/VBox/HostDrivers/Support/win/SUPR0IdcClient-win.c index 01416ab92..099978a10 100644 --- a/src/VBox/HostDrivers/Support/win/SUPR0IdcClient-win.c +++ b/src/VBox/HostDrivers/Support/win/SUPR0IdcClient-win.c @@ -1,4 +1,4 @@ -/* $Id: SUPR0IdcClient-win.c $ */ +/* $Id: SUPR0IdcClient-win.c 33540 2010-10-28 09:27:05Z vboxsync $ */ /** @file * VirtualBox Support Driver - IDC Client Lib, Windows Specific Code. */ diff --git a/src/VBox/HostDrivers/Support/win/SUPSvc-win.cpp b/src/VBox/HostDrivers/Support/win/SUPSvc-win.cpp index 19245e5f8..bb1cd7371 100644 --- a/src/VBox/HostDrivers/Support/win/SUPSvc-win.cpp +++ b/src/VBox/HostDrivers/Support/win/SUPSvc-win.cpp @@ -1,4 +1,4 @@ -/* $Id: SUPSvc-win.cpp $ */ +/* $Id: SUPSvc-win.cpp 33540 2010-10-28 09:27:05Z vboxsync $ */ /** @file * VirtualBox Support Service - Windows Specific Code. */ diff --git a/src/VBox/HostDrivers/Support/win/VBoxDrv.inf b/src/VBox/HostDrivers/Support/win/VBoxDrv.inf index 4a5b8661d..37a453a9f 100644 --- a/src/VBox/HostDrivers/Support/win/VBoxDrv.inf +++ b/src/VBox/HostDrivers/Support/win/VBoxDrv.inf @@ -1,4 +1,4 @@ -; $Id: VBoxDrv.inf $
+; $Id: VBoxDrv.inf 32408 2010-09-10 13:43:23Z vboxsync $
;; @file
; VirtualBox Support Driver - Windows Driver INF file.
;
diff --git a/src/VBox/HostDrivers/Support/win/VBoxDrv.rc b/src/VBox/HostDrivers/Support/win/VBoxDrv.rc index 15c34900b..716936107 100644 --- a/src/VBox/HostDrivers/Support/win/VBoxDrv.rc +++ b/src/VBox/HostDrivers/Support/win/VBoxDrv.rc @@ -1,4 +1,4 @@ -/* $Id: VBoxDrv.rc $ */ +/* $Id: VBoxDrv.rc 32394 2010-09-10 12:13:11Z vboxsync $ */ /** @file * VirtualBox Support Driver - Windows Resource File. */ |
