summaryrefslogtreecommitdiffstats
path: root/include/asm-ppc64/iSeries/HvCallCfg.h
blob: 9f40f16de5334e212e4cf9012050a8937cc6e3f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
/*
 * HvCallCfg.h
 * Copyright (C) 2001  Mike Corrigan IBM Corporation
 * 
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 */

//=====================================================================================
//
//	This file contains the "hypervisor call" interface which is used to
//	drive the hypervisor from the OS.
//
//=====================================================================================
#ifndef _HVCALLCFG_H
#define _HVCALLCFG_H

//-------------------------------------------------------------------
// Standard Includes
//-------------------------------------------------------------------
#include <asm/iSeries/HvCallSc.h>
#include <asm/iSeries/HvTypes.h>

//-------------------------------------------------------------------------------------
// Constants
//-------------------------------------------------------------------------------------

enum HvCallCfg_ReqQual
{
	HvCallCfg_Cur	= 0,
	HvCallCfg_Init	= 1,
	HvCallCfg_Max	= 2,
	HvCallCfg_Min	= 3
};

#define HvCallCfgGetLps					HvCallCfg +  0
#define HvCallCfgGetActiveLpMap				HvCallCfg +  1
#define HvCallCfgGetLpVrmIndex				HvCallCfg +  2
#define HvCallCfgGetLpMinSupportedPlicVrmIndex		HvCallCfg +  3
#define HvCallCfgGetLpMinCompatablePlicVrmIndex		HvCallCfg +  4
#define HvCallCfgGetLpVrmName				HvCallCfg +  5 
#define HvCallCfgGetSystemPhysicalProcessors		HvCallCfg +  6
#define HvCallCfgGetPhysicalProcessors			HvCallCfg +  7
#define HvCallCfgGetSystemMsChunks			HvCallCfg +  8
#define HvCallCfgGetMsChunks				HvCallCfg +  9
#define HvCallCfgGetInteractivePercentage		HvCallCfg + 10
#define HvCallCfgIsBusDedicated				HvCallCfg + 11
#define HvCallCfgGetBusOwner				HvCallCfg + 12
#define HvCallCfgGetBusAllocation			HvCallCfg + 13
#define HvCallCfgGetBusUnitOwner			HvCallCfg + 14
#define HvCallCfgGetBusUnitAllocation			HvCallCfg + 15
#define HvCallCfgGetVirtualBusPool			HvCallCfg + 16
#define HvCallCfgGetBusUnitInterruptProc		HvCallCfg + 17
#define HvCallCfgGetConfiguredBusUnitsForIntProc	HvCallCfg + 18
#define HvCallCfgGetRioSanBusPool			HvCallCfg + 19
#define HvCallCfgGetSharedPoolIndex			HvCallCfg + 20
#define HvCallCfgGetSharedProcUnits			HvCallCfg + 21
#define HvCallCfgGetNumProcsInSharedPool		HvCallCfg + 22
#define HvCallCfgRouter23				HvCallCfg + 23
#define HvCallCfgRouter24				HvCallCfg + 24
#define HvCallCfgRouter25				HvCallCfg + 25
#define HvCallCfgRouter26				HvCallCfg + 26
#define HvCallCfgRouter27				HvCallCfg + 27
#define HvCallCfgGetMinRuntimeMsChunks			HvCallCfg + 28
#define HvCallCfgSetMinRuntimeMsChunks			HvCallCfg + 29
#define HvCallCfgGetVirtualLanIndexMap			HvCallCfg + 30
#define HvCallCfgGetLpExecutionMode			HvCallCfg + 31
#define HvCallCfgGetHostingLpIndex 			HvCallCfg + 32

