getuser.S 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /*
  2. * __get_user functions.
  3. *
  4. * (C) Copyright 2001 Hirokazu Takata
  5. *
  6. * These functions have a non-standard call interface
  7. * to make them more efficient, especially as they
  8. * return an error value in addition to the "real"
  9. * return value.
  10. */
  11. #include <linux/config.h>
  12. /*
  13. * __get_user_X
  14. *
  15. * Inputs: r0 contains the address
  16. *
  17. * Outputs: r0 is error code (0 or -EFAULT)
  18. * r1 contains zero-extended value
  19. *
  20. * These functions should not modify any other registers,
  21. * as they get called from within inline assembly.
  22. */
  23. #ifdef CONFIG_ISA_DUAL_ISSUE
  24. .text
  25. .balign 4
  26. .globl __get_user_1
  27. __get_user_1:
  28. 1: ldub r1, @r0 || ldi r0, #0
  29. jmp r14
  30. .balign 4
  31. .globl __get_user_2
  32. __get_user_2:
  33. 2: lduh r1, @r0 || ldi r0, #0
  34. jmp r14
  35. .balign 4
  36. .globl __get_user_4
  37. __get_user_4:
  38. 3: ld r1, @r0 || ldi r0, #0
  39. jmp r14
  40. bad_get_user:
  41. ldi r1, #0 || ldi r0, #-14
  42. jmp r14
  43. #else /* not CONFIG_ISA_DUAL_ISSUE */
  44. .text
  45. .balign 4
  46. .globl __get_user_1
  47. __get_user_1:
  48. 1: ldub r1, @r0
  49. ldi r0, #0
  50. jmp r14
  51. .balign 4
  52. .globl __get_user_2
  53. __get_user_2:
  54. 2: lduh r1, @r0
  55. ldi r0, #0
  56. jmp r14
  57. .balign 4
  58. .globl __get_user_4
  59. __get_user_4:
  60. 3: ld r1, @r0
  61. ldi r0, #0
  62. jmp r14
  63. bad_get_user:
  64. ldi r1, #0
  65. ldi r0, #-14
  66. jmp r14
  67. #endif /* not CONFIG_ISA_DUAL_ISSUE */
  68. .section __ex_table,"a"
  69. .long 1b,bad_get_user
  70. .long 2b,bad_get_user
  71. .long 3b,bad_get_user
  72. .previous
  73. .end