U1copy_from_user.S 874 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /* U1copy_from_user.S: UltraSparc-I/II/IIi/IIe optimized copy from userspace.
  3. *
  4. * Copyright (C) 1999, 2000, 2004 David S. Miller (davem@redhat.com)
  5. */
  6. #define EX_LD(x,y) \
  7. 98: x; \
  8. .section __ex_table,"a";\
  9. .align 4; \
  10. .word 98b, y; \
  11. .text; \
  12. .align 4;
  13. #define EX_LD_FP(x,y) \
  14. 98: x; \
  15. .section __ex_table,"a";\
  16. .align 4; \
  17. .word 98b, y; \
  18. .text; \
  19. .align 4;
  20. #define FUNC_NAME raw_copy_from_user
  21. #define LOAD(type,addr,dest) type##a [addr] %asi, dest
  22. #define LOAD_BLK(addr,dest) ldda [addr] ASI_BLK_AIUS, dest
  23. #define EX_RETVAL(x) 0
  24. /* Writing to %asi is _expensive_ so we hardcode it.
  25. * Reading %asi to check for KERNEL_DS is comparatively
  26. * cheap.
  27. */
  28. #define PREAMBLE \
  29. rd %asi, %g1; \
  30. cmp %g1, ASI_AIUS; \
  31. bne,pn %icc, raw_copy_in_user; \
  32. nop; \
  33. #include "U1memcpy.S"