NG4copy_to_user.S 829 B

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