VirtualBox

Changeset 75704 in vbox


Ignore:
Timestamp:
Nov 25, 2018 1:44:09 AM (6 years ago)
Author:
vboxsync
Message:

IPRT/r0drv/darwin: RTSemEventSignal and RTSemEventMultiSignal seems to work fine with interrupts disabled and/or from interrupt context. bugref:4686

Location:
trunk
Files:
3 edited

Legend:

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

    r69105 r75704  
    164164 *          system specific whether it works in interrupt context or with
    165165 *          interrupts disabled.
     166 *
     167 *          ring-0/Darwin: This works when interrupts are disabled and thereby
     168 *          in interrupt context, except it cannot race semaphore destruction as
     169 *          the allocator does not work under these circumstances.
    166170 */
    167171RTDECL(int)  RTSemEventSignal(RTSEMEVENT hEventSem);
     
    325329 *          system specific whether it works in interrupt context or with
    326330 *          interrupts disabled.
     331 *
     332 *          ring-0/Darwin: This works when interrupts are disabled and thereby
     333 *          in interrupt context, except it cannot race semaphore destruction as
     334 *          the allocator does not work under these circumstances.
    327335 */
    328336RTDECL(int)  RTSemEventMultiSignal(RTSEMEVENTMULTI hEventMultiSem);
  • trunk/src/VBox/Runtime/r0drv/darwin/semevent-r0drv-darwin.cpp

    r69111 r75704  
    199199                    VERR_INVALID_HANDLE);
    200200    RT_ASSERT_PREEMPT_CPUID_VAR();
    201     RT_ASSERT_INTS_ON();
     201
     202    /*
     203     * Coming here with interrupts disabled should be okay.  The thread_wakeup_prim KPI is used
     204     * by the interrupt handler IOFilterInterruptEventSource::disableInterruptOccurred() via
     205     * signalWorkAvailable().  The only problem is if we have to destroy the event structure,
     206     * as RTMemFree does not work with interrupts disabled (IOFree/kfree takes zone mutex).
     207     */
     208    //RT_ASSERT_INTS_ON(); - we may be called from interrupt context, which seems to be perfectly fine.
    202209    IPRT_DARWIN_SAVE_EFL_AC();
    203210
     
    229236
    230237    RT_ASSERT_PREEMPT_CPUID();
     238    AssertMsg((fSavedEfl & X86_EFL_IF) == (ASMGetFlags() & X86_EFL_IF), ("fSavedEfl=%#x cur=%#x\n",(uint32_t)fSavedEfl, ASMGetFlags()));
    231239    IPRT_DARWIN_RESTORE_EFL_AC();
    232240    return VINF_SUCCESS;
  • trunk/src/VBox/Runtime/r0drv/darwin/semeventmulti-r0drv-darwin.cpp

    r69111 r75704  
    199199    AssertMsgReturn(pThis->u32Magic == RTSEMEVENTMULTI_MAGIC, ("pThis=%p u32Magic=%#x\n", pThis, pThis->u32Magic), VERR_INVALID_HANDLE);
    200200    RT_ASSERT_PREEMPT_CPUID_VAR();
    201     RT_ASSERT_INTS_ON();
     201
     202    /*
     203     * Coming here with interrupts disabled should be okay.  The thread_wakeup_prim KPI is used
     204     * by the interrupt handler IOFilterInterruptEventSource::disableInterruptOccurred() via
     205     * signalWorkAvailable().  The only problem is if we have to destroy the event structure,
     206     * as RTMemFree does not work with interrupts disabled (IOFree/kfree takes zone mutex).
     207     */
     208    //RT_ASSERT_INTS_ON(); - we may be called from interrupt context, which seems to be perfectly fine.
     209
    202210    IPRT_DARWIN_SAVE_EFL_AC();
    203211
     
    226234
    227235    RT_ASSERT_PREEMPT_CPUID();
     236    AssertMsg((fSavedEfl & X86_EFL_IF) == (ASMGetFlags() & X86_EFL_IF), ("fSavedEfl=%#x cur=%#x\n",(uint32_t)fSavedEfl, ASMGetFlags()));
    228237    IPRT_DARWIN_RESTORE_EFL_AC();
    229238    return VINF_SUCCESS;
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