VirtualBox

Ignore:
Timestamp:
Jul 15, 2009 4:47:04 PM (16 years ago)
Author:
vboxsync
Message:

memobj-r0drv-solaris.c: Implemented reserving kernel address space.

File:
1 edited

Legend:

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

    r21497 r21621  
    148148        }
    149149
     150        case RTR0MEMOBJTYPE_RES_VIRT:
     151        {
     152            if (pMemSolaris->Core.u.ResVirt.R0Process == NIL_RTR0PROCESS)
     153                vmem_xfree(heap_arena, pMemSolaris->Core.pv, pMemSolaris->Core.cb);
     154            else
     155                AssertFailed();
     156            break;
     157        }
     158
    150159        /* unused */
    151160        case RTR0MEMOBJTYPE_LOW:
    152161        case RTR0MEMOBJTYPE_PHYS:
    153         case RTR0MEMOBJTYPE_RES_VIRT:
    154162        default:
    155163            AssertMsgFailed(("enmType=%d\n", pMemSolaris->Core.enmType));
     
    310318int rtR0MemObjNativeReserveKernel(PPRTR0MEMOBJINTERNAL ppMem, void *pvFixed, size_t cb, size_t uAlignment)
    311319{
    312     return VERR_NOT_IMPLEMENTED;
     320    PRTR0MEMOBJSOLARIS  pMemSolaris;
     321    void               *pv;
     322
     323    /*
     324     * Use xalloc.
     325     */
     326    pv = vmem_xalloc(heap_arena, cb, uAlignment, 0 /*phase*/, 0 /*nocross*/,
     327                     NULL /*minaddr*/, NULL /*maxaddr*/, VM_SLEEP);
     328    if (!pv)
     329        return VERR_NO_MEMORY;
     330    pMemSolaris = (PRTR0MEMOBJSOLARIS)rtR0MemObjNew(sizeof(*pMemSolaris), RTR0MEMOBJTYPE_RES_VIRT, pv, cb);
     331    if (!pMemSolaris)
     332    {
     333        vmem_xfree(heap_arena, pv, cb);
     334        return VERR_NO_MEMORY;
     335    }
     336
     337    pMemSolaris->Core.u.ResVirt.R0Process = NIL_RTR0PROCESS;
     338    *ppMem = &pMemSolaris->Core;
     339    return VINF_SUCCESS;
    313340}
    314341
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