U1copy_to_user.S 776 B

123456789101112131415161718192021222324252627282930313233
  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 .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. #define FUNC_NAME ___copy_to_user
  17. #define STORE(type,src,addr) type##a src, [addr] ASI_AIUS
  18. #define STORE_BLK(src,addr) stda src, [addr] ASI_BLK_AIUS
  19. #define EX_RETVAL(x) 0
  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, memcpy_user_stub; \
  28. nop; \
  29. #include "U1memcpy.S"