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; }
bool org_virtualbox_VBoxGuest::disableVmmDevInterrupts(void) { IOWorkLoop *pWorkLoop = (IOWorkLoop *)getWorkLoop(); if (!pWorkLoop) return false; if (!m_pInterruptSrc) return false; m_pInterruptSrc->disable(); pWorkLoop->removeEventSource(m_pInterruptSrc); m_pInterruptSrc->release(); m_pInterruptSrc = NULL; return true; }
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; }