M7copy_to_user.S 1017 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * M7copy_to_user.S: SPARC M7 optimized copy to userspace.
  3. *
  4. * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
  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. #define EX_ST_FP(x, y) \
  14. 98: x; \
  15. .section __ex_table,"a"; \
  16. .align 4; \
  17. .word 98b, y##_fp; \
  18. .text; \
  19. .align 4;
  20. #ifndef ASI_AIUS
  21. #define ASI_AIUS 0x11
  22. #endif
  23. #ifndef ASI_BLK_INIT_QUAD_LDD_AIUS
  24. #define ASI_BLK_INIT_QUAD_LDD_AIUS 0x23
  25. #endif
  26. #define FUNC_NAME M7copy_to_user
  27. #define STORE(type,src,addr) type##a src, [addr] %asi
  28. #define STORE_ASI ASI_BLK_INIT_QUAD_LDD_AIUS
  29. #define STORE_MRU_ASI ASI_ST_BLKINIT_MRU_S
  30. #define EX_RETVAL(x) 0
  31. #ifdef __KERNEL__
  32. /* Writing to %asi is _expensive_ so we hardcode it.
  33. * Reading %asi to check for KERNEL_DS is comparatively
  34. * cheap.
  35. */
  36. #define PREAMBLE \
  37. rd %asi, %g1; \
  38. cmp %g1, ASI_AIUS; \
  39. bne,pn %icc, raw_copy_in_user; \
  40. nop
  41. #endif
  42. #include "M7memcpy.S"