VirtualBox

Changeset 7325 in vbox


Ignore:
Timestamp:
Mar 6, 2008 3:00:47 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
28742
Message:

Added RTMpIsCpuOnline and RTMpDoesCpuExist. (not implemented everywhere)

File:
1 edited

Legend:

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

    r7291 r7325  
    3838 */
    3939
    40 /** Maximum number of CPUs we support in one system. 
     40/** Maximum number of CPUs we support in one system.
    4141 * @remarks The current limit in Windows (affinity mask)
    4242 *
     
    4545
    4646
    47 /** A CPU identifier. 
    48  * @remarks This doesn't have to correspond to the APIC ID (intel/amd). Nor 
     47/** A CPU identifier.
     48 * @remarks This doesn't have to correspond to the APIC ID (intel/amd). Nor
    4949 *          does it have to correspond to the bits in the affinity mask, at
    5050 *          least not until we've sorted out Windows NT. */
     
    5959/**
    6060 * Gets the identifier of the CPU executing the call.
    61  * 
     61 *
    6262 * When called from a system mode where scheduling is active, like ring-3 or
    6363 * kernel mode with interrupts enabled on some systems, no assumptions should
    6464 * be made about the current CPU when the call returns.
    65  * 
     65 *
    6666 * @returns CPU Id.
    6767 */
    6868RTDECL(RTCPUID) RTMpCpuId(void);
     69
     70/**
     71 * Checks if a CPU is online or not.
     72 *
     73 * @returns true/false accordingly.
     74 * @param   idCpu       The identifier of the CPU.
     75 */
     76RTDECL(bool) RTMpIsCpuOnline(RTCPUID idCpu);
     77
     78/**
     79 * Checks if a CPU exist or not / validates a CPU id.
     80 *
     81 * @returns true/false accordingly.
     82 * @param   idCpu       The identifier of the CPU.
     83 */
     84RTDECL(bool) RTMpDoesCpuExist(RTCPUID idCpu);
     85
     86/** @todo we need some kind of RTCPUSET and converstion between RTCPUID and it. */
     87
    6988
    7089#ifdef IN_RING0
     
    7392 * Worker function passed to RTMpOnAll, RTMpOnOthers and RTMpOnSpecific that
    7493 * is to be called on the target cpus.
    75  * 
     94 *
    7695 * @param   idCpu       The identifier for the CPU the function is called on.
    7796 * @param   pvUser1     The 1st user argument.
     
    84103/**
    85104 * Executes a function on each (online) CPU in the system.
    86  * 
     105 *
    87106 * @returns IPRT status code.
    88107 * @retval  VINF_SUCCESS on success.
    89108 * @retval  VERR_NOT_SUPPORTED if this kind of operation isn't supported by the system.
    90  * 
     109 *
    91110 * @param   pfnWorker       The worker function.
    92  * @param   pvUser1         The first user argument for the worker.       
    93  * @param   pvUser2         The second user argument for the worker.       
     111 * @param   pvUser1         The first user argument for the worker.
     112 * @param   pvUser2         The second user argument for the worker.
    94113 *
    95114 * @remarks The execution isn't in any way guaranteed to be simultaneous,
     
    100119/**
    101120 * Executes a function on a all other (online) CPUs in the system.
    102  * 
     121 *
    103122 * @returns IPRT status code.
    104123 * @retval  VINF_SUCCESS on success.
    105124 * @retval  VERR_NOT_SUPPORTED if this kind of operation isn't supported by the system.
    106  * 
     125 *
    107126 * @param   pfnWorker       The worker function.
    108  * @param   pvUser1         The first user argument for the worker.       
    109  * @param   pvUser2         The second user argument for the worker.       
    110  * 
     127 * @param   pvUser1         The first user argument for the worker.
     128 * @param   pvUser2         The second user argument for the worker.
     129 *
    111130 * @remarks The execution isn't in any way guaranteed to be simultaneous,
    112131 *          it might even be serial (cpu by cpu).
     
    116135/**
    117136 * Executes a function on a specific CPU in the system.
    118  * 
     137 *
    119138 * @returns IPRT status code.
    120139 * @retval  VINF_SUCCESS on success.
     
    122141 * @retval  VERR_CPU_OFFLINE if the CPU is offline.
    123142 * @retval  VERR_CPU_NOT_FOUND if the CPU wasn't found.
    124  * 
     143 *
    125144 * @param   idCpu           The id of the CPU.
    126145 * @param   pfnWorker       The worker function.
    127  * @param   pvUser1         The first user argument for the worker.       
    128  * @param   pvUser2         The second user argument for the worker.       
     146 * @param   pvUser1         The first user argument for the worker.
     147 * @param   pvUser2         The second user argument for the worker.
    129148 */
    130149RTDECL(int) RTMpOnSpecific(RTCPUID idCpu, PFNRTMPWORKER pfnWorker, void *pvUser1, void *pvUser2);
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