aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-ppc64/iSeries/HvCall.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-ppc64/iSeries/HvCall.h')
-rw-r--r--include/asm-ppc64/iSeries/HvCall.h156
1 files changed, 32 insertions, 124 deletions
diff --git a/include/asm-ppc64/iSeries/HvCall.h b/include/asm-ppc64/iSeries/HvCall.h
index d9a2e74e2399..c3f19475c0d9 100644
--- a/include/asm-ppc64/iSeries/HvCall.h
+++ b/include/asm-ppc64/iSeries/HvCall.h
@@ -1,84 +1,36 @@
1/* 1/*
2 * HvCall.h 2 * HvCall.h
3 * Copyright (C) 2001 Mike Corrigan IBM Corporation 3 * Copyright (C) 2001 Mike Corrigan IBM Corporation
4 * 4 *
5 * This program is free software; you can redistribute it and/or modify 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 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 7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version. 8 * (at your option) any later version.
9 * 9 *
10 * This program is distributed in the hope that it will be useful, 10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details. 13 * GNU General Public License for more details.
14 * 14 *
15 * You should have received a copy of the GNU General Public License 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 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 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */ 18 */
19 19/*
20//=========================================================================== 20 * This file contains the "hypervisor call" interface which is used to
21// 21 * drive the hypervisor from the OS.
22// This file contains the "hypervisor call" interface which is used to 22 */
23// drive the hypervisor from the OS.
24//
25//===========================================================================
26#ifndef _HVCALL_H 23#ifndef _HVCALL_H
27#define _HVCALL_H 24#define _HVCALL_H
28 25
29//-------------------------------------------------------------------
30// Standard Includes
31//-------------------------------------------------------------------
32#include <asm/iSeries/HvCallSc.h> 26#include <asm/iSeries/HvCallSc.h>
33#include <asm/iSeries/HvTypes.h> 27#include <asm/iSeries/HvTypes.h>
34#include <asm/paca.h> 28#include <asm/paca.h>
35 29
36/*
37enum HvCall_ReturnCode
38{
39 HvCall_Good = 0,
40 HvCall_Partial = 1,
41 HvCall_NotOwned = 2,
42 HvCall_NotFreed = 3,
43 HvCall_UnspecifiedError = 4
44};
45
46enum HvCall_TypeOfSIT
47{
48 HvCall_ReduceOnly = 0,
49 HvCall_Unconditional = 1
50};
51
52enum HvCall_TypeOfYield
53{
54 HvCall_YieldTimed = 0, // Yield until specified time
55 HvCall_YieldToActive = 1, // Yield until all active procs have run
56 HvCall_YieldToProc = 2 // Yield until the specified processor has run
57};
58
59enum HvCall_InterruptMasks
60{
61 HvCall_MaskIPI = 0x00000001,
62 HvCall_MaskLpEvent = 0x00000002,
63 HvCall_MaskLpProd = 0x00000004,
64 HvCall_MaskTimeout = 0x00000008
65};
66
67enum HvCall_VaryOffChunkRc
68{
69 HvCall_VaryOffSucceeded = 0,
70 HvCall_VaryOffWithdrawn = 1,
71 HvCall_ChunkInLoadArea = 2,
72 HvCall_ChunkInHPT = 3,
73 HvCall_ChunkNotAccessible = 4,
74 HvCall_ChunkInUse = 5
75};
76*/
77
78/* Type of yield for HvCallBaseYieldProcessor */ 30/* Type of yield for HvCallBaseYieldProcessor */
79#define HvCall_YieldTimed 0 // Yield until specified time (tb) 31#define HvCall_YieldTimed 0 /* Yield until specified time (tb) */
80#define HvCall_YieldToActive 1 // Yield until all active procs have run 32#define HvCall_YieldToActive 1 /* Yield until all active procs have run */
81#define HvCall_YieldToProc 2 // Yield until the specified processor has run 33#define HvCall_YieldToProc 2 /* Yield until the specified processor has run */
82 34
83/* interrupt masks for setEnabledInterrupts */ 35/* interrupt masks for setEnabledInterrupts */
84#define HvCall_MaskIPI 0x00000001 36#define HvCall_MaskIPI 0x00000001
@@ -86,7 +38,7 @@ enum HvCall_VaryOffChunkRc
86#define HvCall_MaskLpProd 0x00000004 38#define HvCall_MaskLpProd 0x00000004
87#define HvCall_MaskTimeout 0x00000008 39#define HvCall_MaskTimeout 0x00000008
88 40
89/* Log buffer formats */ 41/* Log buffer formats */
90#define HvCall_LogBuffer_ASCII 0 42#define HvCall_LogBuffer_ASCII 0
91#define HvCall_LogBuffer_EBCDIC 1 43#define HvCall_LogBuffer_EBCDIC 1
92 44
@@ -95,7 +47,7 @@ enum HvCall_VaryOffChunkRc
95#define HvCallBaseGetHwPatch HvCallBase + 2 47#define HvCallBaseGetHwPatch HvCallBase + 2
96#define HvCallBaseReIplSpAttn HvCallBase + 3 48#define HvCallBaseReIplSpAttn HvCallBase + 3
97#define HvCallBaseSetASR HvCallBase + 4 49#define HvCallBaseSetASR HvCallBase + 4
98#define HvCallBaseSetASRAndRfi HvCallBase + 5 50#define HvCallBaseSetASRAndRfi HvCallBase + 5
99#define HvCallBaseSetIMR HvCallBase + 6 51#define HvCallBaseSetIMR HvCallBase + 6
100#define HvCallBaseSendIPI HvCallBase + 7 52#define HvCallBaseSendIPI HvCallBase + 7
101#define HvCallBaseTerminateMachine HvCallBase + 8 53#define HvCallBaseTerminateMachine HvCallBase + 8
@@ -115,91 +67,47 @@ enum HvCall_VaryOffChunkRc
115#define HvCallBaseGetLogBufferCodePage HvCallBase + 22 67#define HvCallBaseGetLogBufferCodePage HvCallBase + 22
116#define HvCallBaseGetLogBufferFormat HvCallBase + 23 68#define HvCallBaseGetLogBufferFormat HvCallBase + 23
117#define HvCallBaseGetLogBufferLength HvCallBase + 24 69#define HvCallBaseGetLogBufferLength HvCallBase + 24
118#define HvCallBaseReadLogBuffer HvCallBase + 25 70#define HvCallBaseReadLogBuffer HvCallBase + 25
119#define HvCallBaseSetLogBufferFormatAndCodePage HvCallBase + 26 71#define HvCallBaseSetLogBufferFormatAndCodePage HvCallBase + 26
120#define HvCallBaseWriteLogBuffer HvCallBase + 27 72#define HvCallBaseWriteLogBuffer HvCallBase + 27
121#define HvCallBaseRouter28 HvCallBase + 28 73#define HvCallBaseRouter28 HvCallBase + 28
122#define HvCallBaseRouter29 HvCallBase + 29 74#define HvCallBaseRouter29 HvCallBase + 29
123#define HvCallBaseRouter30 HvCallBase + 30 75#define HvCallBaseRouter30 HvCallBase + 30
124#define HvCallBaseSetDebugBus HvCallBase + 31 76#define HvCallBaseSetDebugBus HvCallBase + 31
125 77
126#define HvCallCcSetDABR HvCallCc + 7 78#define HvCallCcSetDABR HvCallCc + 7
127 79
128//===================================================================================== 80static inline void HvCall_setVirtualDecr(void)
129static inline void HvCall_setVirtualDecr(void)
130{ 81{
131 /* Ignore any error return codes - most likely means that the target value for the 82 /*
132 * LP has been increased and this vary off would bring us below the new target. */ 83 * Ignore any error return codes - most likely means that the
84 * target value for the LP has been increased and this vary off
85 * would bring us below the new target.
86 */
133 HvCall0(HvCallBaseSetVirtualDecr); 87 HvCall0(HvCallBaseSetVirtualDecr);
134} 88}
135//=====================================================================
136static inline void HvCall_yieldProcessor(unsigned typeOfYield, u64 yieldParm)
137{
138 HvCall2( HvCallBaseYieldProcessor, typeOfYield, yieldParm );
139}
140//=====================================================================
141static inline void HvCall_setEnabledInterrupts(u64 enabledInterrupts)
142{
143 HvCall1(HvCallBaseSetEnabledInterrupts,enabledInterrupts);
144}
145
146//=====================================================================
147static inline void HvCall_clearLogBuffer(HvLpIndex lpindex)
148{
149 HvCall1(HvCallBaseClearLogBuffer,lpindex);
150}
151
152//=====================================================================
153static inline u32 HvCall_getLogBufferCodePage(HvLpIndex lpindex)
154{
155 u32 retVal = HvCall1(HvCallBaseGetLogBufferCodePage,lpindex);
156 return retVal;
157}
158
159//=====================================================================
160static inline int HvCall_getLogBufferFormat(HvLpIndex lpindex)
161{
162 int retVal = HvCall1(HvCallBaseGetLogBufferFormat,lpindex);
163 return retVal;
164}
165
166//=====================================================================
167static inline u32 HvCall_getLogBufferLength(HvLpIndex lpindex)
168{
169 u32 retVal = HvCall1(HvCallBaseGetLogBufferLength,lpindex);
170 return retVal;
171}
172 89
173//===================================================================== 90static inline void HvCall_yieldProcessor(unsigned typeOfYield, u64 yieldParm)
174static inline void HvCall_setLogBufferFormatAndCodepage(int format, u32 codePage)
175{ 91{
176 HvCall2(HvCallBaseSetLogBufferFormatAndCodePage,format, codePage); 92 HvCall2(HvCallBaseYieldProcessor, typeOfYield, yieldParm);
177} 93}
178 94
179//===================================================================== 95static inline void HvCall_setEnabledInterrupts(u64 enabledInterrupts)
180int HvCall_readLogBuffer(HvLpIndex lpindex, void *buffer, u64 bufLen);
181void HvCall_writeLogBuffer(const void *buffer, u64 bufLen);
182
183//=====================================================================
184static inline void HvCall_sendIPI(struct paca_struct * targetPaca)
185{ 96{
186 HvCall1( HvCallBaseSendIPI, targetPaca->paca_index ); 97 HvCall1(HvCallBaseSetEnabledInterrupts, enabledInterrupts);
187} 98}
188 99
189//===================================================================== 100static inline void HvCall_setLogBufferFormatAndCodepage(int format,
190static inline void HvCall_terminateMachineSrc(void) 101 u32 codePage)
191{ 102{
192 HvCall0( HvCallBaseTerminateMachineSrc ); 103 HvCall2(HvCallBaseSetLogBufferFormatAndCodePage, format, codePage);
193} 104}
194 105
195static inline void HvCall_setDABR(unsigned long val) 106extern void HvCall_writeLogBuffer(const void *buffer, u64 bufLen);
196{
197 HvCall1(HvCallCcSetDABR, val);
198}
199 107
200static inline void HvCall_setDebugBus(unsigned long val) 108static inline void HvCall_sendIPI(struct paca_struct *targetPaca)
201{ 109{
202 HvCall1(HvCallBaseSetDebugBus, val); 110 HvCall1(HvCallBaseSendIPI, targetPaca->paca_index);
203} 111}
204 112
205#endif /* _HVCALL_H */ 113#endif /* _HVCALL_H */