VirtualBox

Changeset 7272 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Mar 4, 2008 12:33:43 PM (17 years ago)
Author:
vboxsync
Message:

Use MP functions in the runtime.

Location:
trunk/src/VBox/HostDrivers/Support
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/SUPDRV.h

    r7206 r7272  
    700700    KDPC                    GipDpc;
    701701    /** The GIP DPC objects for updating per-cpu data. */
    702     KDPC                    aGipCpuDpcs[32];
     702    KDPC                    aGipCpuDpcs[64];
    703703    /** Pointer to the MDL for the pGip page. */
    704704    PMDL                    pGipMdl;
     
    757757bool VBOXCALL   supdrvOSGetForcedAsyncTscMode(void);
    758758#endif
    759 int  VBOXCALL   supdrvOSExecuteCallback(PSUPDRVSESSION pSession, PFNSUPDRVEXECCALLBACK pfnCallback, void *pvUser, unsigned uCpu);
    760759
    761760
  • trunk/src/VBox/HostDrivers/Support/SUPDRVShared.c

    r7206 r7272  
    3838#include <iprt/thread.h>
    3939#include <iprt/process.h>
     40#include <iprt/mp.h>
    4041#include <iprt/log.h>
    4142
     
    119120    { "SUPR0PageFree",                          (void *)SUPR0PageFree },
    120121    { "SUPR0Printf",                            (void *)SUPR0Printf },
    121     { "SUPR0ExecuteCallback",                   (void *)SUPR0ExecuteCallback },
    122122    { "RTMemAlloc",                             (void *)RTMemAlloc },
    123123    { "RTMemAllocZ",                            (void *)RTMemAllocZ },
     
    184184    { "RTThreadUserWaitNoResume",               (void *)RTThreadUserWaitNoResume },
    185185#endif
     186    { "RTMpOnAll",                              (void *)RTMpOnAll },
     187    { "RTMpOnOthers",                           (void *)RTMpOnOthers },
     188    { "RTMpOnSpecific",                         (void *)RTMpOnSpecific },
    186189    { "RTLogDefaultInstance",                   (void *)RTLogDefaultInstance },
    187190    { "RTLogRelDefaultInstance",                (void *)RTLogRelDefaultInstance },
     
    22082211}
    22092212
    2210 /**
    2211  * Executes a callback handler on a specific cpu or all cpus
    2212  *
    2213  * @returns IPRT status code.
    2214  * @param   pSession    The session.
    2215  * @param   pfnCallback Callback handler
    2216  * @param   pvUser      The first user argument.
    2217  * @param   uCpu        Cpu id or SUPDRVEXECCALLBACK_CPU_ALL for all cpus
    2218  */
    2219 SUPR0DECL(int) SUPR0ExecuteCallback(PSUPDRVSESSION pSession, PFNSUPDRVEXECCALLBACK pfnCallback, void *pvUser, unsigned uCpu)
    2220 {
    2221     int           rc;
    2222     RTSPINLOCKTMP SpinlockTmp = RTSPINLOCKTMP_INITIALIZER;
    2223 
    2224     RTSpinlockAcquire(pSession->Spinlock, &SpinlockTmp);
    2225     rc = supdrvOSExecuteCallback(pSession, pfnCallback, pvUser, uCpu);
    2226     RTSpinlockRelease(pSession->Spinlock, &SpinlockTmp);
    2227     return rc;
    2228 }
    2229 
    22302213
    22312214/**
  • trunk/src/VBox/HostDrivers/Support/darwin/SUPDrv-darwin.cpp

    r7206 r7272  
    640640
    641641/**
    642  * Executes a callback handler on a specific cpu or all cpus
    643  *
    644  * @returns IPRT status code.
    645  * @param   pSession    The session.
    646  * @param   pfnCallback Callback handler
    647  * @param   pvUser      The first user argument.
    648  * @param   uCpu        Cpu id or SUPDRVEXECCALLBACK_CPU_ALL for all cpus
    649  */
    650 int  VBOXCALL   supdrvOSExecuteCallback(PSUPDRVSESSION pSession, PFNSUPDRVEXECCALLBACK pfnCallback, void *pvUser, unsigned uCpu)
    651 {
    652     NOREF(pSession);
    653     NOREF(pfnCallback);
    654     NOREF(pvUser);
    655     NOREF(uCpu);
    656     /** @todo */
    657     return VERR_NOT_IMPLEMENTED;
    658 }
    659 
    660 /**
    661642 * Converts a supdrv error code to a darwin error code.
    662643 *
  • trunk/src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c

    r7206 r7272  
    531531}
    532532
    533 /**
    534  * Executes a callback handler on a specific cpu or all cpus
    535  *
    536  * @returns IPRT status code.
    537  * @param   pSession    The session.
    538  * @param   pfnCallback Callback handler
    539  * @param   pvUser      The first user argument.
    540  * @param   uCpu        Cpu id or SUPDRVEXECCALLBACK_CPU_ALL for all cpus
    541  */
    542 int  VBOXCALL   supdrvOSExecuteCallback(PSUPDRVSESSION pSession, PFNSUPDRVEXECCALLBACK pfnCallback, void *pvUser, unsigned uCpu)
    543 {
    544     NOREF(pSession);
    545     NOREF(pfnCallback);
    546     NOREF(pvUser);
    547     NOREF(uCpu);
    548     /** @todo */
    549     return VERR_NOT_IMPLEMENTED;
    550 }
    551533
    552534SUPR0DECL(int) SUPR0Printf(const char *pszFormat, ...)
  • trunk/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c

    r7206 r7272  
    973973}
    974974
    975 /**
    976  * Executes a callback handler on a specific cpu or all cpus
    977  *
    978  * @returns IPRT status code.
    979  * @param   pSession    The session.
    980  * @param   pfnCallback Callback handler
    981  * @param   pvUser      The first user argument.
    982  * @param   uCpu        Cpu id or SUPDRVEXECCALLBACK_CPU_ALL for all cpus
    983  */
    984 int  VBOXCALL   supdrvOSExecuteCallback(PSUPDRVSESSION pSession, PFNSUPDRVEXECCALLBACK pfnCallback, void *pvUser, unsigned uCpu)
    985 {
    986     NOREF(pSession);
    987     NOREF(pfnCallback);
    988     NOREF(pvUser);
    989     NOREF(uCpu);
    990     /** @todo */
    991     return VERR_NOT_IMPLEMENTED;
    992 }
    993 
    994975
    995976/**
  • trunk/src/VBox/HostDrivers/Support/os2/SUPDrv-os2.cpp

    r7206 r7272  
    378378
    379379/**
    380  * Executes a callback handler on a specific cpu or all cpus
    381  *
    382  * @returns IPRT status code.
    383  * @param   pSession    The session.
    384  * @param   pfnCallback Callback handler
    385  * @param   pvUser      The first user argument.
    386  * @param   uCpu        Cpu id or SUPDRVEXECCALLBACK_CPU_ALL for all cpus
    387  */
    388 int  VBOXCALL   supdrvOSExecuteCallback(PSUPDRVSESSION pSession, PFNSUPDRVEXECCALLBACK pfnCallback, void *pvUser, unsigned uCpu)
    389 {
    390     NOREF(pSession);
    391     NOREF(pfnCallback);
    392     NOREF(pvUser);
    393     NOREF(uCpu);
    394     /** @todo */
    395     return VERR_NOT_IMPLEMENTED;
    396 }
    397 
    398 /**
    399380 * Callback for writing to the log buffer.
    400381 *
  • trunk/src/VBox/HostDrivers/Support/solaris/SUPDrv-solaris.c

    r7206 r7272  
    804804}
    805805
    806 /**
    807  * Executes a callback handler on a specific cpu or all cpus
    808  *
    809  * @returns IPRT status code.
    810  * @param   pSession    The session.
    811  * @param   pfnCallback Callback handler
    812  * @param   pvUser      The first user argument.
    813  * @param   uCpu        Cpu id or SUPDRVEXECCALLBACK_CPU_ALL for all cpus
    814  */
    815 int  VBOXCALL   supdrvOSExecuteCallback(PSUPDRVSESSION pSession, PFNSUPDRVEXECCALLBACK pfnCallback, void *pvUser, unsigned uCpu)
    816 {
    817     NOREF(pSession);
    818     NOREF(pfnCallback);
    819     NOREF(pvUser);
    820     NOREF(uCpu);
    821     /** @todo */
    822     return VERR_NOT_IMPLEMENTED;
    823 }
    824806
    825807RTDECL(int) SUPR0Printf(const char *pszFormat, ...)
  • trunk/src/VBox/HostDrivers/Support/win/SUPDrv-win.cpp

    r7206 r7272  
    456456
    457457/**
    458  * Executes a callback handler on a specific cpu or all cpus
    459  *
    460  * @returns IPRT status code.
    461  * @param   pSession    The session.
    462  * @param   pfnCallback Callback handler
    463  * @param   pvUser      The first user argument.
    464  * @param   uCpu        Cpu id or SUPDRVEXECCALLBACK_CPU_ALL for all cpus
    465  */
    466 int  VBOXCALL   supdrvOSExecuteCallback(PSUPDRVSESSION pSession, PFNSUPDRVEXECCALLBACK pfnCallback, void *pvUser, unsigned uCpu)
    467 {
    468     NOREF(pSession);
    469     NOREF(pfnCallback);
    470     NOREF(pvUser);
    471     NOREF(uCpu);
    472     /** @todo */
    473     return VERR_NOT_IMPLEMENTED;
    474 }
    475 
    476 /**
    477458 * Gets the monotone timestamp (nano seconds).
    478459 * @returns NanoTS.
     
    635616            KIRQL oldIrql;
    636617
    637             Assert(KeGetCurrentIrql() <= DISPATCH_LEVEL);
     618            /* KeQueryActiveProcessors must be executed at IRQL < DISPATCH_LEVEL */
     619            Assert(KeGetCurrentIrql() < DISPATCH_LEVEL);
     620            KAFFINITY Mask = KeQueryActiveProcessors();
     621
     622            /* Raise the IRQL to DISPATCH_LEVEL so we can't be rescheduled to another cpu */
    638623            KeRaiseIrql(DISPATCH_LEVEL, &oldIrql);
    639624
    640625            /*
    641              * We cannot do other than assume a 1:1 relation ship between the
     626             * We cannot do other than assume a 1:1 relationship between the
    642627             * affinity mask and the process despite the warnings in the docs.
    643628             * If someone knows a better way to get this done, please let bird know.
    644629             */
    645             /** @todo our IRQL is too high for KeQueryActiveProcessors!! */
    646630            unsigned iSelf = KeGetCurrentProcessorNumber();
    647             KAFFINITY Mask = KeQueryActiveProcessors();
    648631
    649632            for (unsigned i = 0; i < RT_ELEMENTS(pDevExt->aGipCpuDpcs); i++)
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