VirtualBox

Ignore:
Timestamp:
Apr 10, 2007 3:56:23 PM (18 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
20302
Message:

r=bird: some cleanup of the cPages change.

Location:
trunk/src/VBox/HostDrivers/Support/testcase
Files:
2 edited

Legend:

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

    r1890 r2014  
    7575    }
    7676
    77     /* useless since SUPContAlloc/SUPContFree use cPages now */
    78 #if 0
    79     /*
    80      * 2nd part
    81      */
    82     if (!rcRet)
    83     {
    84         rc = SUPInit();
    85         RTPrintf("tstContiguous: SUPInit -> rc=%Vrc\n", rc);
    86         rcRet += rc != 0;
    87         if (!rc)
    88         {
    89             for (int i = 0; i < 256; i++)
    90             {
    91                 RTHCPHYS HCPhys = 0;
    92                 void *pv = SUPContAlloc(PAGE_SIZE + 512 + i, &HCPhys);
    93                 rcRet += pv == NULL || HCPhys == 0;
    94                 if (pv && HCPhys)
    95                 {
    96                     memset(pv, 0x7f, PAGE_SIZE + 512 + i);
    97                     rc = SUPContFree(pv);
    98                     rcRet += rc != 0;
    99                     if (rc)
    100                         RTPrintf("tstContiguous: %d: SUPContFree failed! rc=%Vrc\n", i, rc);
    101                 }
    102                 else
    103                     RTPrintf("tstContiguous: %d: SUPContAlloc failed!\n", i);
    104             }
    105 
    106             rc = SUPTerm();
    107             RTPrintf("tstContiguous: SUPTerm -> rc=%Vrc\n", rc);
    108             rcRet += rc != 0;
    109         }
    110     }
    111 #endif
    112 
    11377    return rcRet;
    11478}
  • trunk/src/VBox/HostDrivers/Support/testcase/tstPin.cpp

    r1890 r2014  
    5454        for (unsigned i = 0; i < sizeof(aPinnings) / sizeof(aPinnings[0]); i++)
    5555        {
    56 #ifdef __OS2__
    5756            aPinnings[i].pv = NULL;
    5857            SUPPageAlloc(0x10000 >> PAGE_SHIFT, &aPinnings[i].pv);
    59 #else
    60             aPinnings[i].pv = malloc(0x10000);
    61 #endif
    6258            aPinnings[i].pvAligned = ALIGNP(aPinnings[i].pv, PAGE_SIZE);
    6359            rc = SUPPageLock(aPinnings[i].pvAligned, 0xf000 >> PAGE_SHIFT, &aPinnings[i].aPages[0]);
     
    7975                RTPrintf("SUPPageLock -> rc=%d\n", rc);
    8076                rcRet++;
    81 #ifdef __OS2__
    8277                SUPPageFree(aPinnings[i].pv, 0x10000 >> PAGE_SHIFT);
    83 #else
    84                 free(aPinnings[i].pv);
    85 #endif
    8678                aPinnings[i].pv = aPinnings[i].pvAligned = NULL;
    8779                break;
     
    108100            {
    109101                memset(aPinnings[i].pv, 0xcc, 0x10000);
    110 #ifdef __OS2__
    111102                SUPPageFree(aPinnings[i].pv, 0x10000 >> PAGE_SHIFT);
    112 #else
    113                 free(aPinnings[i].pv);
    114 #endif
    115103                aPinnings[i].pv = NULL;
    116104            }
     
    152140        #define BIG_SIZE    72*1024*1024
    153141        #define BIG_SIZEPP  (BIG_SIZE + PAGE_SIZE)
    154 #ifdef __OS2__
    155142        pv = NULL;
    156143        SUPPageAlloc(BIG_SIZEPP >> PAGE_SHIFT, &pv);
    157 #else
    158         pv = malloc(BIG_SIZEPP);
    159 #endif
    160144        if (pv)
    161145        {
     
    187171                rcRet++;
    188172            }
    189 #ifdef __OS2__
    190173            SUPPageFree(pv, BIG_SIZEPP >> PAGE_SHIFT);
    191 #else
    192             free(pv);
    193 #endif
    194174        }
    195175
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