hvcall.S 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /*
  2. * This file contains the code to perform calls to the
  3. * iSeries 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/ppc_asm.h>
  11. #include <asm/processor.h>
  12. .text
  13. /*
  14. * Hypervisor call
  15. *
  16. * Invoke the iSeries hypervisor via the System Call instruction
  17. * Parameters are passed to this routine in registers r3 - r10
  18. *
  19. * r3 contains the HV function to be called
  20. * r4-r10 contain the operands to the hypervisor function
  21. *
  22. */
  23. _GLOBAL(HvCall)
  24. _GLOBAL(HvCall0)
  25. _GLOBAL(HvCall1)
  26. _GLOBAL(HvCall2)
  27. _GLOBAL(HvCall3)
  28. _GLOBAL(HvCall4)
  29. _GLOBAL(HvCall5)
  30. _GLOBAL(HvCall6)
  31. _GLOBAL(HvCall7)
  32. mfcr r0
  33. std r0,-8(r1)
  34. stdu r1,-(STACK_FRAME_OVERHEAD+16)(r1)
  35. /* r0 = 0xffffffffffffffff indicates a hypervisor call */
  36. li r0,-1
  37. /* Invoke the hypervisor */
  38. sc
  39. ld r1,0(r1)
  40. ld r0,-8(r1)
  41. mtcrf 0xff,r0
  42. /* return to caller, return value in r3 */
  43. blr
  44. _GLOBAL(HvCall0Ret16)
  45. _GLOBAL(HvCall1Ret16)
  46. _GLOBAL(HvCall2Ret16)
  47. _GLOBAL(HvCall3Ret16)
  48. _GLOBAL(HvCall4Ret16)
  49. _GLOBAL(HvCall5Ret16)
  50. _GLOBAL(HvCall6Ret16)
  51. _GLOBAL(HvCall7Ret16)
  52. mfcr r0
  53. std r0,-8(r1)
  54. std r31,-16(r1)
  55. stdu r1,-(STACK_FRAME_OVERHEAD+32)(r1)
  56. mr r31,r4
  57. li r0,-1
  58. mr r4,r5
  59. mr r5,r6
  60. mr r6,r7
  61. mr r7,r8
  62. mr r8,r9
  63. mr r9,r10
  64. sc
  65. std r3,0(r31)
  66. std r4,8(r31)
  67. mr r3,r5
  68. ld r1,0(r1)
  69. ld r0,-8(r1)
  70. mtcrf 0xff,r0
  71. ld r31,-16(r1)
  72. blr