Changeset 27050 in vbox for trunk/src/VBox/Runtime/r0drv
- Timestamp:
- Mar 4, 2010 5:52:44 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 58365
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r0drv/solaris/vbi/alloc-r0drv-solaris.c
r26666 r27050 38 38 39 39 #include <iprt/assert.h> 40 #include <iprt/log.h> 40 41 #include <iprt/param.h> 41 42 #include <iprt/thread.h> … … 71 72 } 72 73 else 73 cmn_err(CE_NOTE, "rtMemAlloc(%ld, %x) failed\n", cb + sizeof(*pHdr), fFlags);74 LogRel(("rtMemAlloc(%u, %#x) failed\n", (unsigned)cb + sizeof(*pHdr), fFlags)); 74 75 return pHdr; 75 76 } … … 93 94 RTR0DECL(void *) RTMemContAlloc(PRTCCPHYS pPhys, size_t cb) 94 95 { 95 AssertPtr (pPhys);96 Assert (cb > 0);96 AssertPtrReturn(pPhys, NULL); 97 AssertReturn(cb > 0, NULL); 97 98 RT_ASSERT_PREEMPTIBLE(); 98 99 99 /* Allocate physically contiguous page-aligned memory. */ 100 caddr_t virtAddr; 101 uint64_t phys = (unsigned)0xffffffff; /* insist on below 4Gig */ 102 103 virtAddr = vbi_contig_alloc(&phys, cb); 100 /* Allocate physically contiguous (< 4GB) page-aligned memory. */ 101 uint64_t physAddr = _4G -1; 102 caddr_t virtAddr = vbi_contig_alloc(&physAddr, cb); 104 103 if (virtAddr == NULL) 105 104 { 106 cmn_err(CE_NOTE, "vbi_contig_alloc for %u failed\n", cb);105 LogRel(("vbi_contig_alloc failed to allocate %u bytes\n", cb)); 107 106 return NULL; 108 107 } 109 108 110 Assert(phys < (uint64_t)1 << 32); 111 112 *pPhys = phys; 109 Assert(physAddr < _4G); 110 *pPhys = physAddr; 113 111 return virtAddr; 114 112 }
Note:
See TracChangeset
for help on using the changeset viewer.