NG2copy_to_user.S 955 B

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