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

static int kldrModLXReload ( PKLDRMOD  pMod  )  [static]

Reloads all dirty pages in a module previously mapped by kLdrModMap().

The module interpreter may omit code pages if it can safely apply code fixups again in a subsequent kLdrModFixupMapping() call.

The caller is responsible for freeing TLS before calling this function.

Returns:
0 on success, non-zero OS or kLdr status code on failure.
Parameters:
pMod The module.

Definition at line 1946 of file kLdrModLX.c.

References KLDR_ERR_NOT_MAPPED, kldrModLXDoLoadBits(), kldrModLXDoProtect(), KLDRMOD::pvData, and KLDRMODLX::pvMapping.

{
    PKLDRMODLX pModLX = (PKLDRMODLX)pMod->pvData;
    int rc, rc2;

    /*
     * Mapped?
     */
    if (!pModLX->pvMapping)
        return KLDR_ERR_NOT_MAPPED;

    /*
     * Before doing anything we'll have to make all pages writable.
     */
    rc = kldrModLXDoProtect(pModLX, (void *)pModLX->pvMapping, 1 /* unprotect */);
    if (rc)
        return rc;

    /*
     * Load the bits again.
     */
    rc = kldrModLXDoLoadBits(pModLX, (void *)pModLX->pvMapping);

    /*
     * Restore protection.
     */
    rc2 = kldrModLXDoProtect(pModLX, (void *)pModLX->pvMapping, 0 /* protect */);
    if (!rc && rc2)
        rc = rc2;
    return rc;
}


Generated by  Doxygen 1.6.0   Back to index