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

int kldrDyldModCallInit ( PKLDRDYLDMOD  pMod  ) 

Calls the module initialization entry point if any.

This is considered to be a module specific thing and leave if to the module interpreter. They will have to deal with different module init practices between platforms should there be any.

Returns:
0 and state changed to GOOD on success. Non-zero OS or kLdr status code and status changed to INITIALIZATION_FAILED on failure.
Parameters:
pMod The module that should be initialized.

Definition at line 1054 of file kLdrDyldMod.c.

References KLDRDYLDMOD::enmState, KLDRDYLDMOD::fInitList, g_pkLdrDyldTermHead, g_pkLdrDyldTermTail, KLDRDYLDMOD::hMod, KLDRDYLDMOD::InitTerm, KLDRDYLDMOD_ASSERT, kLdrModCallInit(), KLDRSTATE_GOOD, KLDRSTATE_INITIALIZATION_FAILED, KLDRSTATE_INITIALIZING, KLDRSTATE_PENDING_INITIALIZATION, NULL, KLDRDYLDMOD::pMod, KLDRDYLDMOD::pNext, and KLDRDYLDMOD::pPrev.

Referenced by kldrDyldDoLoad2().

{
    int rc;

    KLDRDYLDMOD_ASSERT(pMod->enmState == KLDRSTATE_PENDING_INITIALIZATION);
    KLDRDYLDMOD_ASSERT(!pMod->fInitList);

    pMod->enmState = KLDRSTATE_INITIALIZING;
    rc = kLdrModCallInit(pMod->pMod, (KUPTR)pMod->hMod);
    if (!rc)
    {
        pMod->enmState = KLDRSTATE_GOOD;
        /* push it onto the termination list.*/
        pMod->InitTerm.pPrev = NULL;
        pMod->InitTerm.pNext = g_pkLdrDyldTermHead;
        if (g_pkLdrDyldTermHead)
            g_pkLdrDyldTermHead->InitTerm.pPrev = pMod;
        else
            g_pkLdrDyldTermTail = pMod;
        g_pkLdrDyldTermHead = pMod;
    }
    else
        pMod->enmState = KLDRSTATE_INITIALIZATION_FAILED;

    return rc;
}


Generated by  Doxygen 1.6.0   Back to index