VirtualBox

Changeset 31157 in vbox for trunk/include/iprt/memobj.h


Ignore:
Timestamp:
Jul 28, 2010 3:15:35 AM (14 years ago)
Author:
vboxsync
Message:

iprt,++: Tag allocation in all builds with a string, defaulting to FILE.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/memobj.h

    r29027 r31157  
    44
    55/*
    6  * Copyright (C) 2006-2007 Oracle Corporation
     6 * Copyright (C) 2006-2010 Oracle Corporation
    77 *
    88 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    3737 */
    3838
     39/** @def RTMEM_TAG
     40 * The default allocation tag used by the RTMem allocation APIs.
     41 *
     42 * When not defined before the inclusion of iprt/memobj.h or iprt/mem.h, this
     43 * will default to the pointer to the current file name.  The memory API will
     44 * make of use of this as pointer to a volatile but read-only string.
     45 */
     46#ifndef RTMEM_TAG
     47# define RTMEM_TAG   (__FILE__)
     48#endif
     49
    3950#ifdef IN_RING0
    4051
     
    102113
    103114/**
    104  * Allocates page aligned virtual kernel memory.
     115 * Allocates page aligned virtual kernel memory (default tag).
    105116 *
    106117 * The memory is taken from a non paged (= fixed physical memory backing) pool.
     
    111122 * @param   fExecutable     Flag indicating whether it should be permitted to executed code in the memory object.
    112123 */
    113 RTR0DECL(int) RTR0MemObjAllocPage(PRTR0MEMOBJ pMemObj, size_t cb, bool fExecutable);
    114 
    115 /**
    116  * Allocates page aligned virtual kernel memory with physical backing below 4GB.
     124#define RTR0MemObjAllocPage(pMemObj, cb, fExecutable) \
     125    RTR0MemObjAllocPageTag((pMemObj), (cb), (fExecutable), RTMEM_TAG)
     126
     127/**
     128 * Allocates page aligned virtual kernel memory (custom tag).
     129 *
     130 * The memory is taken from a non paged (= fixed physical memory backing) pool.
     131 *
     132 * @returns IPRT status code.
     133 * @param   pMemObj         Where to store the ring-0 memory object handle.
     134 * @param   cb              Number of bytes to allocate. This is rounded up to nearest page.
     135 * @param   fExecutable     Flag indicating whether it should be permitted to executed code in the memory object.
     136 * @param   pszTag          Allocation tag used for statistics and such.
     137 */
     138RTR0DECL(int) RTR0MemObjAllocPageTag(PRTR0MEMOBJ pMemObj, size_t cb, bool fExecutable, const char *pszTag);
     139
     140/**
     141 * Allocates page aligned virtual kernel memory with physical backing below 4GB
     142 * (default tag).
    117143 *
    118144 * The physical memory backing the allocation is fixed.
     
    123149 * @param   fExecutable     Flag indicating whether it should be permitted to executed code in the memory object.
    124150 */
    125 RTR0DECL(int) RTR0MemObjAllocLow(PRTR0MEMOBJ pMemObj, size_t cb, bool fExecutable);
    126 
    127 /**
    128  * Allocates page aligned virtual kernel memory with contiguous physical backing below 4GB.
     151#define RTR0MemObjAllocLow(pMemObj, cb, fExecutable) \
     152    RTR0MemObjAllocLowTag((pMemObj), (cb), (fExecutable), RTMEM_TAG)
     153
     154/**
     155 * Allocates page aligned virtual kernel memory with physical backing below 4GB
     156 * (custom tag).
    129157 *
    130158 * The physical memory backing the allocation is fixed.
     
    134162 * @param   cb              Number of bytes to allocate. This is rounded up to nearest page.
    135163 * @param   fExecutable     Flag indicating whether it should be permitted to executed code in the memory object.
    136  */
    137 RTR0DECL(int) RTR0MemObjAllocCont(PRTR0MEMOBJ pMemObj, size_t cb, bool fExecutable);
    138 
    139 /**
    140  * Locks a range of user virtual memory.
     164 * @param   pszTag          Allocation tag used for statistics and such.
     165 */
     166RTR0DECL(int) RTR0MemObjAllocLowTag(PRTR0MEMOBJ pMemObj, size_t cb, bool fExecutable, const char *pszTag);
     167
     168/**
     169 * Allocates page aligned virtual kernel memory with contiguous physical backing
     170 * below 4GB (default tag).
     171 *
     172 * The physical memory backing the allocation is fixed.
     173 *
     174 * @returns IPRT status code.
     175 * @param   pMemObj         Where to store the ring-0 memory object handle.
     176 * @param   cb              Number of bytes to allocate. This is rounded up to nearest page.
     177 * @param   fExecutable     Flag indicating whether it should be permitted to executed code in the memory object.
     178 */
     179#define RTR0MemObjAllocCont(pMemObj, cb, fExecutable) \
     180    RTR0MemObjAllocContTag((pMemObj), (cb), (fExecutable), RTMEM_TAG)
     181
     182/**
     183 * Allocates page aligned virtual kernel memory with contiguous physical backing
     184 * below 4GB (custom tag).
     185 *
     186 * The physical memory backing the allocation is fixed.
     187 *
     188 * @returns IPRT status code.
     189 * @param   pMemObj         Where to store the ring-0 memory object handle.
     190 * @param   cb              Number of bytes to allocate. This is rounded up to nearest page.
     191 * @param   fExecutable     Flag indicating whether it should be permitted to executed code in the memory object.
     192 * @param   pszTag          Allocation tag used for statistics and such.
     193 */
     194RTR0DECL(int) RTR0MemObjAllocContTag(PRTR0MEMOBJ pMemObj, size_t cb, bool fExecutable, const char *pszTag);
     195
     196/**
     197 * Locks a range of user virtual memory (default tag).
    141198 *
    142199 * @returns IPRT status code.
     
    159216 *          lifting it.
    160217 */
    161 RTR0DECL(int) RTR0MemObjLockUser(PRTR0MEMOBJ pMemObj, RTR3PTR R3Ptr, size_t cb, uint32_t fAccess, RTR0PROCESS R0Process);
    162 
    163 /**
    164  * Locks a range of kernel virtual memory.
     218#define RTR0MemObjLockUser(pMemObj, R3Ptr, cb, fAccess, R0Process) \
     219    RTR0MemObjLockUserTag((pMemObj), (R3Ptr), (cb), (fAccess), (R0Process), RTMEM_TAG)
     220
     221/**
     222 * Locks a range of user virtual memory (custom tag).
     223 *
     224 * @returns IPRT status code.
     225 * @param   pMemObj         Where to store the ring-0 memory object handle.
     226 * @param   R3Ptr           User virtual address. This is rounded down to a page
     227 *                          boundrary.
     228 * @param   cb              Number of bytes to lock. This is rounded up to
     229 *                          nearest page boundrary.
     230 * @param   fAccess         The desired access, a combination of RTMEM_PROT_READ
     231 *                          and RTMEM_PROT_WRITE.
     232 * @param   R0Process       The process to lock pages in. NIL_R0PROCESS is an
     233 *                          alias for the current one.
     234 * @param   pszTag          Allocation tag used for statistics and such.
     235 *
     236 * @remarks RTR0MemGetAddressR3() and RTR0MemGetAddress() will return therounded
     237 *          down address.
     238 *
     239 * @remarks Linux: This API requires that the memory begin locked is in a memory
     240 *          mapping that is not required in any forked off child process. This
     241 *          is not intented as permanent restriction, feel free to help out
     242 *          lifting it.
     243 */
     244RTR0DECL(int) RTR0MemObjLockUserTag(PRTR0MEMOBJ pMemObj, RTR3PTR R3Ptr, size_t cb, uint32_t fAccess,
     245                                    RTR0PROCESS R0Process, const char *pszTag);
     246
     247/**
     248 * Locks a range of kernel virtual memory (default tag).
    165249 *
    166250 * @returns IPRT status code.
     
    173257 * @remark  RTR0MemGetAddress() will return the rounded down address.
    174258 */
    175 RTR0DECL(int) RTR0MemObjLockKernel(PRTR0MEMOBJ pMemObj, void *pv, size_t cb, uint32_t fAccess);
    176 
    177 /**
    178  * Allocates contiguous page aligned physical memory without (necessarily) any kernel mapping.
     259#define RTR0MemObjLockKernel(pMemObj, pv, cb, fAccess) \
     260    RTR0MemObjLockKernelTag((pMemObj), (pv), (cb), (fAccess), RTMEM_TAG)
     261
     262/**
     263 * Locks a range of kernel virtual memory (custom tag).
     264 *
     265 * @returns IPRT status code.
     266 * @param   pMemObj         Where to store the ring-0 memory object handle.
     267 * @param   pv              Kernel virtual address. This is rounded down to a page boundrary.
     268 * @param   cb              Number of bytes to lock. This is rounded up to nearest page boundrary.
     269 * @param   fAccess         The desired access, a combination of RTMEM_PROT_READ
     270 *                          and RTMEM_PROT_WRITE.
     271 * @param   pszTag          Allocation tag used for statistics and such.
     272 *
     273 * @remark  RTR0MemGetAddress() will return the rounded down address.
     274 */
     275RTR0DECL(int) RTR0MemObjLockKernelTag(PRTR0MEMOBJ pMemObj, void *pv, size_t cb, uint32_t fAccess, const char *pszTag);
     276
     277/**
     278 * Allocates contiguous page aligned physical memory without (necessarily) any
     279 * kernel mapping (default tag).
    179280 *
    180281 * @returns IPRT status code.
     
    184285 *                          Pass NIL_RTHCPHYS if any address is acceptable.
    185286 */
    186 RTR0DECL(int) RTR0MemObjAllocPhys(PRTR0MEMOBJ pMemObj, size_t cb, RTHCPHYS PhysHighest);
    187 
    188 /**
    189  * Allocates contiguous physical memory without (necessarily) any kernel mapping.
     287#define RTR0MemObjAllocPhys(pMemObj, cb, PhysHighest) \
     288    RTR0MemObjAllocPhysTag((pMemObj), (cb), (PhysHighest), RTMEM_TAG)
     289
     290/**
     291 * Allocates contiguous page aligned physical memory without (necessarily) any
     292 * kernel mapping (custom tag).
    190293 *
    191294 * @returns IPRT status code.
     
    194297 * @param   PhysHighest     The highest permittable address (inclusive).
    195298 *                          Pass NIL_RTHCPHYS if any address is acceptable.
     299 * @param   pszTag          Allocation tag used for statistics and such.
     300 */
     301RTR0DECL(int) RTR0MemObjAllocPhysTag(PRTR0MEMOBJ pMemObj, size_t cb, RTHCPHYS PhysHighest, const char *pszTag);
     302
     303/**
     304 * Allocates contiguous physical memory without (necessarily) any kernel mapping
     305 * (default tag).
     306 *
     307 * @returns IPRT status code.
     308 * @param   pMemObj         Where to store the ring-0 memory object handle.
     309 * @param   cb              Number of bytes to allocate. This is rounded up to nearest page.
     310 * @param   PhysHighest     The highest permittable address (inclusive).
     311 *                          Pass NIL_RTHCPHYS if any address is acceptable.
    196312 * @param   uAlignment      The alignment of the reserved memory.
    197313 *                          Supported values are 0 (alias for PAGE_SIZE), PAGE_SIZE, _2M, _4M and _1G.
    198314 */
    199 RTR0DECL(int) RTR0MemObjAllocPhysEx(PRTR0MEMOBJ pMemObj, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment);
    200 
    201 /**
    202  * Allocates non-contiguous page aligned physical memory without (necessarily) any kernel mapping.
     315#define RTR0MemObjAllocPhysEx(pMemObj, cb, PhysHighest, uAlignment) \
     316    RTR0MemObjAllocPhysExTag((pMemObj), (cb), (PhysHighest), (uAlignment), RTMEM_TAG)
     317
     318/**
     319 * Allocates contiguous physical memory without (necessarily) any kernel mapping
     320 * (custom tag).
     321 *
     322 * @returns IPRT status code.
     323 * @param   pMemObj         Where to store the ring-0 memory object handle.
     324 * @param   cb              Number of bytes to allocate. This is rounded up to nearest page.
     325 * @param   PhysHighest     The highest permittable address (inclusive).
     326 *                          Pass NIL_RTHCPHYS if any address is acceptable.
     327 * @param   uAlignment      The alignment of the reserved memory.
     328 *                          Supported values are 0 (alias for PAGE_SIZE), PAGE_SIZE, _2M, _4M and _1G.
     329 * @param   pszTag          Allocation tag used for statistics and such.
     330 */
     331RTR0DECL(int) RTR0MemObjAllocPhysExTag(PRTR0MEMOBJ pMemObj, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment, const char *pszTag);
     332
     333/**
     334 * Allocates non-contiguous page aligned physical memory without (necessarily)
     335 * any kernel mapping (default tag).
    203336 *
    204337 * This API is for allocating huge amounts of pages and will return
     
    216349 *                          Pass NIL_RTHCPHYS if any address is acceptable.
    217350 */
    218 RTR0DECL(int) RTR0MemObjAllocPhysNC(PRTR0MEMOBJ pMemObj, size_t cb, RTHCPHYS PhysHighest);
     351#define RTR0MemObjAllocPhysNC(pMemObj, cb, PhysHighest) \
     352    RTR0MemObjAllocPhysNCTag((pMemObj), (cb), (PhysHighest), RTMEM_TAG)
     353
     354/**
     355 * Allocates non-contiguous page aligned physical memory without (necessarily)
     356 * any kernel mapping (custom tag).
     357 *
     358 * This API is for allocating huge amounts of pages and will return
     359 * VERR_NOT_SUPPORTED if this cannot be implemented in a satisfactory
     360 * manner.
     361 *
     362 * @returns IPRT status code.
     363 * @retval  VERR_NOT_SUPPORTED if it's not possible to allocated unmapped
     364 *          physical memory on this platform. The caller should expect
     365 *          this error and have a fallback strategy for it.
     366 *
     367 * @param   pMemObj         Where to store the ring-0 memory object handle.
     368 * @param   cb              Number of bytes to allocate. This is rounded up to nearest page.
     369 * @param   PhysHighest     The highest permittable address (inclusive).
     370 *                          Pass NIL_RTHCPHYS if any address is acceptable.
     371 * @param   pszTag          Allocation tag used for statistics and such.
     372 */
     373RTR0DECL(int) RTR0MemObjAllocPhysNCTag(PRTR0MEMOBJ pMemObj, size_t cb, RTHCPHYS PhysHighest, const char *pszTag);
    219374
    220375/** Memory cache policy for RTR0MemObjEnterPhys.
     
    228383
    229384/**
    230  * Creates a page aligned, contiguous, physical memory object.
     385 * Creates a page aligned, contiguous, physical memory object (default tag).
    231386 *
    232387 * No physical memory is allocated, we trust you do know what you're doing.
     
    239394 * @param   uCachePolicy    One of the RTMEM_CACHE_XXX modes.
    240395 */
    241 RTR0DECL(int) RTR0MemObjEnterPhys(PRTR0MEMOBJ pMemObj, RTHCPHYS Phys, size_t cb, uint32_t uCachePolicy);
    242 
    243 /**
    244  * Reserves kernel virtual address space.
     396#define RTR0MemObjEnterPhys(pMemObj, Phys, cb, uCachePolicy) \
     397    RTR0MemObjEnterPhysTag((pMemObj), (Phys), (cb), (uCachePolicy), RTMEM_TAG)
     398
     399/**
     400 * Creates a page aligned, contiguous, physical memory object (custom tag).
     401 *
     402 * No physical memory is allocated, we trust you do know what you're doing.
     403 *
     404 * @returns IPRT status code.
     405 * @param   pMemObj         Where to store the ring-0 memory object handle.
     406 * @param   Phys            The physical address to start at. This is rounded down to the
     407 *                          nearest page boundrary.
     408 * @param   cb              The size of the object in bytes. This is rounded up to nearest page boundrary.
     409 * @param   uCachePolicy    One of the RTMEM_CACHE_XXX modes.
     410 * @param   pszTag          Allocation tag used for statistics and such.
     411 */
     412RTR0DECL(int) RTR0MemObjEnterPhysTag(PRTR0MEMOBJ pMemObj, RTHCPHYS Phys, size_t cb, uint32_t uCachePolicy, const char *pszTag);
     413
     414/**
     415 * Reserves kernel virtual address space (default tag).
    245416 *
    246417 * If this function fails with VERR_NOT_SUPPORTED, the idea is that you
     
    255426 *                          Supported values are 0 (alias for PAGE_SIZE), PAGE_SIZE, _2M and _4M.
    256427 */
    257 RTR0DECL(int) RTR0MemObjReserveKernel(PRTR0MEMOBJ pMemObj, void *pvFixed, size_t cb, size_t uAlignment);
    258 
    259 /**
    260  * Reserves user virtual address space in the current process.
     428#define RTR0MemObjReserveKernel(pMemObj, pvFixed, cb, uAlignment) \
     429    RTR0MemObjReserveKernelTag((pMemObj), (pvFixed), (cb), (uAlignment), RTMEM_TAG)
     430
     431/**
     432 * Reserves kernel virtual address space (custom tag).
     433 *
     434 * If this function fails with VERR_NOT_SUPPORTED, the idea is that you
     435 * can use RTR0MemObjEnterPhys() + RTR0MemObjMapKernel() as a fallback if
     436 * you have a safe physical address range to make use of...
     437 *
     438 * @returns IPRT status code.
     439 * @param   pMemObj         Where to store the ring-0 memory object handle.
     440 * @param   pvFixed         Requested address. (void *)-1 means any address. This must match the alignment.
     441 * @param   cb              The number of bytes to reserve. This is rounded up to nearest page.
     442 * @param   uAlignment      The alignment of the reserved memory.
     443 *                          Supported values are 0 (alias for PAGE_SIZE), PAGE_SIZE, _2M and _4M.
     444 * @param   pszTag          Allocation tag used for statistics and such.
     445 */
     446RTR0DECL(int) RTR0MemObjReserveKernelTag(PRTR0MEMOBJ pMemObj, void *pvFixed, size_t cb, size_t uAlignment, const char *pszTag);
     447
     448/**
     449 * Reserves user virtual address space in the current process (default tag).
    261450 *
    262451 * @returns IPRT status code.
     
    268457 * @param   R0Process       The process to reserve the memory in. NIL_R0PROCESS is an alias for the current one.
    269458 */
    270 RTR0DECL(int) RTR0MemObjReserveUser(PRTR0MEMOBJ pMemObj, RTR3PTR R3PtrFixed, size_t cb, size_t uAlignment, RTR0PROCESS R0Process);
    271 
    272 /**
    273  * Maps a memory object into kernel virtual address space.
     459#define RTR0MemObjReserveUser(pMemObj, R3PtrFixed, cb, uAlignment, R0Process) \
     460    RTR0MemObjReserveUserTag((pMemObj), (R3PtrFixed), (cb), (uAlignment), (R0Process), RTMEM_TAG)
     461
     462/**
     463 * Reserves user virtual address space in the current process (custom tag).
     464 *
     465 * @returns IPRT status code.
     466 * @param   pMemObj         Where to store the ring-0 memory object handle.
     467 * @param   R3PtrFixed      Requested address. (RTR3PTR)-1 means any address. This must match the alignment.
     468 * @param   cb              The number of bytes to reserve. This is rounded up to nearest PAGE_SIZE.
     469 * @param   uAlignment      The alignment of the reserved memory.
     470 *                          Supported values are 0 (alias for PAGE_SIZE), PAGE_SIZE, _2M and _4M.
     471 * @param   R0Process       The process to reserve the memory in. NIL_R0PROCESS is an alias for the current one.
     472 * @param   pszTag          Allocation tag used for statistics and such.
     473 */
     474RTR0DECL(int) RTR0MemObjReserveUserTag(PRTR0MEMOBJ pMemObj, RTR3PTR R3PtrFixed, size_t cb, size_t uAlignment,
     475                                       RTR0PROCESS R0Process, const char *pszTag);
     476
     477/**
     478 * Maps a memory object into kernel virtual address space (default tag).
    274479 *
    275480 * This is the same as calling RTR0MemObjMapKernelEx with cbSub and offSub set
     
    284489 * @param   fProt           Combination of RTMEM_PROT_* flags (except RTMEM_PROT_NONE).
    285490 */
    286 RTR0DECL(int) RTR0MemObjMapKernel(PRTR0MEMOBJ pMemObj, RTR0MEMOBJ MemObjToMap, void *pvFixed, size_t uAlignment, unsigned fProt);
    287 
    288 /**
    289  * Maps a memory object into kernel virtual address space.
     491#define RTR0MemObjMapKernel(pMemObj, MemObjToMap, pvFixed, uAlignment, fProt) \
     492    RTR0MemObjMapKernelTag((pMemObj), (MemObjToMap), (pvFixed), (uAlignment), (fProt), RTMEM_TAG)
     493
     494/**
     495 * Maps a memory object into kernel virtual address space (custom tag).
     496 *
     497 * This is the same as calling RTR0MemObjMapKernelEx with cbSub and offSub set
     498 * to zero.
     499 *
     500 * @returns IPRT status code.
     501 * @param   pMemObj         Where to store the ring-0 memory object handle of the mapping object.
     502 * @param   MemObjToMap     The object to be map.
     503 * @param   pvFixed         Requested address. (void *)-1 means any address. This must match the alignment.
     504 * @param   uAlignment      The alignment of the reserved memory.
     505 *                          Supported values are 0 (alias for PAGE_SIZE), PAGE_SIZE, _2M and _4M.
     506 * @param   fProt           Combination of RTMEM_PROT_* flags (except RTMEM_PROT_NONE).
     507 * @param   pszTag          Allocation tag used for statistics and such.
     508 */
     509RTR0DECL(int) RTR0MemObjMapKernelTag(PRTR0MEMOBJ pMemObj, RTR0MEMOBJ MemObjToMap, void *pvFixed,
     510                                     size_t uAlignment, unsigned fProt, const char *pszTag);
     511
     512/**
     513 * Maps a memory object into kernel virtual address space (default tag).
    290514 *
    291515 * The ability to map subsections of the object into kernel space is currently
     
    310534 *                          page aligned.
    311535 */
    312 RTR0DECL(int) RTR0MemObjMapKernelEx(PRTR0MEMOBJ pMemObj, RTR0MEMOBJ MemObjToMap, void *pvFixed, size_t uAlignment,
    313                                     unsigned fProt, size_t offSub, size_t cbSub);
    314 
    315 /**
    316  * Maps a memory object into user virtual address space in the current process.
     536#define RTR0MemObjMapKernelEx(pMemObj, MemObjToMap, pvFixed, uAlignment, fProt, offSub, cbSub) \
     537    RTR0MemObjMapKernelExTag((pMemObj), (MemObjToMap), (pvFixed), (uAlignment), (fProt), (offSub), (cbSub), RTMEM_TAG)
     538
     539/**
     540 * Maps a memory object into kernel virtual address space (custom tag).
     541 *
     542 * The ability to map subsections of the object into kernel space is currently
     543 * not implemented on all platforms. All/Most of platforms supports mapping the
     544 * whole object into  kernel space.
     545 *
     546 * @returns IPRT status code.
     547 * @retval  VERR_NOT_SUPPORTED if it's not possible to map a subsection of a
     548 *          memory object on this platform. When you hit this, try implement it.
     549 *
     550 * @param   pMemObj         Where to store the ring-0 memory object handle of the mapping object.
     551 * @param   MemObjToMap     The object to be map.
     552 * @param   pvFixed         Requested address. (void *)-1 means any address. This must match the alignment.
     553 * @param   uAlignment      The alignment of the reserved memory.
     554 *                          Supported values are 0 (alias for PAGE_SIZE), PAGE_SIZE, _2M and _4M.
     555 * @param   fProt           Combination of RTMEM_PROT_* flags (except RTMEM_PROT_NONE).
     556 * @param   offSub          Where in the object to start mapping. If non-zero
     557 *                          the value must be page aligned and cbSub must be
     558 *                          non-zero as well.
     559 * @param   cbSub           The size of the part of the object to be mapped. If
     560 *                          zero the entire object is mapped. The value must be
     561 *                          page aligned.
     562 * @param   pszTag          Allocation tag used for statistics and such.
     563 */
     564RTR0DECL(int) RTR0MemObjMapKernelExTag(PRTR0MEMOBJ pMemObj, RTR0MEMOBJ MemObjToMap, void *pvFixed, size_t uAlignment,
     565                                       unsigned fProt, size_t offSub, size_t cbSub, const char *pszTag);
     566
     567/**
     568 * Maps a memory object into user virtual address space in the current process
     569 * (default tag).
    317570 *
    318571 * @returns IPRT status code.
     
    325578 * @param   R0Process       The process to map the memory into. NIL_R0PROCESS is an alias for the current one.
    326579 */
    327 RTR0DECL(int) RTR0MemObjMapUser(PRTR0MEMOBJ pMemObj, RTR0MEMOBJ MemObjToMap, RTR3PTR R3PtrFixed, size_t uAlignment, unsigned fProt, RTR0PROCESS R0Process);
     580#define RTR0MemObjMapUser(pMemObj, MemObjToMap, R3PtrFixed, uAlignment, fProt, R0Process) \
     581    RTR0MemObjMapUserTag((pMemObj), (MemObjToMap), (R3PtrFixed), (uAlignment), (fProt), (R0Process), RTMEM_TAG)
     582
     583/**
     584 * Maps a memory object into user virtual address space in the current process
     585 * (custom tag).
     586 *
     587 * @returns IPRT status code.
     588 * @param   pMemObj         Where to store the ring-0 memory object handle of the mapping object.
     589 * @param   MemObjToMap     The object to be map.
     590 * @param   R3PtrFixed      Requested address. (RTR3PTR)-1 means any address. This must match the alignment.
     591 * @param   uAlignment      The alignment of the reserved memory.
     592 *                          Supported values are 0 (alias for PAGE_SIZE), PAGE_SIZE, _2M and _4M.
     593 * @param   fProt           Combination of RTMEM_PROT_* flags (except RTMEM_PROT_NONE).
     594 * @param   R0Process       The process to map the memory into. NIL_R0PROCESS is an alias for the current one.
     595 * @param   pszTag          Allocation tag used for statistics and such.
     596 */
     597RTR0DECL(int) RTR0MemObjMapUserTag(PRTR0MEMOBJ pMemObj, RTR0MEMOBJ MemObjToMap, RTR3PTR R3PtrFixed,
     598                                   size_t uAlignment, unsigned fProt, RTR0PROCESS R0Process, const char *pszTag);
    328599
    329600/**
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