U1copy_to_user.S 716 B

123456789101112131415161718192021222324252627282930
  1. /* U1copy_to_user.S: UltraSparc-I/II/IIi/IIe optimized copy to userspace.
  2. *
  3. * Copyright (C) 1999, 2000, 2004 David S. Miller (davem@redhat.com)
  4. */
  5. #define EX_ST(x) \
  6. 98: x; \
  7. .section __ex_table,"a";\
  8. .align 4; \
  9. .word 98b, __retl_one; \
  10. .text; \
  11. .align 4;
  12. #define FUNC_NAME ___copy_to_user
  13. #define STORE(type,src,addr) type##a src, [addr] ASI_AIUS
  14. #define STORE_BLK(src,addr) stda src, [addr] ASI_BLK_AIUS
  15. #define EX_RETVAL(x) 0
  16. /* Writing to %asi is _expensive_ so we hardcode it.
  17. * Reading %asi to check for KERNEL_DS is comparatively
  18. * cheap.
  19. */
  20. #define PREAMBLE \
  21. rd %asi, %g1; \
  22. cmp %g1, ASI_AIUS; \
  23. bne,pn %icc, ___copy_in_user; \
  24. nop; \
  25. #include "U1memcpy.S"