VirtualBox

Ignore:
Timestamp:
Dec 3, 2011 10:59:46 PM (13 years ago)
Author:
vboxsync
Message:

FreeBSD: Certain fixes to run on CURRENT and clean up the support driver character device handling, thanks to Bernhard Froehlich, Jung-uk Kim and Ed Schouten

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c

    r36555 r39521  
    392392static void rtR0MemObjFreeBSDPhysPageInit(vm_page_t pPage, vm_pindex_t iPage)
    393393{
     394#if __FreeBSD_version <= 1000000
    394395    pPage->wire_count = 1;
    395396    pPage->pindex     = iPage;
    396397    pPage->act_count  = 0;
    397     pPage->oflags     = 0;
    398     pPage->flags      = PG_UNMANAGED;
    399398    atomic_add_int(&cnt.v_wire_count, 1);
     399
     400#if __FreeBSD_version >= 900040
     401    Assert(pPage->oflags & VPO_UNMANAGED != 0);
     402#else
     403    Assert(pPage->flags & PG_UNMANAGED != 0);
     404#endif
     405#endif
    400406}
    401407
     
    409415    uint32_t   cPages = cb >> PAGE_SHIFT;
    410416    vm_paddr_t VmPhysAddrHigh;
     417#if __FreeBSD_version >= 1000001
     418    int        pFlags = VM_ALLOC_INTERRUPT | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED;
     419#endif
    411420
    412421    /* create the object. */
     
    425434    if (fContiguous)
    426435    {
     436#if __FreeBSD_version >= 1000001
     437        vm_page_t pPage = vm_page_alloc_contig(NULL, 0, pFlags, cPages, 0, VmPhysAddrHigh, uAlignment, 0, VM_MEMATTR_DEFAULT);
     438#else
    427439        vm_page_t pPage = vm_phys_alloc_contig(cPages, 0, VmPhysAddrHigh, uAlignment, 0);
     440#endif
    428441
    429442        if (pPage)
     
    441454        for (uint32_t iPage = 0; iPage < cPages; iPage++)
    442455        {
     456#if __FreeBSD_version >= 1000001
     457            vm_page_t pPage = vm_page_alloc_contig(NULL, iPage, pFlags, 1, 0, VmPhysAddrHigh, uAlignment, 0, VM_MEMATTR_DEFAULT);
     458#else
    443459            vm_page_t pPage = vm_phys_alloc_contig(1, 0, VmPhysAddrHigh, uAlignment, 0);
     460#endif
    444461
    445462            if (!pPage)
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette