Ejemplo n.º 1
0
bool
org_virtualbox_VBoxGuest::setupVmmDevInterrupts(IOService *pProvider)
{
    IOWorkLoop *pWorkLoop = getWorkLoop();

    if (!pWorkLoop)
        return false;

    m_pInterruptSrc = IOFilterInterruptEventSource::filterInterruptEventSource(this,
                                                                               &deferredInterruptHandler,
                                                                               &directInterruptHandler,
                                                                               pProvider);

    if (kIOReturnSuccess != pWorkLoop->addEventSource(m_pInterruptSrc))
    {
        m_pInterruptSrc->disable();
        m_pInterruptSrc->release();
        m_pInterruptSrc = 0;
        return false;
    }

    m_pInterruptSrc->enable();

    return true;
}
Ejemplo n.º 2
0
bool org_virtualbox_VBoxGuest::setupVmmDevInterrupts(IOService *pProvider)
{
    IOWorkLoop *pWorkLoop = getWorkLoop();
    if (!pWorkLoop)
        return false;

    m_pInterruptSrc = IOFilterInterruptEventSource::filterInterruptEventSource(this,
                                                                               &vgdrvDarwinDeferredIrqHandler,
                                                                               &vgdrvDarwinDirectIrqHandler,
                                                                               pProvider);
    IOReturn rc = pWorkLoop->addEventSource(m_pInterruptSrc);
    if (rc == kIOReturnSuccess)
    {
        m_pInterruptSrc->enable();
        return true;
    }

    m_pInterruptSrc->disable();
    m_pInterruptSrc->release();
    m_pInterruptSrc = NULL;
    return false;
}