VirtualBox

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/testcase
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • 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.

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