quad.S 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * Quadword loads and stores
  3. * for use in instruction emulation.
  4. *
  5. * Copyright 2017 Paul Mackerras, IBM Corp. <paulus@au1.ibm.com>
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License
  9. * as published by the Free Software Foundation; either version
  10. * 2 of the License, or (at your option) any later version.
  11. */
  12. #include <asm/processor.h>
  13. #include <asm/ppc_asm.h>
  14. #include <asm/ppc-opcode.h>
  15. #include <asm/reg.h>
  16. #include <asm/asm-offsets.h>
  17. #include <linux/errno.h>
  18. /* do_lq(unsigned long ea, unsigned long *regs) */
  19. _GLOBAL(do_lq)
  20. 1: lq r6, 0(r3)
  21. std r6, 0(r4)
  22. std r7, 8(r4)
  23. li r3, 0
  24. blr
  25. 2: li r3, -EFAULT
  26. blr
  27. EX_TABLE(1b, 2b)
  28. /* do_stq(unsigned long ea, unsigned long val0, unsigned long val1) */
  29. _GLOBAL(do_stq)
  30. 1: stq r4, 0(r3)
  31. li r3, 0
  32. blr
  33. 2: li r3, -EFAULT
  34. blr
  35. EX_TABLE(1b, 2b)
  36. /* do_lqarx(unsigned long ea, unsigned long *regs) */
  37. _GLOBAL(do_lqarx)
  38. 1: PPC_LQARX(6, 0, 3, 0)
  39. std r6, 0(r4)
  40. std r7, 8(r4)
  41. li r3, 0
  42. blr
  43. 2: li r3, -EFAULT
  44. blr
  45. EX_TABLE(1b, 2b)
  46. /* do_stqcx(unsigned long ea, unsigned long val0, unsigned long val1,
  47. unsigned int *crp) */
  48. _GLOBAL(do_stqcx)
  49. 1: PPC_STQCX(4, 0, 3)
  50. mfcr r5
  51. stw r5, 0(r6)
  52. li r3, 0
  53. blr
  54. 2: li r3, -EFAULT
  55. blr
  56. EX_TABLE(1b, 2b)