~ubuntu-branches/ubuntu/raring/virtualbox-ose/raring

« back to all changes in this revision

Viewing changes to include/iprt/mem.h

  • Committer: Bazaar Package Importer
  • Author(s): Felix Geyer
  • Date: 2009-12-18 16:44:29 UTC
  • mfrom: (0.3.3 upstream) (0.4.6 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091218164429-jd34ccexpv5na11a
Tags: 3.1.2-dfsg-1ubuntu1
* Merge from Debian unstable (LP: #498219), remaining changes:
  - Disable update action
    - debian/patches/u01-disable-update-action.dpatch
  - VirtualBox should go in Accessories, not in System tools (LP: #288590)
    - debian/virtualbox-ose-qt.files/virtualbox-ose.desktop
  - Add Apport hook
    - debian/virtualbox-ose.files/source_virtualbox-ose.py
    - debian/virtualbox-ose.install
  - Add Launchpad integration
    - debian/control
    - debian/lpi-bug.xpm
    - debian/patches/u02-lp-integration.dpatch
* Fixes the following bugs:
  - Kernel module fails to build with Linux >= 2.6.32 (LP: #474625)
  - X.Org drivers need to be rebuilt against X-Server 1.7 (LP: #495935)
  - The *-source packages try to build the kernel modules even though the
    kernel headers aren't available (LP: #473334)
* Replace *-source packages with transitional packages for *-dkms.
* Adapt u01-disable-update-action.dpatch and u02-lp-integration.dpatch for
  new upstream version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
257
257
 */
258
258
RTR0DECL(void) RTMemContFree(void *pv, size_t cb) RT_NO_THROW;
259
259
 
260
 
#endif
 
260
/**
 
261
 * Copy memory from an user mode buffer into a kernel buffer.
 
262
 *
 
263
 * @retval  VINF_SUCCESS on success.
 
264
 * @retval  VERR_ACCESS_DENIED on error.
 
265
 *
 
266
 * @param   pvDst       The kernel mode destination address.
 
267
 * @param   R3PtrDst    The user mode source address.
 
268
 * @param   cb          The number of bytes to copy.
 
269
 */
 
270
RTR0DECL(int) RTR0MemUserCopyFrom(void *pvDst, RTR3PTR R3PtrSrc, size_t cb);
 
271
 
 
272
/**
 
273
 * Copy memory from a kernel buffer into a user mode one.
 
274
 *
 
275
 * @retval  VINF_SUCCESS on success.
 
276
 * @retval  VERR_ACCESS_DENIED on error.
 
277
 *
 
278
 * @param   R3PtrDst    The user mode destination address.
 
279
 * @param   pvSrc       The kernel mode source address.
 
280
 * @param   cb          The number of bytes to copy.
 
281
 */
 
282
RTR0DECL(int) RTR0MemUserCopyTo(RTR3PTR R3PtrDst, void const *pvSrc, size_t cb);
 
283
 
 
284
/**
 
285
 * Tests if the specified address is in the user addressable range.
 
286
 *
 
287
 * This function does not check whether the memory at that address is accessible
 
288
 * or anything of that sort, only if the address it self is in the user mode
 
289
 * range.
 
290
 *
 
291
 * @returns true if it's in the user addressable range. false if not.
 
292
 * @param   R3Ptr       The user mode pointer to test.
 
293
 *
 
294
 * @remarks Some systems may have overlapping kernel and user address ranges.
 
295
 *          One prominent example of this is the x86 version of Mac OS X. Use
 
296
 *          RTR0MemAreKrnlAndUsrDifferent() to check.
 
297
 */
 
298
RTR0DECL(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. Use
 
312
 *          RTR0MemAreKrnlAndUsrDifferent() to check.
 
313
 */
 
314
RTR0DECL(bool) RTR0MemKernelIsValidAddr(void *pv);
 
315
 
 
316
/**
 
317
 * Are user mode and kernel mode address ranges distinctly different.
 
318
 *
 
319
 * This determins whether RTR0MemKernelIsValidAddr and RTR0MemUserIsValidAddr
 
320
 * can be used for deciding whether some arbitrary address is a user mode or a
 
321
 * kernel mode one.
 
322
 *
 
323
 * @returns true if they are, false if not.
 
324
 */
 
325
RTR0DECL(bool) RTR0MemAreKrnlAndUsrDifferent(void);
 
326
 
 
327
#endif /* IN_RING0 */
261
328
 
262
329
 
263
330
/** @name Electrical Fence Version of some APIs.