VirtualBox

Changeset 21265 in vbox for trunk/include


Ignore:
Timestamp:
Jul 6, 2009 6:31:49 PM (16 years ago)
Author:
vboxsync
Message:

iprt/mem.h: Added APIs for basic user mode memory handling from ring-0.

File:
1 edited

Legend:

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

    r20374 r21265  
    258258RTR0DECL(void) RTMemContFree(void *pv, size_t cb) RT_NO_THROW;
    259259
    260 #endif
     260
     261/**
     262 * Copy memory from an user mode buffer into a kernel buffer.
     263 *
     264 * @retval  VINF_SUCCESS on success.
     265 * @retval  VERR_ACCESS_DENIED on error.
     266 *
     267 * @param   pvDst       The kernel mode destination address.
     268 * @param   R3PtrDst    The user mode source address.
     269 * @param   cb          The number of bytes to copy.
     270 */
     271RTR0DECL(int) RTR0MemUserCopyFrom(void *pvDst, RTR3PTR R3PtrSrc, size_t cb);
     272
     273/**
     274 * Copy memory from a kernel buffer into a user mode one.
     275 *
     276 * @retval  VINF_SUCCESS on success.
     277 * @retval  VERR_ACCESS_DENIED on error.
     278 *
     279 * @param   R3PtrDst    The user mode destination address.
     280 * @param   pvSrc       The kernel mode source address.
     281 * @param   cb          The number of bytes to copy.
     282 */
     283RTR0DECL(int) RTR0MemUserCopyTo(RTR3PTR R3PtrDst, void const *pvSrc, size_t cb);
     284
     285/**
     286 * Tests if the specified address is in the user addressable range.
     287 *
     288 * This function does not check whether the memory at that address is accessible
     289 * or anything of that sort, only if the address it self is in the user mode
     290 * range.
     291 *
     292 * @returns true if it's in the user addressable range. false if not.
     293 * @param   R3Ptr       The user mode pointer to test.
     294 *
     295 * @remarks Some systems may have overlapping kernel and user address ranges.
     296 *          One prominent example of this is the x86 version of Mac OS X.
     297 */
     298RTR0DECL(bool) RTR0MemUserIsValidAddr(RTR3PTR R3Ptr);
     299
     300/**
     301 * Tests if the specified address is in the kernel mode range.
     302 *
     303 * This function does not check whether the memory at that address is accessible
     304 * or anything of that sort, only if the address it self is in the kernel mode
     305 * range.
     306 *
     307 * @returns true if it's in the kernel range. false if not.
     308 * @param   pv          The alleged kernel mode pointer.
     309 *
     310 * @remarks Some systems may have overlapping kernel and user address ranges.
     311 *          One prominent example of this is the x86 version of Mac OS X.
     312 */
     313RTR0DECL(bool) RTR0MemKernelIsValidAddr(void *pv);
     314
     315#endif /* IN_RING0 */
    261316
    262317
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