Changeset 91482 in vbox for trunk/src/VBox/Runtime/r0drv/haiku/memobj-r0drv-haiku.c
- Timestamp:
- Sep 30, 2021 12:12:26 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r0drv/haiku/memobj-r0drv-haiku.c
r91481 r91482 308 308 * 309 309 * @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. 318 319 */ 319 320 static 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) 321 322 { 322 323 NOREF(fAccess); 323 int rc;324 324 team_id TeamId = B_SYSTEM_TEAM; 325 325 … … 328 328 329 329 /* 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); 331 331 if (RT_UNLIKELY(!pMemHaiku)) 332 332 return VERR_NO_MEMORY; … … 334 334 if (R0Process != NIL_RTR0PROCESS) 335 335 TeamId = (team_id)R0Process; 336 rc = lock_memory_etc(TeamId, pvStart, cb, fFlags);336 int rc = lock_memory_etc(TeamId, pvStart, cb, fFlags); 337 337 if (rc == B_OK) 338 338 { … … 347 347 348 348 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); 349 int 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 356 int 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); 358 359 } 359 360
Note:
See TracChangeset
for help on using the changeset viewer.