VirtualBox

Changeset 27050 in vbox for trunk/src/VBox/Runtime/r0drv


Ignore:
Timestamp:
Mar 4, 2010 5:52:44 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
58365
Message:

r0drv/Solaris/alloc-r0drv-solaris: some cleanup.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r0drv/solaris/vbi/alloc-r0drv-solaris.c

    r26666 r27050  
    3838
    3939#include <iprt/assert.h>
     40#include <iprt/log.h>
    4041#include <iprt/param.h>
    4142#include <iprt/thread.h>
     
    7172    }
    7273    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));
    7475    return pHdr;
    7576}
     
    9394RTR0DECL(void *) RTMemContAlloc(PRTCCPHYS pPhys, size_t cb)
    9495{
    95     AssertPtr(pPhys);
    96     Assert(cb > 0);
     96    AssertPtrReturn(pPhys, NULL);
     97    AssertReturn(cb > 0, NULL);
    9798    RT_ASSERT_PREEMPTIBLE();
    9899
    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);
    104103    if (virtAddr == NULL)
    105104    {
    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));
    107106        return NULL;
    108107    }
    109108
    110     Assert(phys < (uint64_t)1 << 32);
    111 
    112     *pPhys = phys;
     109    Assert(physAddr < _4G);
     110    *pPhys = physAddr;
    113111    return virtAddr;
    114112}
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