GENcopy_to_user.S 731 B

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