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

static int kldrDyldStackAddModule ( PKLDRDYLDMOD  pMod  )  [static]

Records the module.

Returns:
0 on success, KERR_NO_MEMORY if we can't expand the table.
Parameters:
pMod The module to record.

Definition at line 1083 of file kLdrDyld.c.

References g_cStackMods, g_cStackModsAllocated, KERR_NO_MEMORY, and kldrDyldModAddRef().

Referenced by kldrDyldDoLoadPrerequisites().

{
    /*
     * Grow the stack if necessary.
     */
    if (g_cStackMods + 1 > g_cStackModsAllocated)
    {
        KU32 cNew = g_cStackModsAllocated ? g_cStackModsAllocated * 2 : 128;
        void *pvOld = g_papStackMods;
        void *pvNew = kHlpAlloc(cNew * sizeof(g_papStackMods[0]));
        if (!pvNew)
            return KERR_NO_MEMORY;
        kHlpMemCopy(pvNew, pvOld, g_cStackMods * sizeof(g_papStackMods[0]));
        g_papStackMods = (PPKLDRDYLDMOD)pvNew;
        kHlpFree(pvOld);
    }

    /*
     * Add a reference and push the module onto the stack.
     */
    kldrDyldModAddRef(pMod);
    g_papStackMods[g_cStackMods++] = pMod;
    return 0;
}


Generated by  Doxygen 1.6.0   Back to index