NGcopy_to_user.S 828 B

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