VirtualBox

Changeset 76055 in vbox for trunk/src


Ignore:
Timestamp:
Dec 7, 2018 1:04:00 PM (6 years ago)
Author:
vboxsync
Message:

IPRT/semevent*-r0drv-darwin.cpp: Must disable interrupts prior to taking the spinlock or the code won't be suitable for interrupt context (there was a todo to this affect).

Location:
trunk/src/VBox/Runtime/r0drv/darwin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r0drv/darwin/semevent-r0drv-darwin.cpp

    r75704 r76055  
    170170    IPRT_DARWIN_SAVE_EFL_AC();
    171171
     172    RTCCUINTREG const fIntSaved = ASMIntDisableFlags();
    172173    lck_spin_lock(pThis->pSpinlock);
    173174
     
    184185
    185186    lck_spin_unlock(pThis->pSpinlock);
     187    ASMSetFlags(fIntSaved);
    186188    rtR0SemEventDarwinRelease(pThis);
    187189
     
    209211    IPRT_DARWIN_SAVE_EFL_AC();
    210212
     213    RTCCUINTREG const fIntSaved = ASMIntDisableFlags();
    211214    rtR0SemEventDarwinRetain(pThis);
    212 
    213     /** @todo should probably disable interrupts here... update
    214      *        semspinmutex-r0drv-generic.c when done. */
    215215    lck_spin_lock(pThis->pSpinlock);
    216216
     
    233233
    234234    lck_spin_unlock(pThis->pSpinlock);
     235    ASMSetFlags(fIntSaved);
    235236    rtR0SemEventDarwinRelease(pThis);
    236237
     
    264265    IPRT_DARWIN_SAVE_EFL_AC();
    265266
     267    RTCCUINTREG const fIntSaved = ASMIntDisableFlags();
    266268    rtR0SemEventDarwinRetain(pThis);
    267269    lck_spin_lock(pThis->pSpinlock);
     
    390392
    391393    lck_spin_unlock(pThis->pSpinlock);
     394    ASMSetFlags(fIntSaved);
    392395    rtR0SemEventDarwinRelease(pThis);
     396
    393397    IPRT_DARWIN_RESTORE_EFL_AC();
    394398    return rc;
  • trunk/src/VBox/Runtime/r0drv/darwin/semeventmulti-r0drv-darwin.cpp

    r75704 r76055  
    175175    IPRT_DARWIN_SAVE_EFL_AC();
    176176
     177    RTCCUINTREG const fIntSaved = ASMIntDisableFlags();
    177178    lck_spin_lock(pThis->pSpinlock);
    178179
     
    186187
    187188    lck_spin_unlock(pThis->pSpinlock);
     189    ASMSetFlags(fIntSaved);
    188190    rtR0SemEventMultiDarwinRelease(pThis);
    189191
     
    206208     * as RTMemFree does not work with interrupts disabled (IOFree/kfree takes zone mutex).
    207209     */
    208     //RT_ASSERT_INTS_ON(); - we may be called from interrupt context, which seems to be perfectly fine.
     210    //RT_ASSERT_INTS_ON(); - we may be called from interrupt context, which seems to be perfectly fine if we disable interrupts.
    209211
    210212    IPRT_DARWIN_SAVE_EFL_AC();
    211213
     214    RTCCUINTREG const fIntSaved = ASMIntDisableFlags();
    212215    rtR0SemEventMultiDarwinRetain(pThis);
    213216    lck_spin_lock(pThis->pSpinlock);
     
    231234
    232235    lck_spin_unlock(pThis->pSpinlock);
     236    ASMSetFlags(fIntSaved);
    233237    rtR0SemEventMultiDarwinRelease(pThis);
    234238
     
    249253    IPRT_DARWIN_SAVE_EFL_AC();
    250254
     255    RTCCUINTREG const fIntSaved = ASMIntDisableFlags();
    251256    rtR0SemEventMultiDarwinRetain(pThis);
    252257    lck_spin_lock(pThis->pSpinlock);
     
    255260
    256261    lck_spin_unlock(pThis->pSpinlock);
     262    ASMSetFlags(fIntSaved);
    257263    rtR0SemEventMultiDarwinRelease(pThis);
    258264
     
    287293    IPRT_DARWIN_SAVE_EFL_AC();
    288294
     295    RTCCUINTREG const fIntSaved = ASMIntDisableFlags();
    289296    rtR0SemEventMultiDarwinRetain(pThis);
    290297    lck_spin_lock(pThis->pSpinlock);
     
    408415
    409416    lck_spin_unlock(pThis->pSpinlock);
     417    ASMSetFlags(fIntSaved);
    410418    rtR0SemEventMultiDarwinRelease(pThis);
    411419
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