Logo Search packages:      
Sourcecode: virtualbox-ose version File versions  Download package

void kldrDyldModRemoveDep ( PKLDRDYLDMOD  pMod,
PKLDRDYLDMOD  pDep 
)

Drop a dependency.

Parameters:
pMod The module.
pDep The module which depends on us.

Definition at line 537 of file kLdrDyldMod.c.

References KLDRDYLDMOD::cDepRefs, KLDRDYLDMOD::cDynRefs, KLDRDYLDMOD::cRefs, KLDRDYLDMOD::enmState, KLDRDYLDMOD_ASSERT, kldrDyldModUnloadPrerequisites(), KLDRSTATE_MAPPED, and KLDRSTATE_PENDING_DESTROY.

{
    KLDRDYLDMOD_ASSERT(pMod->cDepRefs > 0);
    if (pMod->cDepRefs == 0)
        return;
    KLDRDYLDMOD_ASSERT(pMod->cDepRefs <= pMod->cRefs);
    KLDRDYLDMOD_ASSERT(pMod->enmState >= KLDRSTATE_MAPPED && pMod->enmState <= KLDRSTATE_PENDING_DESTROY);

    pMod->cRefs--;
    pMod->cDepRefs--;
    if (    pMod->cDepRefs > 0
        ||  pMod->cDynRefs > 0)
        return;

    /*
     * The module should be unloaded.
     */
    kldrDyldModUnloadPrerequisites(pMod);
}


Generated by  Doxygen 1.6.0   Back to index