VirtualBox

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


Ignore:
Timestamp:
Jun 23, 2009 7:19:42 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
49009
Message:

SUP,*: API cleanup.

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

Legend:

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

    r20862 r20864  
    149149
    150150
    151 SUPR3DECL(int) SUPInstall(void)
     151SUPR3DECL(int) SUPR3Install(void)
    152152{
    153153    return suplibOsInstall();
     
    155155
    156156
    157 SUPR3DECL(int) SUPUninstall(void)
     157SUPR3DECL(int) SUPR3Uninstall(void)
    158158{
    159159    return suplibOsUninstall();
     
    486486
    487487
    488 SUPR3DECL(int) SUPTerm(bool fForced)
     488SUPR3DECL(int) SUPR3Term(bool fForced)
    489489{
    490490    /*
    491491     * Verify state.
    492492     */
    493     AssertMsg(g_cInits > 0, ("SUPTerm() is called before SUPR3Init()!\n"));
     493    AssertMsg(g_cInits > 0, ("SUPR3Term() is called before SUPR3Init()!\n"));
    494494    if (g_cInits == 0)
    495495        return VERR_WRONG_ORDER;
     
    526526
    527527
    528 SUPR3DECL(SUPPAGINGMODE) SUPGetPagingMode(void)
     528SUPR3DECL(SUPPAGINGMODE) SUPR3GetPagingMode(void)
    529529{
    530530    /* fake */
     
    550550        ||  RT_FAILURE(Req.Hdr.rc))
    551551    {
    552         LogRel(("SUPGetPagingMode: %Rrc %Rrc\n", rc, Req.Hdr.rc));
     552        LogRel(("SUPR3GetPagingMode: %Rrc %Rrc\n", rc, Req.Hdr.rc));
    553553        Req.u.Out.enmMode = SUPPAGINGMODE_INVALID;
    554554    }
     
    568568
    569569
    570 SUPR3DECL(int) SUPCallVMMR0Fast(PVMR0 pVMR0, unsigned uOperation, VMCPUID idCpu)
     570SUPR3DECL(int) SUPR3CallVMMR0Fast(PVMR0 pVMR0, unsigned uOperation, VMCPUID idCpu)
    571571{
    572572    if (RT_LIKELY(uOperation == SUP_VMMR0_DO_RAW_RUN))
     
    582582
    583583
    584 SUPR3DECL(int) SUPCallVMMR0Ex(PVMR0 pVMR0, VMCPUID idCpu, unsigned uOperation, uint64_t u64Arg, PSUPVMMR0REQHDR pReqHdr)
     584SUPR3DECL(int) SUPR3CallVMMR0Ex(PVMR0 pVMR0, VMCPUID idCpu, unsigned uOperation, uint64_t u64Arg, PSUPVMMR0REQHDR pReqHdr)
    585585{
    586586    /*
     
    645645
    646646
    647 SUPR3DECL(int) SUPCallVMMR0(PVMR0 pVMR0, VMCPUID idCpu, unsigned uOperation, void *pvArg)
     647SUPR3DECL(int) SUPR3CallVMMR0(PVMR0 pVMR0, VMCPUID idCpu, unsigned uOperation, void *pvArg)
    648648{
    649649    /*
     
    655655                    ("%#x\n", uOperation),
    656656                    VERR_INTERNAL_ERROR);
    657     return SUPCallVMMR0Ex(pVMR0, idCpu, uOperation, (uintptr_t)pvArg, NULL);
    658 }
    659 
    660 
    661 SUPR3DECL(int) SUPSetVMForFastIOCtl(PVMR0 pVMR0)
     657    return SUPR3CallVMMR0Ex(pVMR0, idCpu, uOperation, (uintptr_t)pvArg, NULL);
     658}
     659
     660
     661SUPR3DECL(int) SUPR3SetVMForFastIOCtl(PVMR0 pVMR0)
    662662{
    663663    if (RT_UNLIKELY(g_u32FakeMode))
     
    834834
    835835
    836 SUPR3DECL(int) SUPPageAlloc(size_t cPages, void **ppvPages)
     836SUPR3DECL(int) SUPR3PageAlloc(size_t cPages, void **ppvPages)
    837837{
    838838    /*
     
    850850
    851851
    852 SUPR3DECL(int) SUPPageFree(void *pvPages, size_t cPages)
     852SUPR3DECL(int) SUPR3PageFree(void *pvPages, size_t cPages)
    853853{
    854854    /*
     
    876876 *                          On entry this will point to an array of with cbMemory >> PAGE_SHIFT entries.
    877877 */
    878 int supR3PageLock(void *pvStart, size_t cPages, PSUPPAGE paPages)
     878SUPR3DECL(int) supR3PageLock(void *pvStart, size_t cPages, PSUPPAGE paPages)
    879879{
    880880    /*
     
    938938 *                          down by SUPPageLock().
    939939 */
    940 int supR3PageUnlock(void *pvStart)
     940SUPR3DECL(int) supR3PageUnlock(void *pvStart)
    941941{
    942942    /*
     
    968968
    969969
    970 SUPR3DECL(int) SUPPageAllocLockedEx(size_t cPages, void **ppvPages, PSUPPAGE paPages)
     970SUPR3DECL(int) SUPR3PageAllocLockedEx(size_t cPages, void **ppvPages, PSUPPAGE paPages)
    971971{
    972972    return SUPR3PageAllocEx(cPages, 0 /*fFlags*/, ppvPages, NULL /*pR0Ptr*/, paPages);
     
    974974
    975975
    976 SUPR3DECL(int) SUPPageFreeLocked(void *pvPages, size_t cPages)
     976SUPR3DECL(int) SUPR3PageFreeLocked(void *pvPages, size_t cPages)
    977977{
    978978    /*
     
    10011001
    10021002/**
    1003  * Fallback for SUPPageAllocLockedEx on systems where RTR0MemObjPhysAllocNC isn't supported.
     1003 * Fallback for SUPR3PageAllocLockedEx on systems where RTR0MemObjPhysAllocNC
     1004 * isn't supported.
    10041005 */
    10051006static int supPagePageAllocNoKernelFallback(size_t cPages, void **ppvPages, PSUPPAGE paPages)
     
    12341235
    12351236
    1236 SUPR3DECL(void *) SUPContAlloc(size_t cPages, PRTHCPHYS pHCPhys)
    1237 {
    1238     return SUPContAlloc2(cPages, NIL_RTR0PTR, pHCPhys);
    1239 }
    1240 
    1241 
    1242 SUPR3DECL(void *) SUPContAlloc2(size_t cPages, PRTR0PTR pR0Ptr, PRTHCPHYS pHCPhys)
     1237SUPR3DECL(void *) SUPR3ContAlloc(size_t cPages, PRTR0PTR pR0Ptr, PRTHCPHYS pHCPhys)
    12431238{
    12441239    /*
     
    12891284
    12901285
    1291 SUPR3DECL(int) SUPContFree(void *pv, size_t cPages)
     1286SUPR3DECL(int) SUPR3ContFree(void *pv, size_t cPages)
    12921287{
    12931288    /*
     
    13241319
    13251320
    1326 SUPR3DECL(int) SUPLowAlloc(size_t cPages, void **ppvPages, PRTR0PTR ppvPagesR0, PSUPPAGE paPages)
     1321SUPR3DECL(int) SUPR3LowAlloc(size_t cPages, void **ppvPages, PRTR0PTR ppvPagesR0, PSUPPAGE paPages)
    13271322{
    13281323    /*
     
    13891384
    13901385
    1391 SUPR3DECL(int) SUPLowFree(void *pv, size_t cPages)
     1386SUPR3DECL(int) SUPR3LowFree(void *pv, size_t cPages)
    13921387{
    13931388    /*
     
    14481443
    14491444
    1450 SUPR3DECL(int) SUPLoadModule(const char *pszFilename, const char *pszModule, void **ppvImageBase)
     1445SUPR3DECL(int) SUPR3LoadModule(const char *pszFilename, const char *pszModule, void **ppvImageBase)
    14511446{
    14521447    int rc = VINF_SUCCESS;
     
    14601455        rc = supLoadModule(pszFilename, pszModule, NULL, ppvImageBase);
    14611456    else
    1462         LogRel(("SUPLoadModule: Verification of \"%s\" failed, rc=%Rrc\n", rc));
     1457        LogRel(("SUPR3LoadModule: Verification of \"%s\" failed, rc=%Rrc\n", rc));
    14631458    return rc;
    14641459}
     
    15331528     * Check the VMMR0.r0 module if loaded.
    15341529     */
    1535     /** @todo call the SUPLoadModule caller.... */
     1530    /** @todo call the SUPR3LoadModule caller.... */
    15361531    /** @todo proper reference counting and such. */
    15371532    if (g_pvVMMR0 != NIL_RTR0PTR)
    15381533    {
    15391534        void *pvValue;
    1540         if (!SUPGetSymbolR0((void *)g_pvVMMR0, pszSymbol, &pvValue))
     1535        if (!SUPR3GetSymbolR0((void *)g_pvVMMR0, pszSymbol, &pvValue))
    15411536        {
    15421537            *pValue = (uintptr_t)pvValue;
     
    16521647
    16531648/**
    1654  * Worker for SUPLoadModule().
     1649 * Worker for SUPR3LoadModule().
    16551650 *
    16561651 * @returns VBox status code.
     
    18681863
    18691864
    1870 SUPR3DECL(int) SUPFreeModule(void *pvImageBase)
     1865SUPR3DECL(int) SUPR3FreeModule(void *pvImageBase)
    18711866{
    18721867    /* fake */
     
    18981893
    18991894
    1900 SUPR3DECL(int) SUPGetSymbolR0(void *pvImageBase, const char *pszSymbol, void **ppvValue)
     1895SUPR3DECL(int) SUPR3GetSymbolR0(void *pvImageBase, const char *pszSymbol, void **ppvValue)
    19011896{
    19021897    *ppvValue = NULL;
     
    19331928
    19341929
    1935 SUPR3DECL(int) SUPLoadVMM(const char *pszFilename)
     1930SUPR3DECL(int) SUPR3LoadVMM(const char *pszFilename)
    19361931{
    19371932    void *pvImageBase;
    1938     return SUPLoadModule(pszFilename, "VMMR0.r0", &pvImageBase);
    1939 }
    1940 
    1941 
    1942 SUPR3DECL(int) SUPUnloadVMM(void)
    1943 {
    1944     return SUPFreeModule((void*)g_pvVMMR0);
    1945 }
    1946 
    1947 
    1948 SUPR3DECL(int) SUPGipGetPhys(PRTHCPHYS pHCPhys)
     1933    return SUPR3LoadModule(pszFilename, "VMMR0.r0", &pvImageBase);
     1934}
     1935
     1936
     1937SUPR3DECL(int) SUPR3UnloadVMM(void)
     1938{
     1939    return SUPR3FreeModule((void*)g_pvVMMR0);
     1940}
     1941
     1942
     1943SUPR3DECL(int) SUPR3GipGetPhys(PRTHCPHYS pHCPhys)
    19491944{
    19501945    if (g_pSUPGlobalInfoPage)
  • trunk/src/VBox/HostDrivers/Support/SUPLibInternal.h

    r20862 r20864  
    315315
    316316
    317 int                supR3PageLock(void *pvStart, size_t cPages, PSUPPAGE paPages);
    318 int                supR3PageUnlock(void *pvStart);
     317SUPR3DECL(int)      supR3PageLock(void *pvStart, size_t cPages, PSUPPAGE paPages);
     318SUPR3DECL(int)      supR3PageUnlock(void *pvStart);
    319319
    320320RT_C_DECLS_END
  • trunk/src/VBox/HostDrivers/Support/testcase/SUPInstall.cpp

    r14831 r20864  
    4242{
    4343    RTR3Init();
    44     int rc = SUPInstall();
     44    int rc = SUPR3Install();
    4545    if (RT_SUCCESS(rc))
    4646    {
  • trunk/src/VBox/HostDrivers/Support/testcase/SUPUninstall.cpp

    r14831 r20864  
    4242{
    4343    RTR3Init();
    44     int rc = SUPUninstall();
     44    int rc = SUPR3Uninstall();
    4545    if (RT_SUCCESS(rc))
    4646    {
  • trunk/src/VBox/HostDrivers/Support/testcase/tstContiguous.cpp

    r13837 r20864  
    5656         */
    5757        RTHCPHYS HCPhys;
    58         void *pv = SUPContAlloc(8, &HCPhys);
     58        void *pv = SUPR3ContAlloc(8, NIL_RTR0PTR, &HCPhys);
    5959        rcRet += pv == NULL || HCPhys == 0;
    6060        if (pv && HCPhys)
    6161        {
    6262            memset(pv, 0xff, PAGE_SIZE * 8);
    63             pv = SUPContAlloc(5, &HCPhys);
     63            pv = SUPR3ContAlloc(5, NIL_RTR0PTR, &HCPhys);
    6464            rcRet += pv == NULL || HCPhys == 0;
    6565            if (pv && HCPhys)
    6666            {
    6767                memset(pv, 0x7f, PAGE_SIZE * 5);
    68                 rc = SUPContFree(pv, 5);
     68                rc = SUPR3ContFree(pv, 5);
    6969                rcRet += rc != 0;
    7070                if (rc)
    71                     RTPrintf("tstContiguous: SUPContFree failed! rc=%Rrc\n", rc);
     71                    RTPrintf("tstContiguous: SUPR3ContFree failed! rc=%Rrc\n", rc);
    7272
    7373                void *apv[128];
    7474                for (unsigned i = 0; i < RT_ELEMENTS(apv); i++)
    7575                {
    76                     apv[i] = SUPContAlloc(1 + (i % 11), &HCPhys);
     76                    apv[i] = SUPR3ContAlloc(1 + (i % 11), NIL_RTR0PTR, &HCPhys);
    7777                    if (!apv[i])
    7878                    {
     
    8484                    if (apv[i])
    8585                    {
    86                         rc = SUPContFree(apv[i], 1 + (i % 11));
     86                        rc = SUPR3ContFree(apv[i], 1 + (i % 11));
    8787                        rcRet += rc != 0;
    8888                        if (rc)
    89                             RTPrintf("tstContiguous: i=%d SUPContFree failed! rc=%Rrc\n", i, rc);
     89                            RTPrintf("tstContiguous: i=%d SUPR3ContFree failed! rc=%Rrc\n", i, rc);
    9090                    }
    9191            }
    9292            else
    93                 RTPrintf("tstContiguous: SUPContAlloc (2nd) failed!\n");
     93                RTPrintf("tstContiguous: SUPR3ContAlloc (2nd) failed!\n");
    9494        }
    9595        else
    96             RTPrintf("tstContiguous: SUPContAlloc failed!\n");
     96            RTPrintf("tstContiguous: SUPR3ContAlloc failed!\n");
    9797
    98         rc = SUPTerm();
    99         RTPrintf("tstContiguous: SUPTerm -> rc=%Rrc\n", rc);
     98        rc = SUPR3Term(false /*fForced*/);
     99        RTPrintf("tstContiguous: SUPR3Term -> rc=%Rrc\n", rc);
    100100        rcRet += rc != 0;
    101101    }
  • trunk/src/VBox/HostDrivers/Support/testcase/tstGIP-2.cpp

    r17091 r20864  
    178178        }
    179179
    180         SUPTerm();
     180        SUPR3Term(false /*fForced*/);
    181181    }
    182182    else
  • trunk/src/VBox/HostDrivers/Support/testcase/tstGetPagingMode.cpp

    r14831 r20864  
    4747    if (RT_SUCCESS(rc))
    4848    {
    49         SUPPAGINGMODE enmMode = SUPGetPagingMode();
     49        SUPPAGINGMODE enmMode = SUPR3GetPagingMode();
    5050        switch (enmMode)
    5151        {
     
    8989        }
    9090
    91         int rc2 = SUPTerm();
    92         RTPrintf("SUPTerm -> rc=%Rrc\n", rc2);
     91        int rc2 = SUPR3Term(false /*fForced*/);
     92        RTPrintf("SUPR3Term -> rc=%Rrc\n", rc2);
    9393    }
    9494    else
  • trunk/src/VBox/HostDrivers/Support/testcase/tstInit.cpp

    r14831 r20864  
    4848    if (!rc)
    4949    {
    50         rc = SUPTerm();
    51         RTPrintf("tstInit: SUPTerm -> rc=%d\n", rc);
     50        rc = SUPR3Term(false /*fForced*/);
     51        RTPrintf("tstInit: SUPR3Term -> rc=%d\n", rc);
    5252    }
    5353
  • trunk/src/VBox/HostDrivers/Support/testcase/tstInt.cpp

    r20602 r20864  
    9292         */
    9393        char    szFile[RTPATH_MAX];
    94         rc = SUPLoadVMM(ExeDirFile(szFile, argv[0], "VMMR0.r0"));
     94        rc = SUPR3LoadVMM(ExeDirFile(szFile, argv[0], "VMMR0.r0"));
    9595        if (!rc)
    9696        {
     
    103103            PSUPPAGE paPages = (PSUPPAGE)RTMemAllocZ(cPages * sizeof(SUPPAGE));
    104104            if (paPages)
    105                 rc = SUPLowAlloc(cPages, (void **)&pVM, &pVMR0, &paPages[0]);
     105                rc = SUPR3LowAlloc(cPages, (void **)&pVM, &pVMR0, &paPages[0]);
    106106            else
    107107                rc = VERR_NO_MEMORY;
     
    115115                pVM->enmVMState = VMSTATE_CREATED;
    116116
    117                 rc = SUPSetVMForFastIOCtl(pVMR0);
     117                rc = SUPR3SetVMForFastIOCtl(pVMR0);
    118118                if (!rc)
    119119                {
     
    124124                    for (i = cIterations; i > 0; i--)
    125125                    {
    126                         rc = SUPCallVMMR0(pVMR0, NIL_VMCPUID, VMMR0_DO_SLOW_NOP, NULL);
     126                        rc = SUPR3CallVMMR0(pVMR0, NIL_VMCPUID, VMMR0_DO_SLOW_NOP, NULL);
    127127                        if (rc != VINF_SUCCESS)
    128128                        {
    129                             RTPrintf("tstInt: SUPCallVMMR0 -> rc=%Rrc i=%d Expected VINF_SUCCESS!\n", rc, i);
     129                            RTPrintf("tstInt: SUPR3CallVMMR0 -> rc=%Rrc i=%d Expected VINF_SUCCESS!\n", rc, i);
    130130                            rcRet++;
    131131                            break;
    132132                        }
    133133                    }
    134                     RTPrintf("tstInt: Performed SUPCallVMMR0 %d times (rc=%Rrc)\n", cIterations, rc);
     134                    RTPrintf("tstInt: Performed SUPR3CallVMMR0 %d times (rc=%Rrc)\n", cIterations, rc);
    135135
    136136                    /*
     
    146146                        {
    147147                            uint64_t OneStartTick = ASMReadTSC();
    148                             rc = SUPCallVMMR0Fast(pVMR0, VMMR0_DO_NOP, 0);
     148                            rc = SUPR3CallVMMR0Fast(pVMR0, VMMR0_DO_NOP, 0);
    149149                            uint64_t Ticks = ASMReadTSC() - OneStartTick;
    150150                            if (Ticks < MinTicks)
     
    153153                            if (RT_UNLIKELY(rc != VINF_SUCCESS))
    154154                            {
    155                                 RTPrintf("tstInt: SUPCallVMMR0Fast -> rc=%Rrc i=%d Expected VINF_SUCCESS!\n", rc, i);
     155                                RTPrintf("tstInt: SUPR3CallVMMR0Fast -> rc=%Rrc i=%d Expected VINF_SUCCESS!\n", rc, i);
    156156                                rcRet++;
    157157                                break;
     
    161161                        uint64_t NanoSecs = RTTimeNanoTS() - StartTS;
    162162
    163                         RTPrintf("tstInt: SUPCallVMMR0Fast - %d iterations in %llu ns / %llu ticks. %llu ns / %#llu ticks per iteration. Min %llu ticks.\n",
     163                        RTPrintf("tstInt: SUPR3CallVMMR0Fast - %d iterations in %llu ns / %llu ticks. %llu ns / %#llu ticks per iteration. Min %llu ticks.\n",
    164164                                 i, NanoSecs, Ticks, NanoSecs / i, Ticks / i, MinTicks);
    165165
     
    174174                        {
    175175                            uint64_t OneStartTick = ASMReadTSC();
    176                             rc = SUPCallVMMR0Ex(pVMR0, NIL_VMCPUID, VMMR0_DO_SLOW_NOP, 0, NULL);
     176                            rc = SUPR3CallVMMR0Ex(pVMR0, NIL_VMCPUID, VMMR0_DO_SLOW_NOP, 0, NULL);
    177177                            uint64_t Ticks = ASMReadTSC() - OneStartTick;
    178178                            if (Ticks < MinTicks)
     
    181181                            if (RT_UNLIKELY(rc != VINF_SUCCESS))
    182182                            {
    183                                 RTPrintf("tstInt: SUPCallVMMR0Ex -> rc=%Rrc i=%d Expected VINF_SUCCESS!\n", rc, i);
     183                                RTPrintf("tstInt: SUPR3CallVMMR0Ex -> rc=%Rrc i=%d Expected VINF_SUCCESS!\n", rc, i);
    184184                                rcRet++;
    185185                                break;
     
    189189                        NanoSecs = RTTimeNanoTS() - StartTS;
    190190
    191                         RTPrintf("tstInt: SUPCallVMMR0Ex   - %d iterations in %llu ns / %llu ticks. %llu ns / %#llu ticks per iteration. Min %llu ticks.\n",
     191                        RTPrintf("tstInt: SUPR3CallVMMR0Ex   - %d iterations in %llu ns / %llu ticks. %llu ns / %#llu ticks per iteration. Min %llu ticks.\n",
    192192                                 i, NanoSecs, Ticks, NanoSecs / i, Ticks / i, MinTicks);
    193193                    }
     
    195195                else
    196196                {
    197                     RTPrintf("tstInt: SUPSetVMForFastIOCtl failed: %Rrc\n", rc);
     197                    RTPrintf("tstInt: SUPR3SetVMForFastIOCtl failed: %Rrc\n", rc);
    198198                    rcRet++;
    199199                }
     
    201201            else
    202202            {
    203                 RTPrintf("tstInt: SUPContAlloc2(%#zx,,) failed\n", sizeof(*pVM));
     203                RTPrintf("tstInt: SUPR3ContAlloc(%#zx,,) failed\n", sizeof(*pVM));
    204204                rcRet++;
    205205            }
     
    208208             * Unload VMM.
    209209             */
    210             rc = SUPUnloadVMM();
     210            rc = SUPR3UnloadVMM();
    211211            if (rc)
    212212            {
    213                 RTPrintf("tstInt: SUPUnloadVMM failed with rc=%Rrc\n", rc);
     213                RTPrintf("tstInt: SUPR3UnloadVMM failed with rc=%Rrc\n", rc);
    214214                rcRet++;
    215215            }
     
    217217        else
    218218        {
    219             RTPrintf("tstInt: SUPLoadVMM failed with rc=%Rrc\n", rc);
     219            RTPrintf("tstInt: SUPR3LoadVMM failed with rc=%Rrc\n", rc);
    220220            rcRet++;
    221221        }
     
    224224         * Terminate.
    225225         */
    226         rc = SUPTerm();
     226        rc = SUPR3Term(false /*fForced*/);
    227227        rcRet += rc != 0;
    228         RTPrintf("tstInt: SUPTerm -> rc=%Rrc\n", rc);
     228        RTPrintf("tstInt: SUPR3Term -> rc=%Rrc\n", rc);
    229229    }
    230230
  • trunk/src/VBox/HostDrivers/Support/testcase/tstLow.cpp

    r14831 r20864  
    5959        void *pvPages0 = (void *)0x77777777;
    6060        memset(&aPages0[0], 0x8f, sizeof(aPages0));
    61         rc = SUPLowAlloc(RT_ELEMENTS(aPages0), &pvPages0, NULL, aPages0);
     61        rc = SUPR3LowAlloc(RT_ELEMENTS(aPages0), &pvPages0, NULL, aPages0);
    6262        if (RT_SUCCESS(rc))
    6363        {
     
    9191                        }
    9292            }
    93             SUPLowFree(pvPages0, RT_ELEMENTS(aPages0));
     93            SUPR3LowFree(pvPages0, RT_ELEMENTS(aPages0));
    9494        }
    9595        else
    9696        {
    97             RTPrintf("SUPLowAlloc(%d,,) failed -> rc=%Rrc\n", RT_ELEMENTS(aPages0), rc);
     97            RTPrintf("SUPR3LowAlloc(%d,,) failed -> rc=%Rrc\n", RT_ELEMENTS(aPages0), rc);
    9898            rcRet++;
    9999        }
     
    107107            void *pvPages1 = (void *)0x77777777;
    108108            memset(&aPages1[0], 0x8f, sizeof(aPages1));
    109             rc = SUPLowAlloc(cPages, &pvPages1, NULL, aPages1);
     109            rc = SUPR3LowAlloc(cPages, &pvPages1, NULL, aPages1);
    110110            if (RT_SUCCESS(rc))
    111111            {
     
    139139                            }
    140140                }
    141                 SUPLowFree(pvPages1, cPages);
     141                SUPR3LowFree(pvPages1, cPages);
    142142            }
    143143            else
    144144            {
    145                 RTPrintf("SUPLowAlloc(%d,,) failed -> rc=%Rrc\n", cPages, rc);
     145                RTPrintf("SUPR3LowAlloc(%d,,) failed -> rc=%Rrc\n", cPages, rc);
    146146                rcRet++;
    147147            }
  • trunk/src/VBox/HostDrivers/Support/testcase/tstPage.cpp

    r14831 r20864  
     1/* $Id$ */
    12/** @file
    2  *
    3  * VBox host drivers - Ring-0 support drivers - Testcases:
    4  * Test the page allocation interface
     3 * SUP Testcase - Page allocation interface (ring 3).
    54 */
    65
    76/*
    8  * Copyright (C) 2006-2007 Sun Microsystems, Inc.
     7 * Copyright (C) 2006-2009 Sun Microsystems, Inc.
    98 *
    109 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    5150    {
    5251        void *pv;
    53         rc = SUPPageAlloc(1, &pv);
     52        rc = SUPR3PageAlloc(1, &pv);
    5453        cErrors += rc != 0;
    5554        if (!rc)
    5655        {
    5756            memset(pv, 0xff, PAGE_SIZE);
    58             rc = SUPPageFree(pv, 1);
     57            rc = SUPR3PageFree(pv, 1);
    5958            cErrors += rc != 0;
    6059            if (rc)
    61                 RTPrintf("tstPage: SUPPageFree() failed rc=%d\n", rc);
     60                RTPrintf("tstPage: SUPR3PageFree() failed rc=%d\n", rc);
    6261        }
    6362        else
    64             RTPrintf("tstPage: SUPPageAlloc(1,) failed rc=%d\n", rc);
     63            RTPrintf("tstPage: SUPR3PageAlloc(1,) failed rc=%d\n", rc);
    6564
    6665        /*
    6766         * Big chunk.
    6867         */
    69         rc = SUPPageAlloc(1023, &pv);
     68        rc = SUPR3PageAlloc(1023, &pv);
    7069        cErrors += rc != 0;
    7170        if (!rc)
    7271        {
    7372            memset(pv, 0xfe, 1023 << PAGE_SHIFT);
    74             rc = SUPPageFree(pv, 1023);
     73            rc = SUPR3PageFree(pv, 1023);
    7574            cErrors += rc != 0;
    7675            if (rc)
    77                 RTPrintf("tstPage: SUPPageFree() failed rc=%d\n", rc);
     76                RTPrintf("tstPage: SUPR3PageFree() failed rc=%d\n", rc);
    7877        }
    7978        else
    80             RTPrintf("tstPage: SUPPageAlloc(1,) failed rc=%d\n", rc);
     79            RTPrintf("tstPage: SUPR3PageAlloc(1,) failed rc=%d\n", rc);
    8180
    8281
    83         //rc = SUPTerm();
     82        //rc = SUPR3Term();
    8483        cErrors += rc != 0;
    8584        if (rc)
    86             RTPrintf("tstPage: SUPTerm failed rc=%d\n", rc);
     85            RTPrintf("tstPage: SUPR3Term failed rc=%d\n", rc);
    8786    }
    8887    else
  • trunk/src/VBox/HostDrivers/Support/testcase/tstPin.cpp

    r20862 r20864  
    6161         */
    6262        void *pv;
    63         int rc = SUPPageAlloc(1, &pv);
     63        int rc = SUPR3PageAlloc(1, &pv);
    6464        AssertRC(rc);
    6565        RTPrintf("pv=%p\n", pv);
     
    8888        {
    8989            aPinnings[i].pv = NULL;
    90             SUPPageAlloc(0x10000 >> PAGE_SHIFT, &aPinnings[i].pv);
     90            SUPR3PageAlloc(0x10000 >> PAGE_SHIFT, &aPinnings[i].pv);
    9191            aPinnings[i].pvAligned = RT_ALIGN_P(aPinnings[i].pv, PAGE_SIZE);
    9292            rc = supR3PageLock(aPinnings[i].pvAligned, 0xf000 >> PAGE_SHIFT, &aPinnings[i].aPages[0]);
     
    108108                RTPrintf("SUPPageLock -> rc=%d\n", rc);
    109109                rcRet++;
    110                 SUPPageFree(aPinnings[i].pv, 0x10000 >> PAGE_SHIFT);
     110                SUPR3PageFree(aPinnings[i].pv, 0x10000 >> PAGE_SHIFT);
    111111                aPinnings[i].pv = aPinnings[i].pvAligned = NULL;
    112112                break;
     
    133133            {
    134134                memset(aPinnings[i].pv, 0xcc, 0x10000);
    135                 SUPPageFree(aPinnings[i].pv, 0x10000 >> PAGE_SHIFT);
     135                SUPR3PageFree(aPinnings[i].pv, 0x10000 >> PAGE_SHIFT);
    136136                aPinnings[i].pv = NULL;
    137137            }
     
    142142         * Allocate a bit of contiguous memory.
    143143         */
    144         pv = SUPContAlloc(RT_ALIGN_Z(15003, PAGE_SIZE) >> PAGE_SHIFT, &HCPhys);
     144        pv = SUPR3ContAlloc(RT_ALIGN_Z(15003, PAGE_SIZE) >> PAGE_SHIFT, NIL_RTR0PTR, &HCPhys);
    145145        rcRet += pv == NULL || HCPhys == 0;
    146146        if (pv && HCPhys)
    147147        {
    148             RTPrintf("SUPContAlloc(15003) -> HCPhys=%llx pv=%p\n", HCPhys, pv);
     148            RTPrintf("SUPR3ContAlloc(15003) -> HCPhys=%llx pv=%p\n", HCPhys, pv);
    149149            void *pv0 = pv;
    150150            memset(pv0, 0xaf, 15003);
    151             pv = SUPContAlloc(RT_ALIGN_Z(12999, PAGE_SIZE) >> PAGE_SHIFT, &HCPhys);
     151            pv = SUPR3ContAlloc(RT_ALIGN_Z(12999, PAGE_SIZE) >> PAGE_SHIFT, NIL_RTR0PTR, &HCPhys);
    152152            rcRet += pv == NULL || HCPhys == 0;
    153153            if (pv && HCPhys)
    154154            {
    155                 RTPrintf("SUPContAlloc(12999) -> HCPhys=%llx pv=%p\n", HCPhys, pv);
     155                RTPrintf("SUPR3ContAlloc(12999) -> HCPhys=%llx pv=%p\n", HCPhys, pv);
    156156                memset(pv, 0xbf, 12999);
    157                 rc = SUPContFree(pv, RT_ALIGN_Z(12999, PAGE_SIZE) >> PAGE_SHIFT);
     157                rc = SUPR3ContFree(pv, RT_ALIGN_Z(12999, PAGE_SIZE) >> PAGE_SHIFT);
    158158                rcRet += rc != 0;
    159159                if (rc)
    160                     RTPrintf("SUPContFree failed! rc=%d\n", rc);
     160                    RTPrintf("SUPR3ContFree failed! rc=%d\n", rc);
    161161            }
    162162            else
    163                 RTPrintf("SUPContAlloc (2nd) failed!\n");
     163                RTPrintf("SUPR3ContAlloc (2nd) failed!\n");
    164164            memset(pv0, 0xaf, 15003);
    165165            /* pv0 is intentionally not freed! */
    166166        }
    167167        else
    168             RTPrintf("SUPContAlloc failed!\n");
     168            RTPrintf("SUPR3ContAlloc failed!\n");
    169169
    170170        /*
     
    174174        #define BIG_SIZEPP  (BIG_SIZE + PAGE_SIZE)
    175175        pv = NULL;
    176         SUPPageAlloc(BIG_SIZEPP >> PAGE_SHIFT, &pv);
     176        SUPR3PageAlloc(BIG_SIZEPP >> PAGE_SHIFT, &pv);
    177177        if (pv)
    178178        {
     
    204204                rcRet++;
    205205            }
    206             SUPPageFree(pv, BIG_SIZEPP >> PAGE_SHIFT);
    207         }
    208 
    209         rc = SUPTerm();
    210         RTPrintf("SUPTerm -> rc=%d\n", rc);
     206            SUPR3PageFree(pv, BIG_SIZEPP >> PAGE_SHIFT);
     207        }
     208
     209        rc = SUPR3Term(false /*fForced*/);
     210        RTPrintf("SUPR3Term -> rc=%d\n", rc);
    211211        rcRet += rc != 0;
    212212    }
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