VirtualBox

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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);
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