VirtualBox

Changeset 20862 in vbox for trunk/src/VBox/HostDrivers


Ignore:
Timestamp:
Jun 23, 2009 6:25:31 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
49006
Message:

SUP: Made SUPPageLock and SUPPageUnlock internal to SUP.

Location:
trunk/src/VBox/HostDrivers/Support
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/SUPLib.cpp

    r20861 r20862  
    865865
    866866
    867 SUPR3DECL(int) SUPPageLock(void *pvStart, size_t cPages, PSUPPAGE paPages)
     867/**
     868 * Locks down the physical memory backing a virtual memory
     869 * range in the current process.
     870 *
     871 * @returns VBox status code.
     872 * @param   pvStart         Start of virtual memory range.
     873 *                          Must be page aligned.
     874 * @param   cPages          Number of pages.
     875 * @param   paPages         Where to store the physical page addresses returned.
     876 *                          On entry this will point to an array of with cbMemory >> PAGE_SHIFT entries.
     877 */
     878int supR3PageLock(void *pvStart, size_t cPages, PSUPPAGE paPages)
    868879{
    869880    /*
     
    920931
    921932
    922 SUPR3DECL(int) SUPPageUnlock(void *pvStart)
     933/**
     934 * Releases locked down pages.
     935 *
     936 * @returns VBox status code.
     937 * @param   pvStart         Start of virtual memory range previously locked
     938 *                          down by SUPPageLock().
     939 */
     940int supR3PageUnlock(void *pvStart)
    923941{
    924942    /*
     
    974992    {
    975993        /* fallback */
    976         rc = SUPPageUnlock(pvPages);
     994        rc = supR3PageUnlock(pvPages);
    977995        if (RT_SUCCESS(rc))
    978996            rc = suplibOsPageFree(&g_supLibData, pvPages, cPages);
     
    9921010        if (!paPages)
    9931011            paPages = (PSUPPAGE)alloca(sizeof(paPages[0]) * cPages);
    994         rc = SUPPageLock(*ppvPages, cPages, paPages);
     1012        rc = supR3PageLock(*ppvPages, cPages, paPages);
    9951013        if (RT_FAILURE(rc))
    9961014            suplibOsPageFree(&g_supLibData, *ppvPages, cPages);
     
    12071225            &&  !g_fSupportsPageAllocNoKernel)
    12081226        {
    1209             int rc2 = SUPPageUnlock(pvPages);
     1227            int rc2 = supR3PageUnlock(pvPages);
    12101228            if (RT_SUCCESS(rc2))
    12111229                rc = suplibOsPageFree(&g_supLibData, pvPages, cPages);
  • trunk/src/VBox/HostDrivers/Support/SUPLibInternal.h

    r20374 r20862  
    315315
    316316
     317int                supR3PageLock(void *pvStart, size_t cPages, PSUPPAGE paPages);
     318int                supR3PageUnlock(void *pvStart);
     319
    317320RT_C_DECLS_END
    318321
  • trunk/src/VBox/HostDrivers/Support/testcase/tstPin.cpp

    r14831 r20862  
    4242#include <iprt/string.h>
    4343
     44#include "../SUPLibInternal.h"
     45
    4446
    4547int main(int argc, char **argv)
     
    6365        RTPrintf("pv=%p\n", pv);
    6466        SUPPAGE aPages[1];
    65         rc = SUPPageLock(pv, 1, &aPages[0]);
     67        rc = supR3PageLock(pv, 1, &aPages[0]);
    6668        RTPrintf("rc=%d aPages[0]=%RHp\n", rc, pv, aPages[0]);
    6769        RTThreadSleep(1500);
     
    8890            SUPPageAlloc(0x10000 >> PAGE_SHIFT, &aPinnings[i].pv);
    8991            aPinnings[i].pvAligned = RT_ALIGN_P(aPinnings[i].pv, PAGE_SIZE);
    90             rc = SUPPageLock(aPinnings[i].pvAligned, 0xf000 >> PAGE_SHIFT, &aPinnings[i].aPages[0]);
     92            rc = supR3PageLock(aPinnings[i].pvAligned, 0xf000 >> PAGE_SHIFT, &aPinnings[i].aPages[0]);
    9193            if (!rc)
    9294            {
     
    116118            if (aPinnings[i].pvAligned)
    117119            {
    118                 rc = SUPPageUnlock(aPinnings[i].pvAligned);
     120                rc = supR3PageUnlock(aPinnings[i].pvAligned);
    119121                if (rc)
    120122                {
     
    177179            static SUPPAGE      aPages[BIG_SIZE >> PAGE_SHIFT];
    178180            void *pvAligned = RT_ALIGN_P(pv, PAGE_SIZE);
    179             rc = SUPPageLock(pvAligned, BIG_SIZE >> PAGE_SHIFT, &aPages[0]);
     181            rc = supR3PageLock(pvAligned, BIG_SIZE >> PAGE_SHIFT, &aPages[0]);
    180182            if (!rc)
    181183            {
     
    189191
    190192                /* unlock */
    191                 rc = SUPPageUnlock(pvAligned);
     193                rc = supR3PageUnlock(pvAligned);
    192194                if (rc)
    193195                {
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette