hv_call.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. /*
  2. * Copyright (C) 2001 Mike Corrigan IBM Corporation
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  17. *
  18. * This file contains the "hypervisor call" interface which is used to
  19. * drive the hypervisor from the OS.
  20. */
  21. #ifndef _ASM_POWERPC_ISERIES_HV_CALL_H
  22. #define _ASM_POWERPC_ISERIES_HV_CALL_H
  23. #include <asm/iseries/hv_call_sc.h>
  24. #include <asm/iseries/hv_types.h>
  25. #include <asm/paca.h>
  26. /* Type of yield for HvCallBaseYieldProcessor */
  27. #define HvCall_YieldTimed 0 /* Yield until specified time (tb) */
  28. #define HvCall_YieldToActive 1 /* Yield until all active procs have run */
  29. #define HvCall_YieldToProc 2 /* Yield until the specified processor has run */
  30. /* interrupt masks for setEnabledInterrupts */
  31. #define HvCall_MaskIPI 0x00000001
  32. #define HvCall_MaskLpEvent 0x00000002
  33. #define HvCall_MaskLpProd 0x00000004
  34. #define HvCall_MaskTimeout 0x00000008
  35. /* Log buffer formats */
  36. #define HvCall_LogBuffer_ASCII 0
  37. #define HvCall_LogBuffer_EBCDIC 1
  38. #define HvCallBaseAckDeferredInts HvCallBase + 0
  39. #define HvCallBaseCpmPowerOff HvCallBase + 1
  40. #define HvCallBaseGetHwPatch HvCallBase + 2
  41. #define HvCallBaseReIplSpAttn HvCallBase + 3
  42. #define HvCallBaseSetASR HvCallBase + 4
  43. #define HvCallBaseSetASRAndRfi HvCallBase + 5
  44. #define HvCallBaseSetIMR HvCallBase + 6
  45. #define HvCallBaseSendIPI HvCallBase + 7
  46. #define HvCallBaseTerminateMachine HvCallBase + 8
  47. #define HvCallBaseTerminateMachineSrc HvCallBase + 9
  48. #define HvCallBaseProcessPlicInterrupts HvCallBase + 10
  49. #define HvCallBaseIsPrimaryCpmOrMsdIpl HvCallBase + 11
  50. #define HvCallBaseSetVirtualSIT HvCallBase + 12
  51. #define HvCallBaseVaryOffThisProcessor HvCallBase + 13
  52. #define HvCallBaseVaryOffMemoryChunk HvCallBase + 14
  53. #define HvCallBaseVaryOffInteractivePercentage HvCallBase + 15
  54. #define HvCallBaseSendLpProd HvCallBase + 16
  55. #define HvCallBaseSetEnabledInterrupts HvCallBase + 17
  56. #define HvCallBaseYieldProcessor HvCallBase + 18
  57. #define HvCallBaseVaryOffSharedProcUnits HvCallBase + 19
  58. #define HvCallBaseSetVirtualDecr HvCallBase + 20
  59. #define HvCallBaseClearLogBuffer HvCallBase + 21
  60. #define HvCallBaseGetLogBufferCodePage HvCallBase + 22
  61. #define HvCallBaseGetLogBufferFormat HvCallBase + 23
  62. #define HvCallBaseGetLogBufferLength HvCallBase + 24
  63. #define HvCallBaseReadLogBuffer HvCallBase + 25
  64. #define HvCallBaseSetLogBufferFormatAndCodePage HvCallBase + 26
  65. #define HvCallBaseWriteLogBuffer HvCallBase + 27
  66. #define HvCallBaseRouter28 HvCallBase + 28
  67. #define HvCallBaseRouter29 HvCallBase + 29
  68. #define HvCallBaseRouter30 HvCallBase + 30
  69. #define HvCallBaseSetDebugBus HvCallBase + 31
  70. #define HvCallCcSetDABR HvCallCc + 7
  71. static inline void HvCall_setVirtualDecr(void)
  72. {
  73. /*
  74. * Ignore any error return codes - most likely means that the
  75. * target value for the LP has been increased and this vary off
  76. * would bring us below the new target.
  77. */
  78. HvCall0(HvCallBaseSetVirtualDecr);
  79. }
  80. static inline void HvCall_yieldProcessor(unsigned typeOfYield, u64 yieldParm)
  81. {
  82. HvCall2(HvCallBaseYieldProcessor, typeOfYield, yieldParm);
  83. }
  84. static inline void HvCall_setEnabledInterrupts(u64 enabledInterrupts)
  85. {
  86. HvCall1(HvCallBaseSetEnabledInterrupts, enabledInterrupts);
  87. }
  88. static inline void HvCall_setLogBufferFormatAndCodepage(int format,
  89. u32 codePage)
  90. {
  91. HvCall2(HvCallBaseSetLogBufferFormatAndCodePage, format, codePage);
  92. }
  93. extern void HvCall_writeLogBuffer(const void *buffer, u64 bufLen);
  94. static inline void HvCall_sendIPI(struct paca_struct *targetPaca)
  95. {
  96. HvCall1(HvCallBaseSendIPI, targetPaca->paca_index);
  97. }
  98. #endif /* _ASM_POWERPC_ISERIES_HV_CALL_H */