hvCall.S 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /*
  2. * This file contains the generic code to perform a call to the
  3. * pSeries LPAR hypervisor.
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public License
  7. * as published by the Free Software Foundation; either version
  8. * 2 of the License, or (at your option) any later version.
  9. */
  10. #include <asm/hvcall.h>
  11. #include <asm/processor.h>
  12. #include <asm/ppc_asm.h>
  13. #define STK_PARM(i) (48 + ((i)-3)*8)
  14. .text
  15. _GLOBAL(plpar_hcall_norets)
  16. HMT_MEDIUM
  17. mfcr r0
  18. stw r0,8(r1)
  19. HVSC /* invoke the hypervisor */
  20. lwz r0,8(r1)
  21. mtcrf 0xff,r0
  22. blr /* return r3 = status */
  23. _GLOBAL(plpar_hcall)
  24. HMT_MEDIUM
  25. mfcr r0
  26. stw r0,8(r1)
  27. std r4,STK_PARM(r4)(r1) /* Save ret buffer */
  28. mr r4,r5
  29. mr r5,r6
  30. mr r6,r7
  31. mr r7,r8
  32. mr r8,r9
  33. mr r9,r10
  34. HVSC /* invoke the hypervisor */
  35. ld r12,STK_PARM(r4)(r1)
  36. std r4, 0(r12)
  37. std r5, 8(r12)
  38. std r6, 16(r12)
  39. std r7, 24(r12)
  40. lwz r0,8(r1)
  41. mtcrf 0xff,r0
  42. blr /* return r3 = status */
  43. _GLOBAL(plpar_hcall9)
  44. HMT_MEDIUM
  45. mfcr r0
  46. stw r0,8(r1)
  47. std r4,STK_PARM(r4)(r1) /* Save ret buffer */
  48. mr r4,r5
  49. mr r5,r6
  50. mr r6,r7
  51. mr r7,r8
  52. mr r8,r9
  53. mr r9,r10
  54. ld r10,STK_PARM(r11)(r1) /* put arg7 in R10 */
  55. ld r11,STK_PARM(r12)(r1) /* put arg8 in R11 */
  56. ld r12,STK_PARM(r13)(r1) /* put arg9 in R12 */
  57. HVSC /* invoke the hypervisor */
  58. ld r12,STK_PARM(r4)(r1)
  59. std r4, 0(r12)
  60. std r5, 8(r12)
  61. std r6, 16(r12)
  62. std r7, 24(r12)
  63. std r8, 32(r12)
  64. std r9, 40(r12)
  65. std r10,48(r12)
  66. std r11,56(r12)
  67. std r12,64(r12)
  68. lwz r0,8(r1)
  69. mtcrf 0xff,r0
  70. blr /* return r3 = status */