VirtualBox

Ignore:
Timestamp:
Aug 7, 2015 7:51:45 PM (9 years ago)
Author:
vboxsync
Message:

iprt/darwin/r0drv: More saving of EFLAGS/AC, seems anything that may block is evil (not a surprise).

File:
1 edited

Legend:

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

    r57074 r57246  
    101101    AssertPtrReturn(phEventSem, VERR_INVALID_POINTER);
    102102    RT_ASSERT_PREEMPTIBLE();
     103    IPRT_DARWIN_SAVE_EFL_AC();
    103104
    104105    PRTSEMEVENTINTERNAL pThis = (PRTSEMEVENTINTERNAL)RTMemAlloc(sizeof(*pThis));
     
    115116        {
    116117            *phEventSem = pThis;
     118            IPRT_DARWIN_RESTORE_EFL_AC();
    117119            return VINF_SUCCESS;
    118120        }
     
    121123        RTMemFree(pThis);
    122124    }
     125    IPRT_DARWIN_RESTORE_EFL_AC();
    123126    return VERR_NO_MEMORY;
    124127}
     
    147150    {
    148151        Assert(pThis->u32Magic != RTSEMEVENT_MAGIC);
     152        IPRT_DARWIN_SAVE_EFL_AC();
     153
    149154        lck_spin_destroy(pThis->pSpinlock, g_pDarwinLockGroup);
    150155        RTMemFree(pThis);
     156
     157        IPRT_DARWIN_RESTORE_EFL_AC();
    151158    }
    152159}
     
    160167    AssertMsgReturn(pThis->u32Magic == RTSEMEVENT_MAGIC, ("pThis=%p u32Magic=%#x\n", pThis, pThis->u32Magic), VERR_INVALID_HANDLE);
    161168    RT_ASSERT_INTS_ON();
     169    IPRT_DARWIN_SAVE_EFL_AC();
    162170
    163171    lck_spin_lock(pThis->pSpinlock);
     
    177185    rtR0SemEventDarwinRelease(pThis);
    178186
     187    IPRT_DARWIN_RESTORE_EFL_AC();
    179188    return VINF_SUCCESS;
    180189}
     
    190199    RT_ASSERT_PREEMPT_CPUID_VAR();
    191200    RT_ASSERT_INTS_ON();
     201    IPRT_DARWIN_SAVE_EFL_AC();
    192202
    193203    rtR0SemEventDarwinRetain(pThis);
     
    218228
    219229    RT_ASSERT_PREEMPT_CPUID();
     230    IPRT_DARWIN_RESTORE_EFL_AC();
    220231    return VINF_SUCCESS;
    221232}
     
    240251    AssertMsgReturn(pThis->u32Magic == RTSEMEVENT_MAGIC, ("%p u32Magic=%RX32\n", pThis, pThis->u32Magic), VERR_INVALID_PARAMETER);
    241252    AssertReturn(RTSEMWAIT_FLAGS_ARE_VALID(fFlags), VERR_INVALID_PARAMETER);
     253    IPRT_DARWIN_SAVE_EFL_AC();
    242254
    243255    rtR0SemEventDarwinRetain(pThis);
     
    308320                 */
    309321                ASMAtomicWriteBool(&pThis->fHaveBlockedThreads, true);
    310                 IPRT_DARWIN_SAVE_EFL_AC();
    311322                wait_interrupt_t fInterruptible = fFlags & RTSEMWAIT_FLAGS_INTERRUPTIBLE ? THREAD_ABORTSAFE : THREAD_UNINT;
    312323                wait_result_t    rcWait;
     
    320331                                                     (event_t)&Waiter, fInterruptible, u64AbsTime);
    321332                }
    322                 IPRT_DARWIN_RESTORE_EFL_AC();
    323333
    324334                /*
     
    370380    lck_spin_unlock(pThis->pSpinlock);
    371381    rtR0SemEventDarwinRelease(pThis);
     382    IPRT_DARWIN_RESTORE_EFL_AC();
    372383    return rc;
    373384}
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