NGcopy_to_user.S 784 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /* NGcopy_to_user.S: Niagara optimized copy to userspace.
  3. *
  4. * Copyright (C) 2006, 2007 David S. Miller (davem@davemloft.net)
  5. */
  6. #define EX_ST(x,y) \
  7. 98: x; \
  8. .section __ex_table,"a";\
  9. .align 4; \
  10. .word 98b, y; \
  11. .text; \
  12. .align 4;
  13. #ifndef ASI_AIUS
  14. #define ASI_AIUS 0x11
  15. #endif
  16. #define FUNC_NAME NGcopy_to_user
  17. #define STORE(type,src,addr) type##a src, [addr] ASI_AIUS
  18. #define STORE_ASI ASI_BLK_INIT_QUAD_LDD_AIUS
  19. #define EX_RETVAL(x) %g0
  20. #ifdef __KERNEL__
  21. /* Writing to %asi is _expensive_ so we hardcode it.
  22. * Reading %asi to check for KERNEL_DS is comparatively
  23. * cheap.
  24. */
  25. #define PREAMBLE \
  26. rd %asi, %g1; \
  27. cmp %g1, ASI_AIUS; \
  28. bne,pn %icc, raw_copy_in_user; \
  29. nop
  30. #endif
  31. #include "NGmemcpy.S"