HvCallHpt.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. /*
  2. * HvCallHpt.h
  3. * Copyright (C) 2001 Mike Corrigan IBM Corporation
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; if not, write to the Free Software
  17. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  18. */
  19. #ifndef _HVCALLHPT_H
  20. #define _HVCALLHPT_H
  21. /*
  22. * This file contains the "hypervisor call" interface which is used to
  23. * drive the hypervisor from the OS.
  24. */
  25. #include <asm/iSeries/HvCallSc.h>
  26. #include <asm/iSeries/HvTypes.h>
  27. #include <asm/mmu.h>
  28. #define HvCallHptGetHptAddress HvCallHpt + 0
  29. #define HvCallHptGetHptPages HvCallHpt + 1
  30. #define HvCallHptSetPp HvCallHpt + 5
  31. #define HvCallHptSetSwBits HvCallHpt + 6
  32. #define HvCallHptUpdate HvCallHpt + 7
  33. #define HvCallHptInvalidateNoSyncICache HvCallHpt + 8
  34. #define HvCallHptGet HvCallHpt + 11
  35. #define HvCallHptFindNextValid HvCallHpt + 12
  36. #define HvCallHptFindValid HvCallHpt + 13
  37. #define HvCallHptAddValidate HvCallHpt + 16
  38. #define HvCallHptInvalidateSetSwBitsGet HvCallHpt + 18
  39. static inline u64 HvCallHpt_getHptAddress(void)
  40. {
  41. u64 retval = HvCall0(HvCallHptGetHptAddress);
  42. // getPaca()->adjustHmtForNoOfSpinLocksHeld();
  43. return retval;
  44. }
  45. static inline u64 HvCallHpt_getHptPages(void)
  46. {
  47. u64 retval = HvCall0(HvCallHptGetHptPages);
  48. // getPaca()->adjustHmtForNoOfSpinLocksHeld();
  49. return retval;
  50. }
  51. static inline void HvCallHpt_setPp(u32 hpteIndex, u8 value)
  52. {
  53. HvCall2(HvCallHptSetPp, hpteIndex, value);
  54. // getPaca()->adjustHmtForNoOfSpinLocksHeld();
  55. }
  56. static inline void HvCallHpt_setSwBits(u32 hpteIndex, u8 bitson, u8 bitsoff)
  57. {
  58. HvCall3(HvCallHptSetSwBits, hpteIndex, bitson, bitsoff);
  59. // getPaca()->adjustHmtForNoOfSpinLocksHeld();
  60. }
  61. static inline void HvCallHpt_invalidateNoSyncICache(u32 hpteIndex)
  62. {
  63. HvCall1(HvCallHptInvalidateNoSyncICache, hpteIndex);
  64. // getPaca()->adjustHmtForNoOfSpinLocksHeld();
  65. }
  66. static inline u64 HvCallHpt_invalidateSetSwBitsGet(u32 hpteIndex, u8 bitson,
  67. u8 bitsoff)
  68. {
  69. u64 compressedStatus;
  70. compressedStatus = HvCall4(HvCallHptInvalidateSetSwBitsGet,
  71. hpteIndex, bitson, bitsoff, 1);
  72. HvCall1(HvCallHptInvalidateNoSyncICache, hpteIndex);
  73. // getPaca()->adjustHmtForNoOfSpinLocksHeld();
  74. return compressedStatus;
  75. }
  76. static inline u64 HvCallHpt_findValid(HPTE *hpte, u64 vpn)
  77. {
  78. u64 retIndex = HvCall3Ret16( HvCallHptFindValid, hpte, vpn, 0, 0 );
  79. // getPaca()->adjustHmtForNoOfSpinLocksHeld();
  80. return retIndex;
  81. }
  82. static inline u64 HvCallHpt_findNextValid(HPTE *hpte, u32 hpteIndex,
  83. u8 bitson, u8 bitsoff)
  84. {
  85. u64 retIndex = HvCall3Ret16( HvCallHptFindNextValid, hpte, hpteIndex, bitson, bitsoff );
  86. // getPaca()->adjustHmtForNoOfSpinLocksHeld();
  87. return retIndex;
  88. }
  89. static inline void HvCallHpt_get(HPTE *hpte, u32 hpteIndex)
  90. {
  91. HvCall2Ret16(HvCallHptGet, hpte, hpteIndex, 0);
  92. // getPaca()->adjustHmtForNoOfSpinLocksHeld();
  93. }
  94. static inline void HvCallHpt_addValidate(u32 hpteIndex, u32 hBit, HPTE *hpte)
  95. {
  96. HvCall4(HvCallHptAddValidate, hpteIndex, hBit, (*((u64 *)hpte)),
  97. (*(((u64 *)hpte)+1)));
  98. // getPaca()->adjustHmtForNoOfSpinLocksHeld();
  99. }
  100. #endif /* _HVCALLHPT_H */