VirtualBox

Changeset 19592 in vbox for trunk


Ignore:
Timestamp:
May 11, 2009 11:21:13 PM (16 years ago)
Author:
vboxsync
Message:

HostDrivers/Support,VMMR0: Use critical_enter and critical_exit to disable preemption and sched_pin and sched_unpin to prevent the VM from getting scheduled to another CPU instead of disabling interrupts. Use the IPRT dependency array already present in SUPDrv instead of creating our own

Location:
trunk/src/VBox
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/SUPDrv.c

    r19454 r19592  
    4949#include <VBox/log.h>
    5050#include <VBox/err.h>
    51 #if defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS)
     51#if defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD)
    5252# include <iprt/crc32.h>
    5353# include <iprt/net.h>
     
    427427};
    428428
    429 #if defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS)
     429#if defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD)
    430430/**
    431431 * Drag in the rest of IRPT since we share it with the
     
    446446    NULL
    447447};
    448 #endif  /* RT_OS_DARWIN || RT_OS_SOLARIS */
     448#endif  /* RT_OS_DARWIN || RT_OS_SOLARIS || RT_OS_SOLARIS */
    449449
    450450
  • trunk/src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c

    r19563 r19592  
    4444#include <sys/conf.h>
    4545#include <sys/uio.h>
     46#include <sys/proc.h>
     47#include <sys/sched.h>
    4648
    4749#include "../SUPDrvInternal.h"
     
    117119static SUPDRVDEVEXT         g_VBoxDrvFreeBSDDevExt;
    118120
    119 /** Just a dummy global structure containing a bunch of
    120  * function pointers to code which is wanted in the link.
    121  */
    122 static PFNRT g_apfnVBoxDrvFreeBSDDeps[] =
    123 {
    124     /* Needed for vboxnetflt. */
    125     (PFNRT)RTUuidFromStr,
    126     (PFNRT)RTUuidCompareStr,
    127     NULL
    128 };
    129 
    130121/**
    131122 * Module event handler.
     
    405396        ||  ulCmd == SUP_IOCTL_FAST_DO_HWACC_RUN
    406397        ||  ulCmd == SUP_IOCTL_FAST_DO_NOP)
    407         return supdrvIOCtlFast(ulCmd, *(uint32_t *)pvData, &g_VBoxDrvFreeBSDDevExt, pSession);
     398    {
     399        sched_pin();
     400        critical_enter();
     401        int rc = supdrvIOCtlFast(ulCmd, *(uint32_t *)pvData, &g_VBoxDrvFreeBSDDevExt, pSession);
     402        critical_exit();
     403        sched_unpin();
     404        return rc;
     405    }
    408406
    409407    return VBoxDrvFreeBSDIOCtlSlow(pSession, ulCmd, pvData, pTd);
  • trunk/src/VBox/VMM/VMMR0/VMMR0.cpp

    r19462 r19592  
    619619            STAM_COUNTER_INC(&pVM->vmm.s.StatRunRC);
    620620
    621 #ifndef RT_OS_WINDOWS /** @todo check other hosts */
     621#if !defined(RT_OS_WINDOWS) && !defined(RT_OS_FREEBSD) /** @todo check other hosts */
    622622            RTCCUINTREG uFlags = ASMIntDisableFlags();
    623623#endif
     
    642642
    643643            ASMAtomicWriteU32(&pVCpu->idHostCpu, NIL_RTCPUID);
    644 #ifndef RT_OS_WINDOWS /** @todo check other hosts */
     644#if !defined(RT_OS_WINDOWS) && !defined(RT_OS_FREEBSD) /** @todo check other hosts */
    645645            ASMSetFlags(uFlags);
    646646#endif
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette