VirtualBox

Changeset 54408 in vbox for trunk/include


Ignore:
Timestamp:
Feb 24, 2015 2:06:56 AM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
98509
Message:

IPRT/r0drv: Added RTMpOnPair and RTMpOnPairIsConcurrentExecSupported, currently generic wrappers around RTMpOnAll but this will change where possible.

Location:
trunk/include/iprt
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/err.h

    r53615 r54408  
    926926/** The requested allocation is too big. */
    927927#define VERR_ALLOCATION_TOO_BIG             (-22407)
     928/** Mismatch. */
     929#define VERR_MISMATCH                       (-22408)
     930/** Wrong type. */
     931#define VERR_WRONG_TYPE                     (-22409)
    928932/** @} */
    929933
     
    16021606/** The specified cpu was not found. */
    16031607#define VERR_CPU_NOT_FOUND                      (-801)
     1608/** Not all of the requested CPUs showed up in the PFNRTMPWORKER. */
     1609#define VERR_NOT_ALL_CPUS_SHOWED                (-802)
     1610/** Internal processing error in the RTMp code.*/
     1611#define VERR_CPU_IPE_1                          (-803)
    16041612/** @} */
    16051613
  • trunk/include/iprt/mp.h

    r54382 r54408  
    246246typedef FNRTMPWORKER *PFNRTMPWORKER;
    247247
     248/** @name RTMPON_F_XXX - RTMpOn flags.
     249 * @{ */
     250/** Caller doesn't care if pfnWorker is executed at the same time on the
     251 *  specified CPUs or not, as long as it gets executed. */
     252#define RTMPON_F_WHATEVER_EXEC      0
     253/** The caller insists on pfnWorker being executed more or less concurrently
     254 * on the specified CPUs. */
     255#define RTMPON_F_CONCURRENT_EXEC    RT_BIT_32(1)
     256/** Mask of valid bits. */
     257#define RTMPON_F_VALID_MASK         UINT32_C(0x00000001)
     258/** @}*/
     259
    248260/**
    249261 * Checks if the RTMpOnAll() is safe with regards to all threads executing
     
    308320 */
    309321RTDECL(int) RTMpOnSpecific(RTCPUID idCpu, PFNRTMPWORKER pfnWorker, void *pvUser1, void *pvUser2);
     322
     323/**
     324 * Executes a function on two specific CPUs in the system.
     325 *
     326 * @returns IPRT status code.
     327 * @retval  VINF_SUCCESS on success.
     328 * @retval  VERR_NOT_SUPPORTED if this kind of operation isn't supported by the
     329 *          system or if the specified modifier flag isn't supported.
     330 * @retval  VERR_CPU_OFFLINE if one or more of the CPUs are offline (see
     331 *          remarks).
     332 * @retval  VERR_CPU_NOT_FOUND if on or both of the CPUs weren't found.
     333 * @retval  VERR_NOT_ALL_CPUS_SHOWED if one of the CPUs didn't show.
     334 *
     335 * @param   idCpu1          The id of the first CPU.
     336 * @param   idCpu2          The id of the second CPU.
     337 * @param   fFlags          Combination of RTMPON_F_XXX flags.
     338 * @param   pfnWorker       The worker function.
     339 * @param   pvUser1         The first user argument for the worker.
     340 * @param   pvUser2         The second user argument for the worker.
     341 *
     342 * @remarks There is a possible race between one (or both) of the CPUs going
     343 *          offline while setting up the call.  The worker function must take
     344 *          this into account.
     345 */
     346RTDECL(int) RTMpOnPair(RTCPUID idCpu1, RTCPUID idCpu2, uint32_t fFlags, PFNRTMPWORKER pfnWorker, void *pvUser1, void *pvUser2);
     347
     348/**
     349 * Indicates whether RTMpOnPair supports running the pfnWorker concurrently on
     350 * both CPUs using RTMPON_F_CONCURRENT_EXEC.
     351 *
     352 * @returns true if supported, false if not.
     353 */
     354RTDECL(bool) RTMpOnPairIsConcurrentExecSupported(void);
     355
    310356
    311357/**
Note: See TracChangeset for help on using the changeset viewer.

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