GENcopy_to_user.S 691 B

1234567891011121314151617181920212223242526272829303132333435
  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,y) \
  6. 98: x; \
  7. .section __ex_table,"a";\
  8. .align 4; \
  9. .word 98b, y; \
  10. .text; \
  11. .align 4;
  12. #ifndef ASI_AIUS
  13. #define ASI_AIUS 0x11
  14. #endif
  15. #define FUNC_NAME GENcopy_to_user
  16. #define STORE(type,src,addr) type##a src, [addr] ASI_AIUS
  17. #define EX_RETVAL(x) 0
  18. #ifdef __KERNEL__
  19. /* Writing to %asi is _expensive_ so we hardcode it.
  20. * Reading %asi to check for KERNEL_DS is comparatively
  21. * cheap.
  22. */
  23. #define PREAMBLE \
  24. rd %asi, %g1; \
  25. cmp %g1, ASI_AIUS; \
  26. bne,pn %icc, ___copy_in_user; \
  27. nop
  28. #endif
  29. #include "GENmemcpy.S"