NGcopy_to_user.S 744 B

1234567891011121314151617181920212223242526272829303132333435
  1. /* NGcopy_to_user.S: Niagara optimized copy to userspace.
  2. *
  3. * Copyright (C) 2006, 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. #ifndef ASI_AIUS
  13. #define ASI_AIUS 0x11
  14. #endif
  15. #define FUNC_NAME NGcopy_to_user
  16. #define STORE(type,src,addr) type##a src, [addr] ASI_AIUS
  17. #define STORE_ASI ASI_BLK_INIT_QUAD_LDD_AIUS
  18. #define EX_RETVAL(x) %g0
  19. #ifdef __KERNEL__
  20. /* Writing to %asi is _expensive_ so we hardcode it.
  21. * Reading %asi to check for KERNEL_DS is comparatively
  22. * cheap.
  23. */
  24. #define PREAMBLE \
  25. rd %asi, %g1; \
  26. cmp %g1, ASI_AIUS; \
  27. bne,pn %icc, ___copy_in_user; \
  28. nop
  29. #endif
  30. #include "NGmemcpy.S"