hvCall.S 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /*
  2. * arch/ppc64/kernel/hvCall.S
  3. *
  4. *
  5. * This file contains the code to perform calls to the
  6. * iSeries LPAR hypervisor
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License
  10. * as published by the Free Software Foundation; either version
  11. * 2 of the License, or (at your option) any later version.
  12. */
  13. #include <asm/ppc_asm.h>
  14. #include <asm/processor.h>
  15. .text
  16. /*
  17. * Hypervisor call
  18. *
  19. * Invoke the iSeries hypervisor via the System Call instruction
  20. * Parameters are passed to this routine in registers r3 - r10
  21. *
  22. * r3 contains the HV function to be called
  23. * r4-r10 contain the operands to the hypervisor function
  24. *
  25. */
  26. _GLOBAL(HvCall)
  27. _GLOBAL(HvCall0)
  28. _GLOBAL(HvCall1)
  29. _GLOBAL(HvCall2)
  30. _GLOBAL(HvCall3)
  31. _GLOBAL(HvCall4)
  32. _GLOBAL(HvCall5)
  33. _GLOBAL(HvCall6)
  34. _GLOBAL(HvCall7)
  35. mfcr r0
  36. std r0,-8(r1)
  37. stdu r1,-(STACK_FRAME_OVERHEAD+16)(r1)
  38. /* r0 = 0xffffffffffffffff indicates a hypervisor call */
  39. li r0,-1
  40. /* Invoke the hypervisor */
  41. sc
  42. ld r1,0(r1)
  43. ld r0,-8(r1)
  44. mtcrf 0xff,r0
  45. /* return to caller, return value in r3 */
  46. blr
  47. _GLOBAL(HvCall0Ret16)
  48. _GLOBAL(HvCall1Ret16)
  49. _GLOBAL(HvCall2Ret16)
  50. _GLOBAL(HvCall3Ret16)
  51. _GLOBAL(HvCall4Ret16)
  52. _GLOBAL(HvCall5Ret16)
  53. _GLOBAL(HvCall6Ret16)
  54. _GLOBAL(HvCall7Ret16)
  55. mfcr r0
  56. std r0,-8(r1)
  57. std r31,-16(r1)
  58. stdu r1,-(STACK_FRAME_OVERHEAD+32)(r1)
  59. mr r31,r4
  60. li r0,-1
  61. mr r4,r5
  62. mr r5,r6
  63. mr r6,r7
  64. mr r7,r8
  65. mr r8,r9
  66. mr r9,r10
  67. sc
  68. std r3,0(r31)
  69. std r4,8(r31)
  70. mr r3,r5
  71. ld r1,0(r1)
  72. ld r0,-8(r1)
  73. mtcrf 0xff,r0
  74. ld r31,-16(r1)
  75. blr