NG2copy_to_user.S 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /* NG2copy_to_user.S: Niagara-2 optimized copy to userspace.
  2. *
  3. * Copyright (C) 2007 David S. Miller (davem@davemloft.net)
  4. */
  5. #define EX_ST(x) \
  6. 98: x; \
  7. .section .fixup; \
  8. .align 4; \
  9. 99: wr %g0, ASI_AIUS, %asi;\
  10. retl; \
  11. mov 1, %o0; \
  12. .section __ex_table,"a";\
  13. .align 4; \
  14. .word 98b, 99b; \
  15. .text; \
  16. .align 4;
  17. #ifndef ASI_AIUS
  18. #define ASI_AIUS 0x11
  19. #endif
  20. #ifndef ASI_BLK_AIUS_4V
  21. #define ASI_BLK_AIUS_4V 0x17
  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 NG2copy_to_user
  27. #define STORE(type,src,addr) type##a src, [addr] ASI_AIUS
  28. #define STORE_ASI ASI_BLK_INIT_QUAD_LDD_AIUS
  29. #define STORE_BLK(src,addr) stda src, [addr] ASI_BLK_AIUS_4V
  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, memcpy_user_stub; \
  40. nop
  41. #endif
  42. #include "NG2memcpy.S"