Changeset 9063 in vbox for trunk/src/VBox/Runtime/r0drv
- Timestamp:
- May 23, 2008 8:50:12 AM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 31160
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r0drv/darwin/memobj-r0drv-darwin.cpp
r8245 r9063 249 249 int rc = VERR_NO_CONT_MEMORY; 250 250 AssertCompile(sizeof(IOPhysicalAddress) == 4); 251 252 /// @todo 253 // Use IOBufferMemoryDescriptor::inTaskWithPhysicalMask(kernel_task, kIOMemoryKernelUserShared | kIODirectionInOut, 254 // cb, (_4G - 1) ^ PAGE_OFFSET_MASK); 255 #if 1 /* seems to work fine for cb == PAGE_SIZE, the other variant doesn't. */ 256 IOPhysicalAddress PhysAddrIgnored = 0; 257 void *pv = IOMallocContiguous(cb, PAGE_SIZE, &PhysAddrIgnored); 258 #else 251 259 void *pv = IOMallocContiguous(cb, PAGE_SIZE, NULL); 260 #endif 252 261 if (pv) 253 262 { … … 278 287 else 279 288 { 289 printf("rtR0MemObjNativeAllocCont: PhysAddr=%llx cb=%#x\n", (unsigned long long)PhysAddr, cb); 280 290 AssertMsgFailed(("PhysAddr=%llx\n", (unsigned long long)PhysAddr)); 281 291 rc = VERR_INTERNAL_ERROR; … … 287 297 IOFreeContiguous(pv, cb); 288 298 } 299 300 /* 301 * Workaround for odd IOMallocContiguous behavior, just in case. 302 */ 303 if (rc == VERR_INTERNAL_ERROR && cb <= PAGE_SIZE) 304 rc = rtR0MemObjNativeAllocCont(ppMem, cb + PAGE_SIZE, fExecutable); 289 305 return rc; 290 306 }
Note:
See TracChangeset
for help on using the changeset viewer.