VirtualBox

Ignore:
Timestamp:
Aug 14, 2007 1:59:36 AM (17 years ago)
Author:
vboxsync
Message:

Added RTR0MemObjAllocPhysNC. Changed the two APIs taking ring-3 addresses to use RTR3PTR.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/include/internal/memobj.h

    r4135 r4136  
    5454    RTR0MEMOBJTYPE_LOCK,
    5555    /** RTR0MemObjAllocPhys, RTR0MemObjEnterPhys.
     56     * This memory is physical memory, page aligned, contiguous and doesn't need to have a mapping. */
     57    RTR0MEMOBJTYPE_PHYS,
     58    /** RTR0MemObjAllocPhysNC.
    5659     * This memory is physical memory, page aligned and doesn't need to have a mapping. */
    57     RTR0MEMOBJTYPE_PHYS,
     60    RTR0MEMOBJTYPE_PHYS_NC,
    5861    /** RTR0MemObjReserveKernel, RTR0MemObjReserveUser.
    5962     * This memory is page aligned and has no backing. */
     
    161164        struct
    162165        {
    163             /** The base address of the physical memory that's being mapped. */
     166            /** The base address of the physical memory. */
    164167            RTHCPHYS    PhysBase;
    165             /** If set this object was created by RTR0MemPhysAlloc, otherwise by RTR0MemPhysEnter. */
     168            /** If set this object was created by RTR0MemPhysAlloc, otherwise it was
     169             * created by RTR0MemPhysEnter. */
    166170            bool        fAllocated;
    167171        } Phys;
     172
     173        /** RTR0MEMTYPE_PHYS_NC. */
     174        struct
     175        {
     176            unsigned iDummy;
     177        } PhysNC;
    168178
    169179        /** RTR0MEMOBJTYPE_RES_VIRT */
     
    274284
    275285/**
    276  * Allocates page aligned physical memory without (necessarily) any kernel mapping.
     286 * Allocates contiguous page aligned physical memory without (necessarily) any kernel mapping.
    277287 *
    278288 * @returns IPRT status code.
     
    283293 */
    284294int rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest);
     295
     296/**
     297 * Allocates non-contiguous page aligned physical memory without (necessarily) any kernel mapping.
     298 *
     299 * @returns IPRT status code.
     300 * @param   ppMem           Where to store the ring-0 memory object handle.
     301 * @param   cb              Number of bytes to allocate, page aligned.
     302 * @param   PhysHighest     The highest permittable address (inclusive).
     303 *                          NIL_RTHCPHYS if any address is acceptable.
     304 */
     305int rtR0MemObjNativeAllocPhysNC(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest);
    285306
    286307/**
     
    310331 * @returns IPRT status code.
    311332 * @param   ppMem           Where to store the ring-0 memory object handle.
    312  * @param   pvFixed         Requested address. (void *)-1 means any address. This matches uAlignment if specified.
     333 * @param   R3PtrFixed      Requested address. (RTR3PTR)-1 means any address. This matches uAlignment if specified.
    313334 * @param   cb              The number of bytes to reserve, page aligned.
    314335 * @param   uAlignment      The alignment of the reserved memory; PAGE_SIZE, _2M or _4M.
    315336 * @param   R0Process       The process to reserve the memory in.
    316337 */
    317 int rtR0MemObjNativeReserveUser(PPRTR0MEMOBJINTERNAL ppMem, void *pvFixed, size_t cb, size_t uAlignment, RTR0PROCESS R0Process);
     338int rtR0MemObjNativeReserveUser(PPRTR0MEMOBJINTERNAL ppMem, RTR3PTR R3PtrFixed, size_t cb, size_t uAlignment, RTR0PROCESS R0Process);
    318339
    319340/**
     
    335356 * @param   ppMem           Where to store the ring-0 memory object handle of the mapping object.
    336357 * @param   pMemToMap       The object to be map.
    337  * @param   pvFixed         Requested address. (void *)-1 means any address. This matches uAlignment if specified.
     358 * @param   R3PtrFixed      Requested address. (RTR3PTR)-1 means any address. This matches uAlignment if specified.
    338359 * @param   uAlignment      The alignment of the reserved memory; PAGE_SIZE, _2M or _4M.
    339360 * @param   fProt           Combination of RTMEM_PROT_* flags (except RTMEM_PROT_NONE).
    340361 * @param   R0Process       The process to map the memory into.
    341362 */
    342 int rtR0MemObjNativeMapUser(PPRTR0MEMOBJINTERNAL ppMem, PRTR0MEMOBJINTERNAL pMemToMap, void *pvFixed, size_t uAlignment, unsigned fProt, RTR0PROCESS R0Process);
     363int rtR0MemObjNativeMapUser(PPRTR0MEMOBJINTERNAL ppMem, PRTR0MEMOBJINTERNAL pMemToMap, RTR3PTR R3PtrFixed, size_t uAlignment, unsigned fProt, RTR0PROCESS R0Process);
    343364
    344365/**
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