GENcopy_to_user.S 757 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /* GENcopy_to_user.S: Generic sparc64 copy to userspace.
  2. *
  3. * Copyright (C) 2007 David S. Miller (davem@davemloft.net)
  4. */
  5. #define EX_ST(x) \
  6. 98: x; \
  7. .section .fixup; \
  8. .align 4; \
  9. 99: retl; \
  10. mov 1, %o0; \
  11. .section __ex_table,"a";\
  12. .align 4; \
  13. .word 98b, 99b; \
  14. .text; \
  15. .align 4;
  16. #ifndef ASI_AIUS
  17. #define ASI_AIUS 0x11
  18. #endif
  19. #define FUNC_NAME GENcopy_to_user
  20. #define STORE(type,src,addr) type##a src, [addr] ASI_AIUS
  21. #define EX_RETVAL(x) 0
  22. #ifdef __KERNEL__
  23. /* Writing to %asi is _expensive_ so we hardcode it.
  24. * Reading %asi to check for KERNEL_DS is comparatively
  25. * cheap.
  26. */
  27. #define PREAMBLE \
  28. rd %asi, %g1; \
  29. cmp %g1, ASI_AIUS; \
  30. bne,pn %icc, memcpy_user_stub; \
  31. nop
  32. #endif
  33. #include "GENmemcpy.S"