uaccess_64.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. #ifndef __ASM_SH_UACCESS_64_H
  2. #define __ASM_SH_UACCESS_64_H
  3. /*
  4. * include/asm-sh/uaccess_64.h
  5. *
  6. * Copyright (C) 2000, 2001 Paolo Alberelli
  7. * Copyright (C) 2003, 2004 Paul Mundt
  8. *
  9. * User space memory access functions
  10. *
  11. * Copyright (C) 1999 Niibe Yutaka
  12. *
  13. * Based on:
  14. * MIPS implementation version 1.15 by
  15. * Copyright (C) 1996, 1997, 1998 by Ralf Baechle
  16. * and i386 version.
  17. *
  18. * This file is subject to the terms and conditions of the GNU General Public
  19. * License. See the file "COPYING" in the main directory of this archive
  20. * for more details.
  21. */
  22. #define __get_user_size(x,ptr,size,retval) \
  23. do { \
  24. retval = 0; \
  25. x = 0; \
  26. switch (size) { \
  27. case 1: \
  28. retval = __get_user_asm_b((void *)&x, \
  29. (long)ptr); \
  30. break; \
  31. case 2: \
  32. retval = __get_user_asm_w((void *)&x, \
  33. (long)ptr); \
  34. break; \
  35. case 4: \
  36. retval = __get_user_asm_l((void *)&x, \
  37. (long)ptr); \
  38. break; \
  39. case 8: \
  40. retval = __get_user_asm_q((void *)&x, \
  41. (long)ptr); \
  42. break; \
  43. default: \
  44. __get_user_unknown(); \
  45. break; \
  46. } \
  47. } while (0)
  48. extern long __get_user_asm_b(void *, long);
  49. extern long __get_user_asm_w(void *, long);
  50. extern long __get_user_asm_l(void *, long);
  51. extern long __get_user_asm_q(void *, long);
  52. extern void __get_user_unknown(void);
  53. #define __put_user_size(x,ptr,size,retval) \
  54. do { \
  55. retval = 0; \
  56. switch (size) { \
  57. case 1: \
  58. retval = __put_user_asm_b((void *)&x, \
  59. (__force long)ptr); \
  60. break; \
  61. case 2: \
  62. retval = __put_user_asm_w((void *)&x, \
  63. (__force long)ptr); \
  64. break; \
  65. case 4: \
  66. retval = __put_user_asm_l((void *)&x, \
  67. (__force long)ptr); \
  68. break; \
  69. case 8: \
  70. retval = __put_user_asm_q((void *)&x, \
  71. (__force long)ptr); \
  72. break; \
  73. default: \
  74. __put_user_unknown(); \
  75. } \
  76. } while (0)
  77. extern long __put_user_asm_b(void *, long);
  78. extern long __put_user_asm_w(void *, long);
  79. extern long __put_user_asm_l(void *, long);
  80. extern long __put_user_asm_q(void *, long);
  81. extern void __put_user_unknown(void);
  82. #endif /* __ASM_SH_UACCESS_64_H */