- Timestamp:
- Apr 10, 2007 3:56:23 PM (18 years ago)
- svn:sync-xref-src-repo-rev:
- 20302
- Location:
- trunk/src/VBox/HostDrivers/Support
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/SUPDRVIOC.h
r1891 r2014 174 174 * The upper 16-bit is the major version, the the lower the minor version. 175 175 * When incompatible changes are made, the upper major number has to be changed. */ 176 #define SUPDRVIOC_VERSION 0x0005000 4176 #define SUPDRVIOC_VERSION 0x00050000 177 177 178 178 /** SUP_IOCTL_COOKIE Input. */ -
trunk/src/VBox/HostDrivers/Support/SUPLib.cpp
r1893 r2014 197 197 strcpy(In.szMagic, SUPCOOKIE_MAGIC); 198 198 In.u32ReqVersion = SUPDRVIOC_VERSION; 199 if (SUPDRVIOC_VERSION < 0x00050000) 200 In.u32MinVersion = 0x00040004; 201 else 202 In.u32MinVersion = SUPDRVIOC_VERSION & 0xffff0000; 199 In.u32MinVersion = SUPDRVIOC_VERSION & 0xffff0000; 203 200 rc = suplibOsIOCtl(SUP_IOCTL_COOKIE, &In, sizeof(In), &Out, sizeof(Out)); 204 201 if (VBOX_SUCCESS(rc)) 205 202 { 206 if ( (Out.u32SessionVersion & 0xffff0000) == (SUPDRVIOC_VERSION & 0xffff0000) 207 && Out.u32SessionVersion >= 0x00040004) 203 if ((Out.u32SessionVersion & 0xffff0000) == (SUPDRVIOC_VERSION & 0xffff0000)) 208 204 { 209 205 /* -
trunk/src/VBox/HostDrivers/Support/linux/SUPLib-linux.cpp
r1890 r2014 51 51 #define DEVICE_NAME "/dev/vboxdrv" 52 52 53 /* define MADV_DONTFORK if it's missing from the system headers. */ 53 54 #ifndef MADV_DONTFORK 54 # define MADV_DONTFORK1055 # define MADV_DONTFORK 10 55 56 #endif 56 57 … … 63 64 /** Flags whether or not we've loaded the kernel module. */ 64 65 static bool g_fLoadedModule = false; 65 /** Checks*/66 /** Indicates whether madvise(,,MADV_DONTFORK) works. */ 66 67 static bool g_fSysMadviseWorks = false; 67 68 … … 127 128 128 129 /* 129 * Check driver version.130 */131 /** @todo implement driver version checking. */132 133 /*134 130 * Check if madvise works. 135 131 */ … … 266 262 #else 267 263 size_t cbMmap = (g_fSysMadviseWorks ? cPages : cPages + 2) << PAGE_SHIFT; 268 char *pvPages = (char *)mmap(NULL, cbMmap, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);264 char *pvPages = (char *)mmap(NULL, cbMmap, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); 269 265 if (pvPages) 270 266 { -
trunk/src/VBox/HostDrivers/Support/testcase/tstContiguous.cpp
r1890 r2014 75 75 } 76 76 77 /* useless since SUPContAlloc/SUPContFree use cPages now */78 #if 079 /*80 * 2nd part81 */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 else103 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 #endif112 113 77 return rcRet; 114 78 } -
trunk/src/VBox/HostDrivers/Support/testcase/tstPin.cpp
r1890 r2014 54 54 for (unsigned i = 0; i < sizeof(aPinnings) / sizeof(aPinnings[0]); i++) 55 55 { 56 #ifdef __OS2__57 56 aPinnings[i].pv = NULL; 58 57 SUPPageAlloc(0x10000 >> PAGE_SHIFT, &aPinnings[i].pv); 59 #else60 aPinnings[i].pv = malloc(0x10000);61 #endif62 58 aPinnings[i].pvAligned = ALIGNP(aPinnings[i].pv, PAGE_SIZE); 63 59 rc = SUPPageLock(aPinnings[i].pvAligned, 0xf000 >> PAGE_SHIFT, &aPinnings[i].aPages[0]); … … 79 75 RTPrintf("SUPPageLock -> rc=%d\n", rc); 80 76 rcRet++; 81 #ifdef __OS2__82 77 SUPPageFree(aPinnings[i].pv, 0x10000 >> PAGE_SHIFT); 83 #else84 free(aPinnings[i].pv);85 #endif86 78 aPinnings[i].pv = aPinnings[i].pvAligned = NULL; 87 79 break; … … 108 100 { 109 101 memset(aPinnings[i].pv, 0xcc, 0x10000); 110 #ifdef __OS2__111 102 SUPPageFree(aPinnings[i].pv, 0x10000 >> PAGE_SHIFT); 112 #else113 free(aPinnings[i].pv);114 #endif115 103 aPinnings[i].pv = NULL; 116 104 } … … 152 140 #define BIG_SIZE 72*1024*1024 153 141 #define BIG_SIZEPP (BIG_SIZE + PAGE_SIZE) 154 #ifdef __OS2__155 142 pv = NULL; 156 143 SUPPageAlloc(BIG_SIZEPP >> PAGE_SHIFT, &pv); 157 #else158 pv = malloc(BIG_SIZEPP);159 #endif160 144 if (pv) 161 145 { … … 187 171 rcRet++; 188 172 } 189 #ifdef __OS2__190 173 SUPPageFree(pv, BIG_SIZEPP >> PAGE_SHIFT); 191 #else192 free(pv);193 #endif194 174 } 195 175
Note:
See TracChangeset
for help on using the changeset viewer.