//====================================================================
static inline HvLpIndex	HvCallCfg_getLps(void)
{
	HvLpIndex retVal = HvCall0(HvCallCfgGetLps);
	// getPaca()->adjustHmtForNoOfSpinLocksHeld();
	return retVal;
}
//====================================================================
static inline int		HvCallCfg_isBusDedicated(u64 busIndex)
{
	int retVal = HvCall1(HvCallCfgIsBusDedicated,busIndex);
	// getPaca()->adjustHmtForNoOfSpinLocksHeld();
	return retVal;
}
//====================================================================
static inline HvLpIndex	HvCallCfg_getBusOwner(u64 busIndex)
{
	HvLpIndex retVal = HvCall1(HvCallCfgGetBusOwner,busIndex);
	// getPaca()->adjustHmtForNoOfSpinLocksHeld();
	return retVal;
}
//====================================================================
static inline HvLpIndexMap	HvCallCfg_getBusAllocation(u64 busIndex)
{
	HvLpIndexMap retVal = HvCall1(HvCallCfgGetBusAllocation,busIndex);
	// getPaca()->adjustHmtForNoOfSpinLocksHeld();
	return retVal;
}
//====================================================================
static inline HvLpIndexMap	HvCallCfg_getActiveLpMap(void)
{
	HvLpIndexMap retVal = HvCall0(HvCallCfgGetActiveLpMap);
	// getPaca()->adjustHmtForNoOfSpinLocksHeld();
	return retVal;
}
//====================================================================
static inline HvLpVirtualLanIndexMap	HvCallCfg_getVirtualLanIndexMap(HvLpIndex lp)
{
	// This is a new function in V5R1 so calls to this on older 
	// hypervisors will return -1
	u64 retVal = HvCall1(HvCallCfgGetVirtualLanIndexMap, lp);
	if(retVal == -1)
		retVal = 0;
	// getPaca()->adjustHmtForNoOfSpinLocksHeld();
	return retVal;
}
//===================================================================
static inline u64		HvCallCfg_getSystemMsChunks(void)
{
	u64 retVal = HvCall0(HvCallCfgGetSystemMsChunks);
	// getPaca()->adjustHmtForNoOfSpinLocksHeld();
	return retVal;
}
//===================================================================
static inline u64		HvCallCfg_getMsChunks(HvLpIndex lp,enum HvCallCfg_ReqQual qual)
{
	u64 retVal = HvCall2(HvCallCfgGetMsChunks,lp,qual);
	// getPaca()->adjustHmtForNoOfSpinLocksHeld();
	return retVal;
}
//===================================================================
static inline u64		HvCallCfg_getMinRuntimeMsChunks(HvLpIndex lp)
{
	// NOTE: This function was added in v5r1 so older hypervisors will return a -1 value
	u64 retVal = HvCall1(HvCallCfgGetMinRuntimeMsChunks,lp);
	// getPaca()->adjustHmtForNoOfSpinLocksHeld();
	return retVal;
}
//===================================================================
static inline u64		HvCallCfg_setMinRuntimeMsChunks(u64 chunks)
{
	u64 retVal = HvCall1(HvCallCfgSetMinRuntimeMsChunks,chunks);
	// getPaca()->adjustHmtForNoOfSpinLocksHeld();
	return retVal;
}
//===================================================================
static inline u64		HvCallCfg_getSystemPhysicalProcessors(void)
{
	u64 retVal = HvCall0(HvCallCfgGetSystemPhysicalProcessors);
	// getPaca()->adjustHmtForNoOfSpinLocksHeld();
	return retVal;
}
//===================================================================
static inline u64		HvCallCfg_getPhysicalProcessors(HvLpIndex lp,enum HvCallCfg_ReqQual qual)
{
	u64 retVal = HvCall2(HvCallCfgGetPhysicalProcessors,lp,qual);
	// getPaca()->adjustHmtForNoOfSpinLocksHeld();
	return retVal;
}
//===================================================================
static inline u64		HvCallCfg_getConfiguredBusUnitsForInterruptProc(HvLpIndex lp,
										u16 hvLogicalProcIndex)
{
	u64 retVal = HvCall2(HvCallCfgGetConfiguredBusUnitsForIntProc,lp,hvLogicalProcIndex);
	// getPaca()->adjustHmtForNoOfSpinLocksHeld();
	return retVal;

}
//==================================================================
static inline HvLpSharedPoolIndex	HvCallCfg_getSharedPoolIndex(HvLpIndex lp)
{
	HvLpSharedPoolIndex retVal =
		HvCall1(HvCallCfgGetSharedPoolIndex,lp);
	// getPaca()->adjustHmtForNoOfSpinLocksHeld();
	return retVal;

}
//==================================================================
static inline u64	HvCallCfg_getSharedProcUnits(HvLpIndex lp,enum HvCallCfg_ReqQual qual)
{
	u64 retVal = HvCall2(HvCallCfgGetSharedProcUnits,lp,qual);
	// getPaca()->adjustHmtForNoOfSpinLocksHeld();
	return retVal;

}
//==================================================================
static inline u64	HvCallCfg_getNumProcsInSharedPool(HvLpSharedPoolIndex sPI)
{
	u16 retVal = HvCall1(HvCallCfgGetNumProcsInSharedPool,sPI);
	// getPaca()->adjustHmtForNoOfSpinLocksHeld();
	return retVal;

}
//==================================================================
static inline HvLpIndex	HvCallCfg_getHostingLpIndex(HvLpIndex lp)
{
	u64 retVal = HvCall1(HvCallCfgGetHostingLpIndex,lp);
	// getPaca()->adjustHmtForNoOfSpinLocksHeld();
	return retVal;

}

#endif /* _HVCALLCFG_H */
OpenPOWER on IntegriCloud