NG2copy_to_user.S 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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,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_AIUS_4V
  23. #define ASI_BLK_AIUS_4V 0x17
  24. #endif
  25. #ifndef ASI_BLK_INIT_QUAD_LDD_AIUS
  26. #define ASI_BLK_INIT_QUAD_LDD_AIUS 0x23
  27. #endif
  28. #define FUNC_NAME NG2copy_to_user
  29. #define STORE(type,src,addr) type##a src, [addr] ASI_AIUS
  30. #define STORE_ASI ASI_BLK_INIT_QUAD_LDD_AIUS
  31. #define STORE_BLK(src,addr) stda src, [addr] ASI_BLK_AIUS_4V
  32. #define EX_RETVAL(x) 0
  33. #ifdef __KERNEL__
  34. /* Writing to %asi is _expensive_ so we hardcode it.
  35. * Reading %asi to check for KERNEL_DS is comparatively
  36. * cheap.
  37. */
  38. #define PREAMBLE \
  39. rd %asi, %g1; \
  40. cmp %g1, ASI_AIUS; \
  41. bne,pn %icc, ___copy_in_user; \
  42. nop
  43. #endif
  44. #include "NG2memcpy.S"