Changeset 19956 in vbox for trunk/src/VBox/Runtime/r0drv/darwin/memobj-r0drv-darwin.cpp
- Timestamp:
- May 24, 2009 2:34:58 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r0drv/darwin/memobj-r0drv-darwin.cpp
r16329 r19956 36 36 37 37 #include <iprt/memobj.h> 38 38 39 #include <iprt/alloc.h> 40 #include <iprt/asm.h> 39 41 #include <iprt/assert.h> 40 42 #include <iprt/log.h> 41 43 #include <iprt/param.h> 44 #include <iprt/process.h> 42 45 #include <iprt/string.h> 43 #include <iprt/process.h> 46 44 47 #include "internal/memobj.h" 45 48 … … 508 511 { 509 512 /* 513 * HACK ALERT! 514 * 515 * Touch the pages to force the kernel to create the page 516 * table entries. This is necessary since the kernel gets 517 * upset if we take a page fault when preemption is disabled 518 * and/or we own a simple lock. It has no problems with us 519 * disabling interrupts when taking the traps, weird stuff. 520 */ 521 uint32_t volatile *pu32 = (uint32_t volatile *)pv; 522 size_t cbLeft = cbSub; 523 for (;;) 524 { 525 ASMAtomicCmpXchgU32(pu32, 0xdeadbeef, 0xdeadbeef); 526 if (cbLeft <= PAGE_SIZE) 527 break; 528 cbLeft -= PAGE_SIZE; 529 pu32 += PAGE_SIZE / sizeof(uint32_t); 530 } 531 532 /* 510 533 * Create the IPRT memory object. 511 534 */
Note:
See TracChangeset
for help on using the changeset viewer.