VirtualBox

Ignore:
Timestamp:
Sep 30, 2021 12:12:26 AM (3 years ago)
Author:
vboxsync
Message:

IPRT/memobj: Passing pszTag around...

File:
1 edited

Legend:

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

    r91481 r91482  
    308308 *
    309309 * @returns IPRT status code.
    310  * @param   ppMem        Where to store the allocated memory object.
    311  * @param   pvStart      The starting address.
    312  * @param   cb           The size of the block.
    313  * @param   fAccess      The mapping protection to apply.
    314  * @param   R0Process    The process to map the memory to (use NIL_RTR0PROCESS
    315  *                       for the kernel)
    316  * @param   fFlags       Memory flags (B_READ_DEVICE indicates the memory is
    317  *                       intended to be written from a "device").
     310 * @param   ppMem       Where to store the allocated memory object.
     311 * @param   pvStart     The starting address.
     312 * @param   cb          The size of the block.
     313 * @param   fAccess     The mapping protection to apply.
     314 * @param   R0Process   The process to map the memory to (use NIL_RTR0PROCESS
     315 *                      for the kernel)
     316 * @param   fFlags      Memory flags (B_READ_DEVICE indicates the memory is
     317 *                      intended to be written from a "device").
     318 * @param   pszTag      Allocation tag used for statistics and such.
    318319 */
    319320static int rtR0MemObjNativeLockInMap(PPRTR0MEMOBJINTERNAL ppMem, void *pvStart, size_t cb, uint32_t fAccess,
    320                                      RTR0PROCESS R0Process, int fFlags)
     321                                     RTR0PROCESS R0Process, int fFlags, const char *pszTag)
    321322{
    322323    NOREF(fAccess);
    323     int rc;
    324324    team_id TeamId = B_SYSTEM_TEAM;
    325325
     
    328328
    329329    /* Create the object. */
    330     PRTR0MEMOBJHAIKU pMemHaiku = (PRTR0MEMOBJHAIKU)rtR0MemObjNew(sizeof(*pMemHaiku), RTR0MEMOBJTYPE_LOCK, pvStart, cb, NULL);
     330    PRTR0MEMOBJHAIKU pMemHaiku = (PRTR0MEMOBJHAIKU)rtR0MemObjNew(sizeof(*pMemHaiku), RTR0MEMOBJTYPE_LOCK, pvStart, cb, pszTag);
    331331    if (RT_UNLIKELY(!pMemHaiku))
    332332        return VERR_NO_MEMORY;
     
    334334    if (R0Process != NIL_RTR0PROCESS)
    335335        TeamId = (team_id)R0Process;
    336     rc = lock_memory_etc(TeamId, pvStart, cb, fFlags);
     336    int rc = lock_memory_etc(TeamId, pvStart, cb, fFlags);
    337337    if (rc == B_OK)
    338338    {
     
    347347
    348348
    349 int rtR0MemObjNativeLockUser(PPRTR0MEMOBJINTERNAL ppMem, RTR3PTR R3Ptr, size_t cb, uint32_t fAccess, RTR0PROCESS R0Process)
    350 {
    351     return rtR0MemObjNativeLockInMap(ppMem, (void *)R3Ptr, cb, fAccess, R0Process, B_READ_DEVICE);
    352 }
    353 
    354 
    355 int rtR0MemObjNativeLockKernel(PPRTR0MEMOBJINTERNAL ppMem, void *pv, size_t cb, uint32_t fAccess)
    356 {
    357     return rtR0MemObjNativeLockInMap(ppMem, pv, cb, fAccess, NIL_RTR0PROCESS, B_READ_DEVICE);
     349int rtR0MemObjNativeLockUser(PPRTR0MEMOBJINTERNAL ppMem, RTR3PTR R3Ptr, size_t cb, uint32_t fAccess, RTR0PROCESS R0Process,
     350                             const char *pszTag)
     351{
     352    return rtR0MemObjNativeLockInMap(ppMem, (void *)R3Ptr, cb, fAccess, R0Process, B_READ_DEVICE, pszTag);
     353}
     354
     355
     356int rtR0MemObjNativeLockKernel(PPRTR0MEMOBJINTERNAL ppMem, void *pv, size_t cb, uint32_t fAccess, const char *pszTag)
     357{
     358    return rtR0MemObjNativeLockInMap(ppMem, pv, cb, fAccess, NIL_RTR0PROCESS, B_READ_DEVICE, pszTag);
    358359}
    359360
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