quad.S 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * Quadword loads and stores
  4. * for use in instruction emulation.
  5. *
  6. * Copyright 2017 Paul Mackerras, IBM Corp. <[email protected]>
  7. */
  8. #include <asm/processor.h>
  9. #include <asm/ppc_asm.h>
  10. #include <asm/ppc-opcode.h>
  11. #include <asm/reg.h>
  12. #include <asm/asm-offsets.h>
  13. #include <linux/errno.h>
  14. /* do_lq(unsigned long ea, unsigned long *regs) */
  15. _GLOBAL(do_lq)
  16. 1: lq r6, 0(r3)
  17. std r6, 0(r4)
  18. std r7, 8(r4)
  19. li r3, 0
  20. blr
  21. 2: li r3, -EFAULT
  22. blr
  23. EX_TABLE(1b, 2b)
  24. /* do_stq(unsigned long ea, unsigned long val0, unsigned long val1) */
  25. _GLOBAL(do_stq)
  26. 1: stq r4, 0(r3)
  27. li r3, 0
  28. blr
  29. 2: li r3, -EFAULT
  30. blr
  31. EX_TABLE(1b, 2b)
  32. /* do_lqarx(unsigned long ea, unsigned long *regs) */
  33. _GLOBAL(do_lqarx)
  34. 1: PPC_LQARX(6, 0, 3, 0)
  35. std r6, 0(r4)
  36. std r7, 8(r4)
  37. li r3, 0
  38. blr
  39. 2: li r3, -EFAULT
  40. blr
  41. EX_TABLE(1b, 2b)
  42. /* do_stqcx(unsigned long ea, unsigned long val0, unsigned long val1,
  43. unsigned int *crp) */
  44. _GLOBAL(do_stqcx)
  45. 1: PPC_STQCX(4, 0, 3)
  46. mfcr r5
  47. stw r5, 0(r6)
  48. li r3, 0
  49. blr
  50. 2: li r3, -EFAULT
  51. blr
  52. EX_TABLE(1b, 2b)