NG4copy_to_user.S 943 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /* NG4copy_to_user.S: Niagara-4 optimized copy to userspace.
  2. *
  3. * Copyright (C) 2012 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. #define EX_ST_FP(x,y) \
  13. 98: x; \
  14. .section __ex_table,"a";\
  15. .align 4; \
  16. .word 98b, y##_fp; \
  17. .text; \
  18. .align 4;
  19. #ifndef ASI_AIUS
  20. #define ASI_AIUS 0x11
  21. #endif
  22. #ifndef ASI_BLK_INIT_QUAD_LDD_AIUS
  23. #define ASI_BLK_INIT_QUAD_LDD_AIUS 0x23
  24. #endif
  25. #define FUNC_NAME NG4copy_to_user
  26. #define STORE(type,src,addr) type##a src, [addr] %asi
  27. #define STORE_ASI ASI_BLK_INIT_QUAD_LDD_AIUS
  28. #define EX_RETVAL(x) 0
  29. #ifdef __KERNEL__
  30. /* Writing to %asi is _expensive_ so we hardcode it.
  31. * Reading %asi to check for KERNEL_DS is comparatively
  32. * cheap.
  33. */
  34. #define PREAMBLE \
  35. rd %asi, %g1; \
  36. cmp %g1, ASI_AIUS; \
  37. bne,pn %icc, ___copy_in_user; \
  38. nop
  39. #endif
  40. #include "NG4memcpy.S"