3 * Copyright (C) 2001 Mike Corrigan IBM Corporation
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.
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.
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
20 //=====================================================================================
22 // This file contains the "hypervisor call" interface which is used to
23 // drive the hypervisor from the OS.
25 //=====================================================================================
29 //-------------------------------------------------------------------
31 //-------------------------------------------------------------------
32 #include <asm/iSeries/HvCallSc.h>
33 #include <asm/iSeries/HvTypes.h>
35 //-------------------------------------------------------------------------------------
37 //-------------------------------------------------------------------------------------
39 enum HvCallCfg_ReqQual
47 #define HvCallCfgGetLps HvCallCfg + 0
48 #define HvCallCfgGetActiveLpMap HvCallCfg + 1
49 #define HvCallCfgGetLpVrmIndex HvCallCfg + 2
50 #define HvCallCfgGetLpMinSupportedPlicVrmIndex HvCallCfg + 3
51 #define HvCallCfgGetLpMinCompatablePlicVrmIndex HvCallCfg + 4
52 #define HvCallCfgGetLpVrmName HvCallCfg + 5
53 #define HvCallCfgGetSystemPhysicalProcessors HvCallCfg + 6
54 #define HvCallCfgGetPhysicalProcessors HvCallCfg + 7
55 #define HvCallCfgGetSystemMsChunks HvCallCfg + 8
56 #define HvCallCfgGetMsChunks HvCallCfg + 9
57 #define HvCallCfgGetInteractivePercentage HvCallCfg + 10
58 #define HvCallCfgIsBusDedicated HvCallCfg + 11
59 #define HvCallCfgGetBusOwner HvCallCfg + 12
60 #define HvCallCfgGetBusAllocation HvCallCfg + 13
61 #define HvCallCfgGetBusUnitOwner HvCallCfg + 14
62 #define HvCallCfgGetBusUnitAllocation HvCallCfg + 15
63 #define HvCallCfgGetVirtualBusPool HvCallCfg + 16
64 #define HvCallCfgGetBusUnitInterruptProc HvCallCfg + 17
65 #define HvCallCfgGetConfiguredBusUnitsForIntProc HvCallCfg + 18
66 #define HvCallCfgGetRioSanBusPool HvCallCfg + 19
67 #define HvCallCfgGetSharedPoolIndex HvCallCfg + 20
68 #define HvCallCfgGetSharedProcUnits HvCallCfg + 21
69 #define HvCallCfgGetNumProcsInSharedPool HvCallCfg + 22
70 #define HvCallCfgRouter23 HvCallCfg + 23
71 #define HvCallCfgRouter24 HvCallCfg + 24
72 #define HvCallCfgRouter25 HvCallCfg + 25
73 #define HvCallCfgRouter26 HvCallCfg + 26
74 #define HvCallCfgRouter27 HvCallCfg + 27
75 #define HvCallCfgGetMinRuntimeMsChunks HvCallCfg + 28
76 #define HvCallCfgSetMinRuntimeMsChunks HvCallCfg + 29
77 #define HvCallCfgGetVirtualLanIndexMap HvCallCfg + 30
78 #define HvCallCfgGetLpExecutionMode HvCallCfg + 31
79 #define HvCallCfgGetHostingLpIndex HvCallCfg + 32
81 //====================================================================
82 static inline HvLpIndex
HvCallCfg_getLps(void)
84 HvLpIndex retVal
= HvCall0(HvCallCfgGetLps
);
85 // getPaca()->adjustHmtForNoOfSpinLocksHeld();
88 //====================================================================
89 static inline int HvCallCfg_isBusDedicated(u64 busIndex
)
91 int retVal
= HvCall1(HvCallCfgIsBusDedicated
,busIndex
);
92 // getPaca()->adjustHmtForNoOfSpinLocksHeld();
95 //====================================================================
96 static inline HvLpIndex
HvCallCfg_getBusOwner(u64 busIndex
)
98 HvLpIndex retVal
= HvCall1(HvCallCfgGetBusOwner
,busIndex
);
99 // getPaca()->adjustHmtForNoOfSpinLocksHeld();
102 //====================================================================
103 static inline HvLpIndexMap
HvCallCfg_getBusAllocation(u64 busIndex
)
105 HvLpIndexMap retVal
= HvCall1(HvCallCfgGetBusAllocation
,busIndex
);
106 // getPaca()->adjustHmtForNoOfSpinLocksHeld();
109 //====================================================================
110 static inline HvLpIndexMap
HvCallCfg_getActiveLpMap(void)
112 HvLpIndexMap retVal
= HvCall0(HvCallCfgGetActiveLpMap
);
113 // getPaca()->adjustHmtForNoOfSpinLocksHeld();
116 //====================================================================
117 static inline HvLpVirtualLanIndexMap
HvCallCfg_getVirtualLanIndexMap(HvLpIndex lp
)
119 // This is a new function in V5R1 so calls to this on older
120 // hypervisors will return -1
121 u64 retVal
= HvCall1(HvCallCfgGetVirtualLanIndexMap
, lp
);
124 // getPaca()->adjustHmtForNoOfSpinLocksHeld();
127 //===================================================================
128 static inline u64
HvCallCfg_getSystemMsChunks(void)
130 u64 retVal
= HvCall0(HvCallCfgGetSystemMsChunks
);
131 // getPaca()->adjustHmtForNoOfSpinLocksHeld();
134 //===================================================================
135 static inline u64
HvCallCfg_getMsChunks(HvLpIndex lp
,enum HvCallCfg_ReqQual qual
)
137 u64 retVal
= HvCall2(HvCallCfgGetMsChunks
,lp
,qual
);
138 // getPaca()->adjustHmtForNoOfSpinLocksHeld();
141 //===================================================================
142 static inline u64
HvCallCfg_getMinRuntimeMsChunks(HvLpIndex lp
)
144 // NOTE: This function was added in v5r1 so older hypervisors will return a -1 value
145 u64 retVal
= HvCall1(HvCallCfgGetMinRuntimeMsChunks
,lp
);
146 // getPaca()->adjustHmtForNoOfSpinLocksHeld();
149 //===================================================================
150 static inline u64
HvCallCfg_setMinRuntimeMsChunks(u64 chunks
)
152 u64 retVal
= HvCall1(HvCallCfgSetMinRuntimeMsChunks
,chunks
);
153 // getPaca()->adjustHmtForNoOfSpinLocksHeld();
156 //===================================================================
157 static inline u64
HvCallCfg_getSystemPhysicalProcessors(void)
159 u64 retVal
= HvCall0(HvCallCfgGetSystemPhysicalProcessors
);
160 // getPaca()->adjustHmtForNoOfSpinLocksHeld();
163 //===================================================================
164 static inline u64
HvCallCfg_getPhysicalProcessors(HvLpIndex lp
,enum HvCallCfg_ReqQual qual
)
166 u64 retVal
= HvCall2(HvCallCfgGetPhysicalProcessors
,lp
,qual
);
167 // getPaca()->adjustHmtForNoOfSpinLocksHeld();
170 //===================================================================
171 static inline u64
HvCallCfg_getConfiguredBusUnitsForInterruptProc(HvLpIndex lp
,
172 u16 hvLogicalProcIndex
)
174 u64 retVal
= HvCall2(HvCallCfgGetConfiguredBusUnitsForIntProc
,lp
,hvLogicalProcIndex
);
175 // getPaca()->adjustHmtForNoOfSpinLocksHeld();
179 //==================================================================
180 static inline HvLpSharedPoolIndex
HvCallCfg_getSharedPoolIndex(HvLpIndex lp
)
182 HvLpSharedPoolIndex retVal
=
183 HvCall1(HvCallCfgGetSharedPoolIndex
,lp
);
184 // getPaca()->adjustHmtForNoOfSpinLocksHeld();
188 //==================================================================
189 static inline u64
HvCallCfg_getSharedProcUnits(HvLpIndex lp
,enum HvCallCfg_ReqQual qual
)
191 u64 retVal
= HvCall2(HvCallCfgGetSharedProcUnits
,lp
,qual
);
192 // getPaca()->adjustHmtForNoOfSpinLocksHeld();
196 //==================================================================
197 static inline u64
HvCallCfg_getNumProcsInSharedPool(HvLpSharedPoolIndex sPI
)
199 u16 retVal
= HvCall1(HvCallCfgGetNumProcsInSharedPool
,sPI
);
200 // getPaca()->adjustHmtForNoOfSpinLocksHeld();
204 //==================================================================
205 static inline HvLpIndex
HvCallCfg_getHostingLpIndex(HvLpIndex lp
)
207 u64 retVal
= HvCall1(HvCallCfgGetHostingLpIndex
,lp
);
208 // getPaca()->adjustHmtForNoOfSpinLocksHeld();
213 #endif /* _HVCALLCFG_H */