VirtualBox

Changeset 19228 in vbox


Ignore:
Timestamp:
Apr 28, 2009 8:53:29 AM (16 years ago)
Author:
vboxsync
Message:

Shortcut for one CPU

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/VMMAll.cpp

    r19227 r19228  
    6565    VM_ASSERT_EMT(pVM);
    6666
    67 #if defined(IN_RC)
    68     /* There is only one CPU if we're in GC. */
    69     return 0;
     67    /* Shortcut for one CPU */
     68    if (pVM->cCPUs == 1)
     69        return 0;
    7070
    71 #elif defined(IN_RING3)
     71#if defined(IN_RING3)
    7272    return VMR3GetVMCPUId(pVM);
    73 
    74 #else  /* IN_RING0 */
     73#elif defined(IN_RING0)
    7574    return HWACCMR0GetVMCPUId(pVM);
    7675#endif /* IN_RING0 */
     76
     77    AssertFailed();
     78    return 0;
    7779}
    7880
     
    9395    VM_ASSERT_EMT(pVM);
    9496
    95 #if defined(IN_RC)
    96     /* There is only one CPU if we're in GC. */
    97     return &pVM->aCpus[0];
     97    /* Shortcut for one CPU */
     98    if (pVM->cCPUs == 1)
     99        return &pVM->aCpus[0];
    98100
    99 #elif defined(IN_RING3)
     101#ifdef IN_RING3
    100102    return &pVM->aCpus[VMR3GetVMCPUId(pVM)];
    101 
    102 #else  /* IN_RING0 */
     103#elif defined(IN_RING0)
    103104    return HWACCMR0GetVMCPU(pVM);
    104105#endif /* IN_RING0 */
     106
     107    AssertFailed();
     108    return &pVM->aCpus[0];
    105109}
    106110
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