rtuDataOperation.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #ifndef _ASM_IA64_UACCESS_H
  2. #define _ASM_IA64_UACCESS_H
  3. /*
  4. * This file defines various macros to transfer memory areas across
  5. * the user/kernel boundary. This needs to be done carefully because
  6. * this code is executed in kernel mode and uses user-specified
  7. * addresses. Thus, we need to be careful not to let the user to
  8. * trick us into accessing kernel memory that would normally be
  9. * inaccessible. This code is also fairly performance sensitive,
  10. * so we want to spend as little time doing safety checks as
  11. * possible.
  12. *
  13. * To make matters a bit more interesting, these macros sometimes also
  14. * called from within the kernel itself, in which case the address
  15. * validity check must be skipped. The get_fs() macro tells us what
  16. * to do: if get_fs()==USER_DS, checking is performed, if
  17. * get_fs()==KERNEL_DS, checking is bypassed.
  18. *
  19. * Note that even if the memory area specified by the user is in a
  20. * valid address range, it is still possible that we'll get a page
  21. * fault while accessing it. This is handled by filling out an
  22. * exception handler fixup entry for each instruction that has the
  23. * potential to fault. When such a fault occurs, the page fault
  24. * handler checks to see whether the faulting instruction has a fixup
  25. * associated and, if so, sets r8 to -EFAULT and clears r9 to 0 and
  26. * then resumes execution at the continuation point.
  27. *
  28. * Based on <asm-alpha/uaccess.h>.
  29. *
  30. * Copyright (C) 1998, 1999, 2001-2004 Hewlett-Packard Co
  31. * David Mosberger-Tang <davidm@hpl.hp.com>
  32. */
  33. #include <linux/compiler.h>
  34. #include <linux/errno.h>
  35. #include <linux/sched.h>
  36. #include <linux/page-flags.h>
  37. #include <linux/mm.h>
  38. #include <asm/intrinsics.h>
  39. #include <asm/pgtable.h>
  40. #include <asm/io.h>
  41. /*
  42. * For historical reasons, the following macros are grossly misnamed:
  43. */