aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-ppc64
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-ppc64')
-rw-r--r--include/asm-ppc64/iSeries/HvCall.h100
-rw-r--r--include/asm-ppc64/iSeries/HvCallCfg.h116
-rw-r--r--include/asm-ppc64/iSeries/HvCallEvent.h29
-rw-r--r--include/asm-ppc64/iSeries/HvCallHpt.h89
-rw-r--r--include/asm-ppc64/iSeries/HvCallPci.h340
-rw-r--r--include/asm-ppc64/iSeries/HvCallSc.h38
-rw-r--r--include/asm-ppc64/iSeries/HvCallSm.h31
-rw-r--r--include/asm-ppc64/iSeries/HvCallXm.h63
-rw-r--r--include/asm-ppc64/iSeries/HvLpConfig.h291
-rw-r--r--include/asm-ppc64/iSeries/HvLpEvent.h116
-rw-r--r--include/asm-ppc64/iSeries/HvReleaseData.h76
-rw-r--r--include/asm-ppc64/iSeries/HvTypes.h108
12 files changed, 644 insertions, 753 deletions
diff --git a/include/asm-ppc64/iSeries/HvCall.h b/include/asm-ppc64/iSeries/HvCall.h
index d9a2e74e2399..c903387e9128 100644
--- a/include/asm-ppc64/iSeries/HvCall.h
+++ b/include/asm-ppc64/iSeries/HvCall.h
@@ -1,34 +1,28 @@
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>
@@ -76,9 +70,9 @@ enum HvCall_VaryOffChunkRc
76*/ 70*/
77 71
78/* Type of yield for HvCallBaseYieldProcessor */ 72/* Type of yield for HvCallBaseYieldProcessor */
79#define HvCall_YieldTimed 0 // Yield until specified time (tb) 73#define HvCall_YieldTimed 0 /* Yield until specified time (tb) */
80#define HvCall_YieldToActive 1 // Yield until all active procs have run 74#define HvCall_YieldToActive 1 /* Yield until all active procs have run */
81#define HvCall_YieldToProc 2 // Yield until the specified processor has run 75#define HvCall_YieldToProc 2 /* Yield until the specified processor has run */
82 76
83/* interrupt masks for setEnabledInterrupts */ 77/* interrupt masks for setEnabledInterrupts */
84#define HvCall_MaskIPI 0x00000001 78#define HvCall_MaskIPI 0x00000001
@@ -86,7 +80,7 @@ enum HvCall_VaryOffChunkRc
86#define HvCall_MaskLpProd 0x00000004 80#define HvCall_MaskLpProd 0x00000004
87#define HvCall_MaskTimeout 0x00000008 81#define HvCall_MaskTimeout 0x00000008
88 82
89/* Log buffer formats */ 83/* Log buffer formats */
90#define HvCall_LogBuffer_ASCII 0 84#define HvCall_LogBuffer_ASCII 0
91#define HvCall_LogBuffer_EBCDIC 1 85#define HvCall_LogBuffer_EBCDIC 1
92 86
@@ -95,7 +89,7 @@ enum HvCall_VaryOffChunkRc
95#define HvCallBaseGetHwPatch HvCallBase + 2 89#define HvCallBaseGetHwPatch HvCallBase + 2
96#define HvCallBaseReIplSpAttn HvCallBase + 3 90#define HvCallBaseReIplSpAttn HvCallBase + 3
97#define HvCallBaseSetASR HvCallBase + 4 91#define HvCallBaseSetASR HvCallBase + 4
98#define HvCallBaseSetASRAndRfi HvCallBase + 5 92#define HvCallBaseSetASRAndRfi HvCallBase + 5
99#define HvCallBaseSetIMR HvCallBase + 6 93#define HvCallBaseSetIMR HvCallBase + 6
100#define HvCallBaseSendIPI HvCallBase + 7 94#define HvCallBaseSendIPI HvCallBase + 7
101#define HvCallBaseTerminateMachine HvCallBase + 8 95#define HvCallBaseTerminateMachine HvCallBase + 8
@@ -115,81 +109,75 @@ enum HvCall_VaryOffChunkRc
115#define HvCallBaseGetLogBufferCodePage HvCallBase + 22 109#define HvCallBaseGetLogBufferCodePage HvCallBase + 22
116#define HvCallBaseGetLogBufferFormat HvCallBase + 23 110#define HvCallBaseGetLogBufferFormat HvCallBase + 23
117#define HvCallBaseGetLogBufferLength HvCallBase + 24 111#define HvCallBaseGetLogBufferLength HvCallBase + 24
118#define HvCallBaseReadLogBuffer HvCallBase + 25 112#define HvCallBaseReadLogBuffer HvCallBase + 25
119#define HvCallBaseSetLogBufferFormatAndCodePage HvCallBase + 26 113#define HvCallBaseSetLogBufferFormatAndCodePage HvCallBase + 26
120#define HvCallBaseWriteLogBuffer HvCallBase + 27 114#define HvCallBaseWriteLogBuffer HvCallBase + 27
121#define HvCallBaseRouter28 HvCallBase + 28 115#define HvCallBaseRouter28 HvCallBase + 28
122#define HvCallBaseRouter29 HvCallBase + 29 116#define HvCallBaseRouter29 HvCallBase + 29
123#define HvCallBaseRouter30 HvCallBase + 30 117#define HvCallBaseRouter30 HvCallBase + 30
124#define HvCallBaseSetDebugBus HvCallBase + 31 118#define HvCallBaseSetDebugBus HvCallBase + 31
125 119
126#define HvCallCcSetDABR HvCallCc + 7 120#define HvCallCcSetDABR HvCallCc + 7
127 121
128//===================================================================================== 122static inline void HvCall_setVirtualDecr(void)
129static inline void HvCall_setVirtualDecr(void)
130{ 123{
131 /* Ignore any error return codes - most likely means that the target value for the 124 /*
132 * LP has been increased and this vary off would bring us below the new target. */ 125 * Ignore any error return codes - most likely means that the
126 * target value for the LP has been increased and this vary off
127 * would bring us below the new target.
128 */
133 HvCall0(HvCallBaseSetVirtualDecr); 129 HvCall0(HvCallBaseSetVirtualDecr);
134} 130}
135//===================================================================== 131
136static inline void HvCall_yieldProcessor(unsigned typeOfYield, u64 yieldParm) 132static inline void HvCall_yieldProcessor(unsigned typeOfYield, u64 yieldParm)
137{ 133{
138 HvCall2( HvCallBaseYieldProcessor, typeOfYield, yieldParm ); 134 HvCall2(HvCallBaseYieldProcessor, typeOfYield, yieldParm);
139} 135}
140//===================================================================== 136
141static inline void HvCall_setEnabledInterrupts(u64 enabledInterrupts) 137static inline void HvCall_setEnabledInterrupts(u64 enabledInterrupts)
142{ 138{
143 HvCall1(HvCallBaseSetEnabledInterrupts,enabledInterrupts); 139 HvCall1(HvCallBaseSetEnabledInterrupts, enabledInterrupts);
144} 140}
145 141
146//===================================================================== 142static inline void HvCall_clearLogBuffer(HvLpIndex lpindex)
147static inline void HvCall_clearLogBuffer(HvLpIndex lpindex)
148{ 143{
149 HvCall1(HvCallBaseClearLogBuffer,lpindex); 144 HvCall1(HvCallBaseClearLogBuffer, lpindex);
150} 145}
151 146
152//===================================================================== 147static inline u32 HvCall_getLogBufferCodePage(HvLpIndex lpindex)
153static inline u32 HvCall_getLogBufferCodePage(HvLpIndex lpindex)
154{ 148{
155 u32 retVal = HvCall1(HvCallBaseGetLogBufferCodePage,lpindex); 149 u32 retVal = HvCall1(HvCallBaseGetLogBufferCodePage, lpindex);
156 return retVal; 150 return retVal;
157} 151}
158 152
159//===================================================================== 153static inline int HvCall_getLogBufferFormat(HvLpIndex lpindex)
160static inline int HvCall_getLogBufferFormat(HvLpIndex lpindex)
161{ 154{
162 int retVal = HvCall1(HvCallBaseGetLogBufferFormat,lpindex); 155 int retVal = HvCall1(HvCallBaseGetLogBufferFormat, lpindex);
163 return retVal; 156 return retVal;
164} 157}
165 158
166//===================================================================== 159static inline u32 HvCall_getLogBufferLength(HvLpIndex lpindex)
167static inline u32 HvCall_getLogBufferLength(HvLpIndex lpindex)
168{ 160{
169 u32 retVal = HvCall1(HvCallBaseGetLogBufferLength,lpindex); 161 u32 retVal = HvCall1(HvCallBaseGetLogBufferLength, lpindex);
170 return retVal; 162 return retVal;
171} 163}
172 164
173//===================================================================== 165static inline void HvCall_setLogBufferFormatAndCodepage(int format, u32 codePage)
174static inline void HvCall_setLogBufferFormatAndCodepage(int format, u32 codePage)
175{ 166{
176 HvCall2(HvCallBaseSetLogBufferFormatAndCodePage,format, codePage); 167 HvCall2(HvCallBaseSetLogBufferFormatAndCodePage, format, codePage);
177} 168}
178 169
179//===================================================================== 170extern int HvCall_readLogBuffer(HvLpIndex lpindex, void *buffer, u64 bufLen);
180int HvCall_readLogBuffer(HvLpIndex lpindex, void *buffer, u64 bufLen); 171extern void HvCall_writeLogBuffer(const void *buffer, u64 bufLen);
181void HvCall_writeLogBuffer(const void *buffer, u64 bufLen);
182 172
183//===================================================================== 173static inline void HvCall_sendIPI(struct paca_struct *targetPaca)
184static inline void HvCall_sendIPI(struct paca_struct * targetPaca)
185{ 174{
186 HvCall1( HvCallBaseSendIPI, targetPaca->paca_index ); 175 HvCall1(HvCallBaseSendIPI, targetPaca->paca_index);
187} 176}
188 177
189//===================================================================== 178static inline void HvCall_terminateMachineSrc(void)
190static inline void HvCall_terminateMachineSrc(void)
191{ 179{
192 HvCall0( HvCallBaseTerminateMachineSrc ); 180 HvCall0(HvCallBaseTerminateMachineSrc);
193} 181}
194 182
195static inline void HvCall_setDABR(unsigned long val) 183static inline void HvCall_setDABR(unsigned long val)
diff --git a/include/asm-ppc64/iSeries/HvCallCfg.h b/include/asm-ppc64/iSeries/HvCallCfg.h
index 9f40f16de533..2223a9647d0e 100644
--- a/include/asm-ppc64/iSeries/HvCallCfg.h
+++ b/include/asm-ppc64/iSeries/HvCallCfg.h
@@ -1,43 +1,32 @@
1/* 1/*
2 * HvCallCfg.h 2 * HvCallCfg.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 _HVCALLCFG_H 23#ifndef _HVCALLCFG_H
27#define _HVCALLCFG_H 24#define _HVCALLCFG_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 28
35//------------------------------------------------------------------------------------- 29enum HvCallCfg_ReqQual {
36// Constants
37//-------------------------------------------------------------------------------------
38
39enum HvCallCfg_ReqQual
40{
41 HvCallCfg_Cur = 0, 30 HvCallCfg_Cur = 0,
42 HvCallCfg_Init = 1, 31 HvCallCfg_Init = 1,
43 HvCallCfg_Max = 2, 32 HvCallCfg_Max = 2,
@@ -49,7 +38,7 @@ enum HvCallCfg_ReqQual
49#define HvCallCfgGetLpVrmIndex HvCallCfg + 2 38#define HvCallCfgGetLpVrmIndex HvCallCfg + 2
50#define HvCallCfgGetLpMinSupportedPlicVrmIndex HvCallCfg + 3 39#define HvCallCfgGetLpMinSupportedPlicVrmIndex HvCallCfg + 3
51#define HvCallCfgGetLpMinCompatablePlicVrmIndex HvCallCfg + 4 40#define HvCallCfgGetLpMinCompatablePlicVrmIndex HvCallCfg + 4
52#define HvCallCfgGetLpVrmName HvCallCfg + 5 41#define HvCallCfgGetLpVrmName HvCallCfg + 5
53#define HvCallCfgGetSystemPhysicalProcessors HvCallCfg + 6 42#define HvCallCfgGetSystemPhysicalProcessors HvCallCfg + 6
54#define HvCallCfgGetPhysicalProcessors HvCallCfg + 7 43#define HvCallCfgGetPhysicalProcessors HvCallCfg + 7
55#define HvCallCfgGetSystemMsChunks HvCallCfg + 8 44#define HvCallCfgGetSystemMsChunks HvCallCfg + 8
@@ -76,108 +65,113 @@ enum HvCallCfg_ReqQual
76#define HvCallCfgSetMinRuntimeMsChunks HvCallCfg + 29 65#define HvCallCfgSetMinRuntimeMsChunks HvCallCfg + 29
77#define HvCallCfgGetVirtualLanIndexMap HvCallCfg + 30 66#define HvCallCfgGetVirtualLanIndexMap HvCallCfg + 30
78#define HvCallCfgGetLpExecutionMode HvCallCfg + 31 67#define HvCallCfgGetLpExecutionMode HvCallCfg + 31
79#define HvCallCfgGetHostingLpIndex HvCallCfg + 32 68#define HvCallCfgGetHostingLpIndex HvCallCfg + 32
80 69
81//====================================================================
82static inline HvLpIndex HvCallCfg_getLps(void) 70static inline HvLpIndex HvCallCfg_getLps(void)
83{ 71{
84 HvLpIndex retVal = HvCall0(HvCallCfgGetLps); 72 HvLpIndex retVal = HvCall0(HvCallCfgGetLps);
85 // getPaca()->adjustHmtForNoOfSpinLocksHeld(); 73 // getPaca()->adjustHmtForNoOfSpinLocksHeld();
86 return retVal; 74 return retVal;
87} 75}
88//==================================================================== 76
89static inline int HvCallCfg_isBusDedicated(u64 busIndex) 77static inline int HvCallCfg_isBusDedicated(u64 busIndex)
90{ 78{
91 int retVal = HvCall1(HvCallCfgIsBusDedicated,busIndex); 79 int retVal = HvCall1(HvCallCfgIsBusDedicated,busIndex);
92 // getPaca()->adjustHmtForNoOfSpinLocksHeld(); 80 // getPaca()->adjustHmtForNoOfSpinLocksHeld();
93 return retVal; 81 return retVal;
94} 82}
95//==================================================================== 83
96static inline HvLpIndex HvCallCfg_getBusOwner(u64 busIndex) 84static inline HvLpIndex HvCallCfg_getBusOwner(u64 busIndex)
97{ 85{
98 HvLpIndex retVal = HvCall1(HvCallCfgGetBusOwner,busIndex); 86 HvLpIndex retVal = HvCall1(HvCallCfgGetBusOwner,busIndex);
99 // getPaca()->adjustHmtForNoOfSpinLocksHeld(); 87 // getPaca()->adjustHmtForNoOfSpinLocksHeld();
100 return retVal; 88 return retVal;
101} 89}
102//==================================================================== 90
103static inline HvLpIndexMap HvCallCfg_getBusAllocation(u64 busIndex) 91static inline HvLpIndexMap HvCallCfg_getBusAllocation(u64 busIndex)
104{ 92{
105 HvLpIndexMap retVal = HvCall1(HvCallCfgGetBusAllocation,busIndex); 93 HvLpIndexMap retVal = HvCall1(HvCallCfgGetBusAllocation,busIndex);
106 // getPaca()->adjustHmtForNoOfSpinLocksHeld(); 94 // getPaca()->adjustHmtForNoOfSpinLocksHeld();
107 return retVal; 95 return retVal;
108} 96}
109//==================================================================== 97
110static inline HvLpIndexMap HvCallCfg_getActiveLpMap(void) 98static inline HvLpIndexMap HvCallCfg_getActiveLpMap(void)
111{ 99{
112 HvLpIndexMap retVal = HvCall0(HvCallCfgGetActiveLpMap); 100 HvLpIndexMap retVal = HvCall0(HvCallCfgGetActiveLpMap);
113 // getPaca()->adjustHmtForNoOfSpinLocksHeld(); 101 // getPaca()->adjustHmtForNoOfSpinLocksHeld();
114 return retVal; 102 return retVal;
115} 103}
116//==================================================================== 104
117static inline HvLpVirtualLanIndexMap HvCallCfg_getVirtualLanIndexMap(HvLpIndex lp) 105static inline HvLpVirtualLanIndexMap HvCallCfg_getVirtualLanIndexMap(
106 HvLpIndex lp)
118{ 107{
119 // This is a new function in V5R1 so calls to this on older 108 /*
120 // hypervisors will return -1 109 * This is a new function in V5R1 so calls to this on older
110 * hypervisors will return -1
111 */
121 u64 retVal = HvCall1(HvCallCfgGetVirtualLanIndexMap, lp); 112 u64 retVal = HvCall1(HvCallCfgGetVirtualLanIndexMap, lp);
122 if(retVal == -1) 113 if (retVal == -1)
123 retVal = 0; 114 retVal = 0;
124 // getPaca()->adjustHmtForNoOfSpinLocksHeld(); 115 // getPaca()->adjustHmtForNoOfSpinLocksHeld();
125 return retVal; 116 return retVal;
126} 117}
127//=================================================================== 118
128static inline u64 HvCallCfg_getSystemMsChunks(void) 119static inline u64 HvCallCfg_getSystemMsChunks(void)
129{ 120{
130 u64 retVal = HvCall0(HvCallCfgGetSystemMsChunks); 121 u64 retVal = HvCall0(HvCallCfgGetSystemMsChunks);
131 // getPaca()->adjustHmtForNoOfSpinLocksHeld(); 122 // getPaca()->adjustHmtForNoOfSpinLocksHeld();
132 return retVal; 123 return retVal;
133} 124}
134//=================================================================== 125
135static inline u64 HvCallCfg_getMsChunks(HvLpIndex lp,enum HvCallCfg_ReqQual qual) 126static inline u64 HvCallCfg_getMsChunks(HvLpIndex lp,
127 enum HvCallCfg_ReqQual qual)
136{ 128{
137 u64 retVal = HvCall2(HvCallCfgGetMsChunks,lp,qual); 129 u64 retVal = HvCall2(HvCallCfgGetMsChunks,lp,qual);
138 // getPaca()->adjustHmtForNoOfSpinLocksHeld(); 130 // getPaca()->adjustHmtForNoOfSpinLocksHeld();
139 return retVal; 131 return retVal;
140} 132}
141//=================================================================== 133
142static inline u64 HvCallCfg_getMinRuntimeMsChunks(HvLpIndex lp) 134static inline u64 HvCallCfg_getMinRuntimeMsChunks(HvLpIndex lp)
143{ 135{
144 // NOTE: This function was added in v5r1 so older hypervisors will return a -1 value 136 /*
145 u64 retVal = HvCall1(HvCallCfgGetMinRuntimeMsChunks,lp); 137 * NOTE: This function was added in v5r1 so older hypervisors
146 // getPaca()->adjustHmtForNoOfSpinLocksHeld(); 138 * will return a -1 value
147 return retVal; 139 */
140 return HvCall1(HvCallCfgGetMinRuntimeMsChunks, lp);
148} 141}
149//=================================================================== 142
150static inline u64 HvCallCfg_setMinRuntimeMsChunks(u64 chunks) 143static inline u64 HvCallCfg_setMinRuntimeMsChunks(u64 chunks)
151{ 144{
152 u64 retVal = HvCall1(HvCallCfgSetMinRuntimeMsChunks,chunks); 145 u64 retVal = HvCall1(HvCallCfgSetMinRuntimeMsChunks,chunks);
153 // getPaca()->adjustHmtForNoOfSpinLocksHeld(); 146 // getPaca()->adjustHmtForNoOfSpinLocksHeld();
154 return retVal; 147 return retVal;
155} 148}
156//=================================================================== 149
157static inline u64 HvCallCfg_getSystemPhysicalProcessors(void) 150static inline u64 HvCallCfg_getSystemPhysicalProcessors(void)
158{ 151{
159 u64 retVal = HvCall0(HvCallCfgGetSystemPhysicalProcessors); 152 u64 retVal = HvCall0(HvCallCfgGetSystemPhysicalProcessors);
160 // getPaca()->adjustHmtForNoOfSpinLocksHeld(); 153 // getPaca()->adjustHmtForNoOfSpinLocksHeld();
161 return retVal; 154 return retVal;
162} 155}
163//=================================================================== 156
164static inline u64 HvCallCfg_getPhysicalProcessors(HvLpIndex lp,enum HvCallCfg_ReqQual qual) 157static inline u64 HvCallCfg_getPhysicalProcessors(HvLpIndex lp,
158 enum HvCallCfg_ReqQual qual)
165{ 159{
166 u64 retVal = HvCall2(HvCallCfgGetPhysicalProcessors,lp,qual); 160 u64 retVal = HvCall2(HvCallCfgGetPhysicalProcessors,lp,qual);
167 // getPaca()->adjustHmtForNoOfSpinLocksHeld(); 161 // getPaca()->adjustHmtForNoOfSpinLocksHeld();
168 return retVal; 162 return retVal;
169} 163}
170//=================================================================== 164
171static inline u64 HvCallCfg_getConfiguredBusUnitsForInterruptProc(HvLpIndex lp, 165static inline u64 HvCallCfg_getConfiguredBusUnitsForInterruptProc(HvLpIndex lp,
172 u16 hvLogicalProcIndex) 166 u16 hvLogicalProcIndex)
173{ 167{
174 u64 retVal = HvCall2(HvCallCfgGetConfiguredBusUnitsForIntProc,lp,hvLogicalProcIndex); 168 u64 retVal = HvCall2(HvCallCfgGetConfiguredBusUnitsForIntProc,lp,hvLogicalProcIndex);
175 // getPaca()->adjustHmtForNoOfSpinLocksHeld(); 169 // getPaca()->adjustHmtForNoOfSpinLocksHeld();
176 return retVal; 170 return retVal;
177 171
178} 172}
179//================================================================== 173
180static inline HvLpSharedPoolIndex HvCallCfg_getSharedPoolIndex(HvLpIndex lp) 174static inline HvLpSharedPoolIndex HvCallCfg_getSharedPoolIndex(HvLpIndex lp)
181{ 175{
182 HvLpSharedPoolIndex retVal = 176 HvLpSharedPoolIndex retVal =
183 HvCall1(HvCallCfgGetSharedPoolIndex,lp); 177 HvCall1(HvCallCfgGetSharedPoolIndex,lp);
@@ -185,29 +179,29 @@ static inline HvLpSharedPoolIndex HvCallCfg_getSharedPoolIndex(HvLpIndex lp)
185 return retVal; 179 return retVal;
186 180
187} 181}
188//================================================================== 182
189static inline u64 HvCallCfg_getSharedProcUnits(HvLpIndex lp,enum HvCallCfg_ReqQual qual) 183static inline u64 HvCallCfg_getSharedProcUnits(HvLpIndex lp,
184 enum HvCallCfg_ReqQual qual)
190{ 185{
191 u64 retVal = HvCall2(HvCallCfgGetSharedProcUnits,lp,qual); 186 u64 retVal = HvCall2(HvCallCfgGetSharedProcUnits,lp,qual);
192 // getPaca()->adjustHmtForNoOfSpinLocksHeld(); 187 // getPaca()->adjustHmtForNoOfSpinLocksHeld();
193 return retVal; 188 return retVal;
194 189
195} 190}
196//================================================================== 191
197static inline u64 HvCallCfg_getNumProcsInSharedPool(HvLpSharedPoolIndex sPI) 192static inline u64 HvCallCfg_getNumProcsInSharedPool(HvLpSharedPoolIndex sPI)
198{ 193{
199 u16 retVal = HvCall1(HvCallCfgGetNumProcsInSharedPool,sPI); 194 u16 retVal = HvCall1(HvCallCfgGetNumProcsInSharedPool,sPI);
200 // getPaca()->adjustHmtForNoOfSpinLocksHeld(); 195 // getPaca()->adjustHmtForNoOfSpinLocksHeld();
201 return retVal; 196 return retVal;
202 197
203} 198}
204//================================================================== 199
205static inline HvLpIndex HvCallCfg_getHostingLpIndex(HvLpIndex lp) 200static inline HvLpIndex HvCallCfg_getHostingLpIndex(HvLpIndex lp)
206{ 201{
207 u64 retVal = HvCall1(HvCallCfgGetHostingLpIndex,lp); 202 u64 retVal = HvCall1(HvCallCfgGetHostingLpIndex,lp);
208 // getPaca()->adjustHmtForNoOfSpinLocksHeld(); 203 // getPaca()->adjustHmtForNoOfSpinLocksHeld();
209 return retVal; 204 return retVal;
210
211} 205}
212 206
213#endif /* _HVCALLCFG_H */ 207#endif /* _HVCALLCFG_H */
diff --git a/include/asm-ppc64/iSeries/HvCallEvent.h b/include/asm-ppc64/iSeries/HvCallEvent.h
index 191ddce0c2c6..a5954785512d 100644
--- a/include/asm-ppc64/iSeries/HvCallEvent.h
+++ b/include/asm-ppc64/iSeries/HvCallEvent.h
@@ -1,32 +1,28 @@
1/* 1/*
2 * HvCallEvent.h 2 * HvCallEvent.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
20/* 19/*
21 * This file contains the "hypervisor call" interface which is used to 20 * This file contains the "hypervisor call" interface which is used to
22 * drive the hypervisor from the OS. 21 * drive the hypervisor from the OS.
23 */ 22 */
24#ifndef _HVCALLEVENT_H 23#ifndef _HVCALLEVENT_H
25#define _HVCALLEVENT_H 24#define _HVCALLEVENT_H
26 25
27/*
28 * Standard Includes
29 */
30#include <asm/iSeries/HvCallSc.h> 26#include <asm/iSeries/HvCallSc.h>
31#include <asm/iSeries/HvTypes.h> 27#include <asm/iSeries/HvTypes.h>
32#include <asm/abs_addr.h> 28#include <asm/abs_addr.h>
@@ -71,7 +67,7 @@ typedef u64 HvLpDma_Rc;
71#define HvCallEventCloseLpEventPath HvCallEvent + 2 67#define HvCallEventCloseLpEventPath HvCallEvent + 2
72#define HvCallEventDmaBufList HvCallEvent + 3 68#define HvCallEventDmaBufList HvCallEvent + 3
73#define HvCallEventDmaSingle HvCallEvent + 4 69#define HvCallEventDmaSingle HvCallEvent + 4
74#define HvCallEventDmaToSp HvCallEvent + 5 70#define HvCallEventDmaToSp HvCallEvent + 5
75#define HvCallEventGetOverflowLpEvents HvCallEvent + 6 71#define HvCallEventGetOverflowLpEvents HvCallEvent + 6
76#define HvCallEventGetSourceLpInstanceId HvCallEvent + 7 72#define HvCallEventGetSourceLpInstanceId HvCallEvent + 7
77#define HvCallEventGetTargetLpInstanceId HvCallEvent + 8 73#define HvCallEventGetTargetLpInstanceId HvCallEvent + 8
@@ -85,13 +81,13 @@ typedef u64 HvLpDma_Rc;
85 81
86static inline void HvCallEvent_getOverflowLpEvents(u8 queueIndex) 82static inline void HvCallEvent_getOverflowLpEvents(u8 queueIndex)
87{ 83{
88 HvCall1(HvCallEventGetOverflowLpEvents,queueIndex); 84 HvCall1(HvCallEventGetOverflowLpEvents, queueIndex);
89 // getPaca()->adjustHmtForNoOfSpinLocksHeld(); 85 // getPaca()->adjustHmtForNoOfSpinLocksHeld();
90} 86}
91 87
92static inline void HvCallEvent_setInterLpQueueIndex(u8 queueIndex) 88static inline void HvCallEvent_setInterLpQueueIndex(u8 queueIndex)
93{ 89{
94 HvCall1(HvCallEventSetInterLpQueueIndex,queueIndex); 90 HvCall1(HvCallEventSetInterLpQueueIndex, queueIndex);
95 // getPaca()->adjustHmtForNoOfSpinLocksHeld(); 91 // getPaca()->adjustHmtForNoOfSpinLocksHeld();
96} 92}
97 93
@@ -138,7 +134,7 @@ static inline HvLpEvent_Rc HvCallEvent_signalLpEventFast(HvLpIndex targetLp,
138{ 134{
139 HvLpEvent_Rc retVal; 135 HvLpEvent_Rc retVal;
140 136
141 // Pack the misc bits into a single Dword to pass to PLIC 137 /* Pack the misc bits into a single Dword to pass to PLIC */
142 union { 138 union {
143 struct HvCallEvent_PackedParms parms; 139 struct HvCallEvent_PackedParms parms;
144 u64 dword; 140 u64 dword;
@@ -225,7 +221,7 @@ static inline HvLpDma_Rc HvCallEvent_dmaBufList(HvLpEvent_Type type,
225 u64 localBufList, u64 remoteBufList, u32 transferLength) 221 u64 localBufList, u64 remoteBufList, u32 transferLength)
226{ 222{
227 HvLpDma_Rc retVal; 223 HvLpDma_Rc retVal;
228 // Pack the misc bits into a single Dword to pass to PLIC 224 /* Pack the misc bits into a single Dword to pass to PLIC */
229 union { 225 union {
230 struct HvCallEvent_PackedDmaParms parms; 226 struct HvCallEvent_PackedDmaParms parms;
231 u64 dword; 227 u64 dword;
@@ -257,7 +253,7 @@ static inline HvLpDma_Rc HvCallEvent_dmaSingle(HvLpEvent_Type type,
257 u64 localAddrOrTce, u64 remoteAddrOrTce, u32 transferLength) 253 u64 localAddrOrTce, u64 remoteAddrOrTce, u32 transferLength)
258{ 254{
259 HvLpDma_Rc retVal; 255 HvLpDma_Rc retVal;
260 // Pack the misc bits into a single Dword to pass to PLIC 256 /* Pack the misc bits into a single Dword to pass to PLIC */
261 union { 257 union {
262 struct HvCallEvent_PackedDmaParms parms; 258 struct HvCallEvent_PackedDmaParms parms;
263 u64 dword; 259 u64 dword;
@@ -280,7 +276,7 @@ static inline HvLpDma_Rc HvCallEvent_dmaSingle(HvLpEvent_Type type,
280 return retVal; 276 return retVal;
281} 277}
282 278
283static inline HvLpDma_Rc HvCallEvent_dmaToSp(void* local, u32 remote, 279static inline HvLpDma_Rc HvCallEvent_dmaToSp(void *local, u32 remote,
284 u32 length, HvLpDma_Direction dir) 280 u32 length, HvLpDma_Direction dir)
285{ 281{
286 u64 abs_addr; 282 u64 abs_addr;
@@ -293,5 +289,4 @@ static inline HvLpDma_Rc HvCallEvent_dmaToSp(void* local, u32 remote,
293 return retVal; 289 return retVal;
294} 290}
295 291
296
297#endif /* _HVCALLEVENT_H */ 292#endif /* _HVCALLEVENT_H */
diff --git a/include/asm-ppc64/iSeries/HvCallHpt.h b/include/asm-ppc64/iSeries/HvCallHpt.h
index da769873d18b..827d26c60fc1 100644
--- a/include/asm-ppc64/iSeries/HvCallHpt.h
+++ b/include/asm-ppc64/iSeries/HvCallHpt.h
@@ -1,17 +1,17 @@
1/* 1/*
2 * HvCallHpt.h 2 * HvCallHpt.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
@@ -19,21 +19,15 @@
19#ifndef _HVCALLHPT_H 19#ifndef _HVCALLHPT_H
20#define _HVCALLHPT_H 20#define _HVCALLHPT_H
21 21
22//============================================================================ 22/*
23// 23 * This file contains the "hypervisor call" interface which is used to
24// This file contains the "hypervisor call" interface which is used to 24 * drive the hypervisor from the OS.
25// drive the hypervisor from the OS. 25 */
26//
27//============================================================================
28 26
29#include <asm/iSeries/HvCallSc.h> 27#include <asm/iSeries/HvCallSc.h>
30#include <asm/iSeries/HvTypes.h> 28#include <asm/iSeries/HvTypes.h>
31#include <asm/mmu.h> 29#include <asm/mmu.h>
32 30
33//-----------------------------------------------------------------------------
34// Constants
35//-----------------------------------------------------------------------------
36
37#define HvCallHptGetHptAddress HvCallHpt + 0 31#define HvCallHptGetHptAddress HvCallHpt + 0
38#define HvCallHptGetHptPages HvCallHpt + 1 32#define HvCallHptGetHptPages HvCallHpt + 1
39#define HvCallHptSetPp HvCallHpt + 5 33#define HvCallHptSetPp HvCallHpt + 5
@@ -47,81 +41,76 @@
47#define HvCallHptInvalidateSetSwBitsGet HvCallHpt + 18 41#define HvCallHptInvalidateSetSwBitsGet HvCallHpt + 18
48 42
49 43
50//============================================================================ 44static inline u64 HvCallHpt_getHptAddress(void)
51static inline u64 HvCallHpt_getHptAddress(void)
52{ 45{
53 u64 retval = HvCall0(HvCallHptGetHptAddress); 46 u64 retval = HvCall0(HvCallHptGetHptAddress);
54 // getPaca()->adjustHmtForNoOfSpinLocksHeld(); 47 // getPaca()->adjustHmtForNoOfSpinLocksHeld();
55 return retval; 48 return retval;
56} 49}
57//============================================================================ 50
58static inline u64 HvCallHpt_getHptPages(void) 51static inline u64 HvCallHpt_getHptPages(void)
59{ 52{
60 u64 retval = HvCall0(HvCallHptGetHptPages); 53 u64 retval = HvCall0(HvCallHptGetHptPages);
61 // getPaca()->adjustHmtForNoOfSpinLocksHeld(); 54 // getPaca()->adjustHmtForNoOfSpinLocksHeld();
62 return retval; 55 return retval;
63} 56}
64//============================================================================= 57
65static inline void HvCallHpt_setPp(u32 hpteIndex, u8 value) 58static inline void HvCallHpt_setPp(u32 hpteIndex, u8 value)
66{ 59{
67 HvCall2( HvCallHptSetPp, hpteIndex, value ); 60 HvCall2(HvCallHptSetPp, hpteIndex, value);
68 // getPaca()->adjustHmtForNoOfSpinLocksHeld(); 61 // getPaca()->adjustHmtForNoOfSpinLocksHeld();
69} 62}
70//============================================================================= 63
71static inline void HvCallHpt_setSwBits(u32 hpteIndex, u8 bitson, u8 bitsoff ) 64static inline void HvCallHpt_setSwBits(u32 hpteIndex, u8 bitson, u8 bitsoff)
72{ 65{
73 HvCall3( HvCallHptSetSwBits, hpteIndex, bitson, bitsoff ); 66 HvCall3(HvCallHptSetSwBits, hpteIndex, bitson, bitsoff);
74 // getPaca()->adjustHmtForNoOfSpinLocksHeld(); 67 // getPaca()->adjustHmtForNoOfSpinLocksHeld();
75} 68}
76//============================================================================= 69
77static inline void HvCallHpt_invalidateNoSyncICache(u32 hpteIndex) 70static inline void HvCallHpt_invalidateNoSyncICache(u32 hpteIndex)
78
79{ 71{
80 HvCall1( HvCallHptInvalidateNoSyncICache, hpteIndex ); 72 HvCall1(HvCallHptInvalidateNoSyncICache, hpteIndex);
81 // getPaca()->adjustHmtForNoOfSpinLocksHeld(); 73 // getPaca()->adjustHmtForNoOfSpinLocksHeld();
82} 74}
83//============================================================================= 75
84static inline u64 HvCallHpt_invalidateSetSwBitsGet(u32 hpteIndex, u8 bitson, u8 bitsoff ) 76static inline u64 HvCallHpt_invalidateSetSwBitsGet(u32 hpteIndex, u8 bitson,
85 77 u8 bitsoff)
86{ 78{
87 u64 compressedStatus; 79 u64 compressedStatus;
88 compressedStatus = HvCall4( HvCallHptInvalidateSetSwBitsGet, hpteIndex, bitson, bitsoff, 1 ); 80
89 HvCall1( HvCallHptInvalidateNoSyncICache, hpteIndex ); 81 compressedStatus = HvCall4(HvCallHptInvalidateSetSwBitsGet,
82 hpteIndex, bitson, bitsoff, 1);
83 HvCall1(HvCallHptInvalidateNoSyncICache, hpteIndex);
90 // getPaca()->adjustHmtForNoOfSpinLocksHeld(); 84 // getPaca()->adjustHmtForNoOfSpinLocksHeld();
91 return compressedStatus; 85 return compressedStatus;
92} 86}
93//============================================================================= 87
94static inline u64 HvCallHpt_findValid( HPTE *hpte, u64 vpn ) 88static inline u64 HvCallHpt_findValid(HPTE *hpte, u64 vpn)
95{ 89{
96 u64 retIndex = HvCall3Ret16( HvCallHptFindValid, hpte, vpn, 0, 0 ); 90 u64 retIndex = HvCall3Ret16( HvCallHptFindValid, hpte, vpn, 0, 0 );
97 // getPaca()->adjustHmtForNoOfSpinLocksHeld(); 91 // getPaca()->adjustHmtForNoOfSpinLocksHeld();
98 return retIndex; 92 return retIndex;
99} 93}
100//============================================================================= 94
101static inline u64 HvCallHpt_findNextValid( HPTE *hpte, u32 hpteIndex, u8 bitson, u8 bitsoff ) 95static inline u64 HvCallHpt_findNextValid(HPTE *hpte, u32 hpteIndex,
96 u8 bitson, u8 bitsoff)
102{ 97{
103 u64 retIndex = HvCall3Ret16( HvCallHptFindNextValid, hpte, hpteIndex, bitson, bitsoff ); 98 u64 retIndex = HvCall3Ret16( HvCallHptFindNextValid, hpte, hpteIndex, bitson, bitsoff );
104 // getPaca()->adjustHmtForNoOfSpinLocksHeld(); 99 // getPaca()->adjustHmtForNoOfSpinLocksHeld();
105 return retIndex; 100 return retIndex;
106} 101}
107//============================================================================= 102
108static inline void HvCallHpt_get( HPTE *hpte, u32 hpteIndex ) 103static inline void HvCallHpt_get(HPTE *hpte, u32 hpteIndex)
109{ 104{
110 HvCall2Ret16( HvCallHptGet, hpte, hpteIndex, 0 ); 105 HvCall2Ret16(HvCallHptGet, hpte, hpteIndex, 0);
111 // getPaca()->adjustHmtForNoOfSpinLocksHeld(); 106 // getPaca()->adjustHmtForNoOfSpinLocksHeld();
112} 107}
113//============================================================================ 108
114static inline void HvCallHpt_addValidate( u32 hpteIndex, 109static inline void HvCallHpt_addValidate(u32 hpteIndex, u32 hBit, HPTE *hpte)
115 u32 hBit,
116 HPTE *hpte )
117
118{ 110{
119 HvCall4( HvCallHptAddValidate, hpteIndex, 111 HvCall4(HvCallHptAddValidate, hpteIndex, hBit, (*((u64 *)hpte)),
120 hBit, (*((u64 *)hpte)), (*(((u64 *)hpte)+1)) ); 112 (*(((u64 *)hpte)+1)));
121 // getPaca()->adjustHmtForNoOfSpinLocksHeld(); 113 // getPaca()->adjustHmtForNoOfSpinLocksHeld();
122} 114}
123 115
124
125//=============================================================================
126
127#endif /* _HVCALLHPT_H */ 116#endif /* _HVCALLHPT_H */
diff --git a/include/asm-ppc64/iSeries/HvCallPci.h b/include/asm-ppc64/iSeries/HvCallPci.h
index 6887b619288e..346ab5d39dcd 100644
--- a/include/asm-ppc64/iSeries/HvCallPci.h
+++ b/include/asm-ppc64/iSeries/HvCallPci.h
@@ -1,26 +1,26 @@
1/************************************************************************/ 1/*
2/* Provides the Hypervisor PCI calls for iSeries Linux Parition. */ 2 * Provides the Hypervisor PCI calls for iSeries Linux Parition.
3/* Copyright (C) 2001 <Wayne G Holm> <IBM Corporation> */ 3 * Copyright (C) 2001 <Wayne G Holm> <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: */ 16 * along with this program; if not, write to the:
17/* Free Software Foundation, Inc., */ 17 * Free Software Foundation, Inc.,
18/* 59 Temple Place, Suite 330, */ 18 * 59 Temple Place, Suite 330,
19/* Boston, MA 02111-1307 USA */ 19 * Boston, MA 02111-1307 USA
20/************************************************************************/ 20 *
21/* Change Activity: */ 21 * Change Activity:
22/* Created, Jan 9, 2001 */ 22 * Created, Jan 9, 2001
23/************************************************************************/ 23 */
24 24
25#ifndef _HVCALLPCI_H 25#ifndef _HVCALLPCI_H
26#define _HVCALLPCI_H 26#define _HVCALLPCI_H
@@ -34,8 +34,8 @@
34 */ 34 */
35struct HvCallPci_DsaAddr { 35struct HvCallPci_DsaAddr {
36 u16 busNumber; /* PHB index? */ 36 u16 busNumber; /* PHB index? */
37 u8 subBusNumber; /* PCI bus number? */ 37 u8 subBusNumber; /* PCI bus number? */
38 u8 deviceId; /* device and function? */ 38 u8 deviceId; /* device and function? */
39 u8 barNumber; 39 u8 barNumber;
40 u8 reserved[3]; 40 u8 reserved[3];
41}; 41};
@@ -52,34 +52,37 @@ struct HvCallPci_LoadReturn {
52 52
53enum HvCallPci_DeviceType { 53enum HvCallPci_DeviceType {
54 HvCallPci_NodeDevice = 1, 54 HvCallPci_NodeDevice = 1,
55 HvCallPci_SpDevice = 2, 55 HvCallPci_SpDevice = 2,
56 HvCallPci_IopDevice = 3, 56 HvCallPci_IopDevice = 3,
57 HvCallPci_BridgeDevice = 4, 57 HvCallPci_BridgeDevice = 4,
58 HvCallPci_MultiFunctionDevice = 5, 58 HvCallPci_MultiFunctionDevice = 5,
59 HvCallPci_IoaDevice = 6 59 HvCallPci_IoaDevice = 6
60}; 60};
61 61
62 62
63struct HvCallPci_DeviceInfo { 63struct HvCallPci_DeviceInfo {
64 u32 deviceType; // See DeviceType enum for values 64 u32 deviceType; /* See DeviceType enum for values */
65}; 65};
66 66
67struct HvCallPci_BusUnitInfo { 67struct HvCallPci_BusUnitInfo {
68 u32 sizeReturned; // length of data returned 68 u32 sizeReturned; /* length of data returned */
69 u32 deviceType; // see DeviceType enum for values 69 u32 deviceType; /* see DeviceType enum for values */
70}; 70};
71 71
72struct HvCallPci_BridgeInfo { 72struct HvCallPci_BridgeInfo {
73 struct HvCallPci_BusUnitInfo busUnitInfo; // Generic bus unit info 73 struct HvCallPci_BusUnitInfo busUnitInfo; /* Generic bus unit info */
74 u8 subBusNumber; // Bus number of secondary bus 74 u8 subBusNumber; /* Bus number of secondary bus */
75 u8 maxAgents; // Max idsels on secondary bus 75 u8 maxAgents; /* Max idsels on secondary bus */
76 u8 maxSubBusNumber; // Max Sub Bus 76 u8 maxSubBusNumber; /* Max Sub Bus */
77 u8 logicalSlotNumber; // Logical Slot Number for IOA 77 u8 logicalSlotNumber; /* Logical Slot Number for IOA */
78}; 78};
79
80 79
81// Maximum BusUnitInfo buffer size. Provided for clients so they can allocate 80
82// a buffer big enough for any type of bus unit. Increase as needed. 81/*
82 * Maximum BusUnitInfo buffer size. Provided for clients so
83 * they can allocate a buffer big enough for any type of bus
84 * unit. Increase as needed.
85 */
83enum {HvCallPci_MaxBusUnitInfoSize = 128}; 86enum {HvCallPci_MaxBusUnitInfoSize = 128};
84 87
85struct HvCallPci_BarParms { 88struct HvCallPci_BarParms {
@@ -89,12 +92,12 @@ struct HvCallPci_BarParms {
89 u64 protectStart; 92 u64 protectStart;
90 u64 protectEnd; 93 u64 protectEnd;
91 u64 relocationOffset; 94 u64 relocationOffset;
92 u64 pciAddress; 95 u64 pciAddress;
93 u64 reserved[3]; 96 u64 reserved[3];
94}; 97};
95 98
96enum HvCallPci_VpdType { 99enum HvCallPci_VpdType {
97 HvCallPci_BusVpd = 1, 100 HvCallPci_BusVpd = 1,
98 HvCallPci_BusAdapterVpd = 2 101 HvCallPci_BusAdapterVpd = 2
99}; 102};
100 103
@@ -123,15 +126,13 @@ enum HvCallPci_VpdType {
123#define HvCallPciUnmaskInterrupts HvCallPci + 49 126#define HvCallPciUnmaskInterrupts HvCallPci + 49
124#define HvCallPciGetBusUnitInfo HvCallPci + 50 127#define HvCallPciGetBusUnitInfo HvCallPci + 50
125 128
126//============================================================================
127static inline u64 HvCallPci_configLoad8(u16 busNumber, u8 subBusNumber, 129static inline u64 HvCallPci_configLoad8(u16 busNumber, u8 subBusNumber,
128 u8 deviceId, u32 offset, 130 u8 deviceId, u32 offset, u8 *value)
129 u8 *value)
130{ 131{
131 struct HvCallPci_DsaAddr dsa; 132 struct HvCallPci_DsaAddr dsa;
132 struct HvCallPci_LoadReturn retVal; 133 struct HvCallPci_LoadReturn retVal;
133 134
134 *((u64*)&dsa) = 0; 135 *((u64*)&dsa) = 0;
135 136
136 dsa.busNumber = busNumber; 137 dsa.busNumber = busNumber;
137 dsa.subBusNumber = subBusNumber; 138 dsa.subBusNumber = subBusNumber;
@@ -145,15 +146,14 @@ static inline u64 HvCallPci_configLoad8(u16 busNumber, u8 subBusNumber,
145 146
146 return retVal.rc; 147 return retVal.rc;
147} 148}
148//============================================================================ 149
149static inline u64 HvCallPci_configLoad16(u16 busNumber, u8 subBusNumber, 150static inline u64 HvCallPci_configLoad16(u16 busNumber, u8 subBusNumber,
150 u8 deviceId, u32 offset, 151 u8 deviceId, u32 offset, u16 *value)
151 u16 *value)
152{ 152{
153 struct HvCallPci_DsaAddr dsa; 153 struct HvCallPci_DsaAddr dsa;
154 struct HvCallPci_LoadReturn retVal; 154 struct HvCallPci_LoadReturn retVal;
155 155
156 *((u64*)&dsa) = 0; 156 *((u64*)&dsa) = 0;
157 157
158 dsa.busNumber = busNumber; 158 dsa.busNumber = busNumber;
159 dsa.subBusNumber = subBusNumber; 159 dsa.subBusNumber = subBusNumber;
@@ -167,15 +167,14 @@ static inline u64 HvCallPci_configLoad16(u16 busNumber, u8 subBusNumber,
167 167
168 return retVal.rc; 168 return retVal.rc;
169} 169}
170//============================================================================ 170
171static inline u64 HvCallPci_configLoad32(u16 busNumber, u8 subBusNumber, 171static inline u64 HvCallPci_configLoad32(u16 busNumber, u8 subBusNumber,
172 u8 deviceId, u32 offset, 172 u8 deviceId, u32 offset, u32 *value)
173 u32 *value)
174{ 173{
175 struct HvCallPci_DsaAddr dsa; 174 struct HvCallPci_DsaAddr dsa;
176 struct HvCallPci_LoadReturn retVal; 175 struct HvCallPci_LoadReturn retVal;
177 176
178 *((u64*)&dsa) = 0; 177 *((u64*)&dsa) = 0;
179 178
180 dsa.busNumber = busNumber; 179 dsa.busNumber = busNumber;
181 dsa.subBusNumber = subBusNumber; 180 dsa.subBusNumber = subBusNumber;
@@ -189,15 +188,14 @@ static inline u64 HvCallPci_configLoad32(u16 busNumber, u8 subBusNumber,
189 188
190 return retVal.rc; 189 return retVal.rc;
191} 190}
192//============================================================================ 191
193static inline u64 HvCallPci_configStore8(u16 busNumber, u8 subBusNumber, 192static inline u64 HvCallPci_configStore8(u16 busNumber, u8 subBusNumber,
194 u8 deviceId, u32 offset, 193 u8 deviceId, u32 offset, u8 value)
195 u8 value)
196{ 194{
197 struct HvCallPci_DsaAddr dsa; 195 struct HvCallPci_DsaAddr dsa;
198 u64 retVal; 196 u64 retVal;
199 197
200 *((u64*)&dsa) = 0; 198 *((u64*)&dsa) = 0;
201 199
202 dsa.busNumber = busNumber; 200 dsa.busNumber = busNumber;
203 dsa.subBusNumber = subBusNumber; 201 dsa.subBusNumber = subBusNumber;
@@ -209,15 +207,14 @@ static inline u64 HvCallPci_configStore8(u16 busNumber, u8 subBusNumber,
209 207
210 return retVal; 208 return retVal;
211} 209}
212//============================================================================ 210
213static inline u64 HvCallPci_configStore16(u16 busNumber, u8 subBusNumber, 211static inline u64 HvCallPci_configStore16(u16 busNumber, u8 subBusNumber,
214 u8 deviceId, u32 offset, 212 u8 deviceId, u32 offset, u16 value)
215 u16 value)
216{ 213{
217 struct HvCallPci_DsaAddr dsa; 214 struct HvCallPci_DsaAddr dsa;
218 u64 retVal; 215 u64 retVal;
219 216
220 *((u64*)&dsa) = 0; 217 *((u64*)&dsa) = 0;
221 218
222 dsa.busNumber = busNumber; 219 dsa.busNumber = busNumber;
223 dsa.subBusNumber = subBusNumber; 220 dsa.subBusNumber = subBusNumber;
@@ -229,15 +226,14 @@ static inline u64 HvCallPci_configStore16(u16 busNumber, u8 subBusNumber,
229 226
230 return retVal; 227 return retVal;
231} 228}
232//============================================================================ 229
233static inline u64 HvCallPci_configStore32(u16 busNumber, u8 subBusNumber, 230static inline u64 HvCallPci_configStore32(u16 busNumber, u8 subBusNumber,
234 u8 deviceId, u32 offset, 231 u8 deviceId, u32 offset, u32 value)
235 u32 value)
236{ 232{
237 struct HvCallPci_DsaAddr dsa; 233 struct HvCallPci_DsaAddr dsa;
238 u64 retVal; 234 u64 retVal;
239 235
240 *((u64*)&dsa) = 0; 236 *((u64*)&dsa) = 0;
241 237
242 dsa.busNumber = busNumber; 238 dsa.busNumber = busNumber;
243 dsa.subBusNumber = subBusNumber; 239 dsa.subBusNumber = subBusNumber;
@@ -249,18 +245,15 @@ static inline u64 HvCallPci_configStore32(u16 busNumber, u8 subBusNumber,
249 245
250 return retVal; 246 return retVal;
251} 247}
252//============================================================================ 248
253static inline u64 HvCallPci_barLoad8(u16 busNumberParm, 249static inline u64 HvCallPci_barLoad8(u16 busNumberParm, u8 subBusParm,
254 u8 subBusParm, 250 u8 deviceIdParm, u8 barNumberParm, u64 offsetParm,
255 u8 deviceIdParm, 251 u8 *valueParm)
256 u8 barNumberParm,
257 u64 offsetParm,
258 u8* valueParm)
259{ 252{
260 struct HvCallPci_DsaAddr dsa; 253 struct HvCallPci_DsaAddr dsa;
261 struct HvCallPci_LoadReturn retVal; 254 struct HvCallPci_LoadReturn retVal;
262 255
263 *((u64*)&dsa) = 0; 256 *((u64*)&dsa) = 0;
264 257
265 dsa.busNumber = busNumberParm; 258 dsa.busNumber = busNumberParm;
266 dsa.subBusNumber = subBusParm; 259 dsa.subBusNumber = subBusParm;
@@ -275,18 +268,15 @@ static inline u64 HvCallPci_barLoad8(u16 busNumberParm,
275 268
276 return retVal.rc; 269 return retVal.rc;
277} 270}
278//============================================================================ 271
279static inline u64 HvCallPci_barLoad16(u16 busNumberParm, 272static inline u64 HvCallPci_barLoad16(u16 busNumberParm, u8 subBusParm,
280 u8 subBusParm, 273 u8 deviceIdParm, u8 barNumberParm, u64 offsetParm,
281 u8 deviceIdParm, 274 u16 *valueParm)
282 u8 barNumberParm,
283 u64 offsetParm,
284 u16* valueParm)
285{ 275{
286 struct HvCallPci_DsaAddr dsa; 276 struct HvCallPci_DsaAddr dsa;
287 struct HvCallPci_LoadReturn retVal; 277 struct HvCallPci_LoadReturn retVal;
288 278
289 *((u64*)&dsa) = 0; 279 *((u64*)&dsa) = 0;
290 280
291 dsa.busNumber = busNumberParm; 281 dsa.busNumber = busNumberParm;
292 dsa.subBusNumber = subBusParm; 282 dsa.subBusNumber = subBusParm;
@@ -301,18 +291,15 @@ static inline u64 HvCallPci_barLoad16(u16 busNumberParm,
301 291
302 return retVal.rc; 292 return retVal.rc;
303} 293}
304//============================================================================ 294
305static inline u64 HvCallPci_barLoad32(u16 busNumberParm, 295static inline u64 HvCallPci_barLoad32(u16 busNumberParm, u8 subBusParm,
306 u8 subBusParm, 296 u8 deviceIdParm, u8 barNumberParm, u64 offsetParm,
307 u8 deviceIdParm, 297 u32 *valueParm)
308 u8 barNumberParm,
309 u64 offsetParm,
310 u32* valueParm)
311{ 298{
312 struct HvCallPci_DsaAddr dsa; 299 struct HvCallPci_DsaAddr dsa;
313 struct HvCallPci_LoadReturn retVal; 300 struct HvCallPci_LoadReturn retVal;
314 301
315 *((u64*)&dsa) = 0; 302 *((u64*)&dsa) = 0;
316 303
317 dsa.busNumber = busNumberParm; 304 dsa.busNumber = busNumberParm;
318 dsa.subBusNumber = subBusParm; 305 dsa.subBusNumber = subBusParm;
@@ -327,18 +314,15 @@ static inline u64 HvCallPci_barLoad32(u16 busNumberParm,
327 314
328 return retVal.rc; 315 return retVal.rc;
329} 316}
330//============================================================================ 317
331static inline u64 HvCallPci_barLoad64(u16 busNumberParm, 318static inline u64 HvCallPci_barLoad64(u16 busNumberParm, u8 subBusParm,
332 u8 subBusParm, 319 u8 deviceIdParm, u8 barNumberParm, u64 offsetParm,
333 u8 deviceIdParm, 320 u64 *valueParm)
334 u8 barNumberParm,
335 u64 offsetParm,
336 u64* valueParm)
337{ 321{
338 struct HvCallPci_DsaAddr dsa; 322 struct HvCallPci_DsaAddr dsa;
339 struct HvCallPci_LoadReturn retVal; 323 struct HvCallPci_LoadReturn retVal;
340 324
341 *((u64*)&dsa) = 0; 325 *((u64*)&dsa) = 0;
342 326
343 dsa.busNumber = busNumberParm; 327 dsa.busNumber = busNumberParm;
344 dsa.subBusNumber = subBusParm; 328 dsa.subBusNumber = subBusParm;
@@ -353,19 +337,16 @@ static inline u64 HvCallPci_barLoad64(u16 busNumberParm,
353 337
354 return retVal.rc; 338 return retVal.rc;
355} 339}
356//============================================================================ 340
357static inline u64 HvCallPci_barStore8(u16 busNumberParm, 341static inline u64 HvCallPci_barStore8(u16 busNumberParm, u8 subBusParm,
358 u8 subBusParm, 342 u8 deviceIdParm, u8 barNumberParm, u64 offsetParm,
359 u8 deviceIdParm, 343 u8 valueParm)
360 u8 barNumberParm,
361 u64 offsetParm,
362 u8 valueParm)
363{ 344{
364 struct HvCallPci_DsaAddr dsa; 345 struct HvCallPci_DsaAddr dsa;
365 u64 retVal; 346 u64 retVal;
366 347
367 *((u64*)&dsa) = 0; 348 *((u64*)&dsa) = 0;
368 349
369 dsa.busNumber = busNumberParm; 350 dsa.busNumber = busNumberParm;
370 dsa.subBusNumber = subBusParm; 351 dsa.subBusNumber = subBusParm;
371 dsa.deviceId = deviceIdParm; 352 dsa.deviceId = deviceIdParm;
@@ -377,19 +358,16 @@ static inline u64 HvCallPci_barStore8(u16 busNumberParm,
377 358
378 return retVal; 359 return retVal;
379} 360}
380//============================================================================ 361
381static inline u64 HvCallPci_barStore16(u16 busNumberParm, 362static inline u64 HvCallPci_barStore16(u16 busNumberParm, u8 subBusParm,
382 u8 subBusParm, 363 u8 deviceIdParm, u8 barNumberParm, u64 offsetParm,
383 u8 deviceIdParm, 364 u16 valueParm)
384 u8 barNumberParm,
385 u64 offsetParm,
386 u16 valueParm)
387{ 365{
388 struct HvCallPci_DsaAddr dsa; 366 struct HvCallPci_DsaAddr dsa;
389 u64 retVal; 367 u64 retVal;
390 368
391 *((u64*)&dsa) = 0; 369 *((u64*)&dsa) = 0;
392 370
393 dsa.busNumber = busNumberParm; 371 dsa.busNumber = busNumberParm;
394 dsa.subBusNumber = subBusParm; 372 dsa.subBusNumber = subBusParm;
395 dsa.deviceId = deviceIdParm; 373 dsa.deviceId = deviceIdParm;
@@ -401,19 +379,16 @@ static inline u64 HvCallPci_barStore16(u16 busNumberParm,
401 379
402 return retVal; 380 return retVal;
403} 381}
404//============================================================================ 382
405static inline u64 HvCallPci_barStore32(u16 busNumberParm, 383static inline u64 HvCallPci_barStore32(u16 busNumberParm, u8 subBusParm,
406 u8 subBusParm, 384 u8 deviceIdParm, u8 barNumberParm, u64 offsetParm,
407 u8 deviceIdParm, 385 u32 valueParm)
408 u8 barNumberParm,
409 u64 offsetParm,
410 u32 valueParm)
411{ 386{
412 struct HvCallPci_DsaAddr dsa; 387 struct HvCallPci_DsaAddr dsa;
413 u64 retVal; 388 u64 retVal;
414 389
415 *((u64*)&dsa) = 0; 390 *((u64*)&dsa) = 0;
416 391
417 dsa.busNumber = busNumberParm; 392 dsa.busNumber = busNumberParm;
418 dsa.subBusNumber = subBusParm; 393 dsa.subBusNumber = subBusParm;
419 dsa.deviceId = deviceIdParm; 394 dsa.deviceId = deviceIdParm;
@@ -425,19 +400,16 @@ static inline u64 HvCallPci_barStore32(u16 busNumberParm,
425 400
426 return retVal; 401 return retVal;
427} 402}
428//============================================================================ 403
429static inline u64 HvCallPci_barStore64(u16 busNumberParm, 404static inline u64 HvCallPci_barStore64(u16 busNumberParm, u8 subBusParm,
430 u8 subBusParm, 405 u8 deviceIdParm, u8 barNumberParm, u64 offsetParm,
431 u8 deviceIdParm, 406 u64 valueParm)
432 u8 barNumberParm,
433 u64 offsetParm,
434 u64 valueParm)
435{ 407{
436 struct HvCallPci_DsaAddr dsa; 408 struct HvCallPci_DsaAddr dsa;
437 u64 retVal; 409 u64 retVal;
438 410
439 *((u64*)&dsa) = 0; 411 *((u64*)&dsa) = 0;
440 412
441 dsa.busNumber = busNumberParm; 413 dsa.busNumber = busNumberParm;
442 dsa.subBusNumber = subBusParm; 414 dsa.subBusNumber = subBusParm;
443 dsa.deviceId = deviceIdParm; 415 dsa.deviceId = deviceIdParm;
@@ -449,10 +421,9 @@ static inline u64 HvCallPci_barStore64(u16 busNumberParm,
449 421
450 return retVal; 422 return retVal;
451} 423}
452//============================================================================ 424
453static inline u64 HvCallPci_eoi(u16 busNumberParm, 425static inline u64 HvCallPci_eoi(u16 busNumberParm, u8 subBusParm,
454 u8 subBusParm, 426 u8 deviceIdParm)
455 u8 deviceIdParm)
456{ 427{
457 struct HvCallPci_DsaAddr dsa; 428 struct HvCallPci_DsaAddr dsa;
458 struct HvCallPci_LoadReturn retVal; 429 struct HvCallPci_LoadReturn retVal;
@@ -469,13 +440,9 @@ static inline u64 HvCallPci_eoi(u16 busNumberParm,
469 440
470 return retVal.rc; 441 return retVal.rc;
471} 442}
472//============================================================================ 443
473static inline u64 HvCallPci_getBarParms(u16 busNumberParm, 444static inline u64 HvCallPci_getBarParms(u16 busNumberParm, u8 subBusParm,
474 u8 subBusParm, 445 u8 deviceIdParm, u8 barNumberParm, u64 parms, u32 sizeofParms)
475 u8 deviceIdParm,
476 u8 barNumberParm,
477 u64 parms,
478 u32 sizeofParms)
479{ 446{
480 struct HvCallPci_DsaAddr dsa; 447 struct HvCallPci_DsaAddr dsa;
481 u64 retVal; 448 u64 retVal;
@@ -493,16 +460,14 @@ static inline u64 HvCallPci_getBarParms(u16 busNumberParm,
493 460
494 return retVal; 461 return retVal;
495} 462}
496//============================================================================ 463
497static inline u64 HvCallPci_maskFisr(u16 busNumberParm, 464static inline u64 HvCallPci_maskFisr(u16 busNumberParm, u8 subBusParm,
498 u8 subBusParm, 465 u8 deviceIdParm, u64 fisrMask)
499 u8 deviceIdParm,
500 u64 fisrMask)
501{ 466{
502 struct HvCallPci_DsaAddr dsa; 467 struct HvCallPci_DsaAddr dsa;
503 u64 retVal; 468 u64 retVal;
504 469
505 *((u64*)&dsa) = 0; 470 *((u64*)&dsa) = 0;
506 471
507 dsa.busNumber = busNumberParm; 472 dsa.busNumber = busNumberParm;
508 dsa.subBusNumber = subBusParm; 473 dsa.subBusNumber = subBusParm;
@@ -514,16 +479,14 @@ static inline u64 HvCallPci_maskFisr(u16 busNumberParm,
514 479
515 return retVal; 480 return retVal;
516} 481}
517//============================================================================ 482
518static inline u64 HvCallPci_unmaskFisr(u16 busNumberParm, 483static inline u64 HvCallPci_unmaskFisr(u16 busNumberParm, u8 subBusParm,
519 u8 subBusParm, 484 u8 deviceIdParm, u64 fisrMask)
520 u8 deviceIdParm,
521 u64 fisrMask)
522{ 485{
523 struct HvCallPci_DsaAddr dsa; 486 struct HvCallPci_DsaAddr dsa;
524 u64 retVal; 487 u64 retVal;
525 488
526 *((u64*)&dsa) = 0; 489 *((u64*)&dsa) = 0;
527 490
528 dsa.busNumber = busNumberParm; 491 dsa.busNumber = busNumberParm;
529 dsa.subBusNumber = subBusParm; 492 dsa.subBusNumber = subBusParm;
@@ -535,11 +498,9 @@ static inline u64 HvCallPci_unmaskFisr(u16 busNumberParm,
535 498
536 return retVal; 499 return retVal;
537} 500}
538//============================================================================ 501
539static inline u64 HvCallPci_setSlotReset(u16 busNumberParm, 502static inline u64 HvCallPci_setSlotReset(u16 busNumberParm, u8 subBusParm,
540 u8 subBusParm, 503 u8 deviceIdParm, u64 onNotOff)
541 u8 deviceIdParm,
542 u64 onNotOff)
543{ 504{
544 struct HvCallPci_DsaAddr dsa; 505 struct HvCallPci_DsaAddr dsa;
545 u64 retVal; 506 u64 retVal;
@@ -556,12 +517,9 @@ static inline u64 HvCallPci_setSlotReset(u16 busNumberParm,
556 517
557 return retVal; 518 return retVal;
558} 519}
559//============================================================================ 520
560static inline u64 HvCallPci_getDeviceInfo(u16 busNumberParm, 521static inline u64 HvCallPci_getDeviceInfo(u16 busNumberParm, u8 subBusParm,
561 u8 subBusParm, 522 u8 deviceNumberParm, u64 parms, u32 sizeofParms)
562 u8 deviceNumberParm,
563 u64 parms,
564 u32 sizeofParms)
565{ 523{
566 struct HvCallPci_DsaAddr dsa; 524 struct HvCallPci_DsaAddr dsa;
567 u64 retVal; 525 u64 retVal;
@@ -578,16 +536,14 @@ static inline u64 HvCallPci_getDeviceInfo(u16 busNumberParm,
578 536
579 return retVal; 537 return retVal;
580} 538}
581//============================================================================ 539
582static inline u64 HvCallPci_maskInterrupts(u16 busNumberParm, 540static inline u64 HvCallPci_maskInterrupts(u16 busNumberParm, u8 subBusParm,
583 u8 subBusParm, 541 u8 deviceIdParm, u64 interruptMask)
584 u8 deviceIdParm,
585 u64 interruptMask)
586{ 542{
587 struct HvCallPci_DsaAddr dsa; 543 struct HvCallPci_DsaAddr dsa;
588 u64 retVal; 544 u64 retVal;
589 545
590 *((u64*)&dsa) = 0; 546 *((u64*)&dsa) = 0;
591 547
592 dsa.busNumber = busNumberParm; 548 dsa.busNumber = busNumberParm;
593 dsa.subBusNumber = subBusParm; 549 dsa.subBusNumber = subBusParm;
@@ -599,16 +555,14 @@ static inline u64 HvCallPci_maskInterrupts(u16 busNumberParm,
599 555
600 return retVal; 556 return retVal;
601} 557}
602//============================================================================ 558
603static inline u64 HvCallPci_unmaskInterrupts(u16 busNumberParm, 559static inline u64 HvCallPci_unmaskInterrupts(u16 busNumberParm, u8 subBusParm,
604 u8 subBusParm, 560 u8 deviceIdParm, u64 interruptMask)
605 u8 deviceIdParm,
606 u64 interruptMask)
607{ 561{
608 struct HvCallPci_DsaAddr dsa; 562 struct HvCallPci_DsaAddr dsa;
609 u64 retVal; 563 u64 retVal;
610 564
611 *((u64*)&dsa) = 0; 565 *((u64*)&dsa) = 0;
612 566
613 dsa.busNumber = busNumberParm; 567 dsa.busNumber = busNumberParm;
614 dsa.subBusNumber = subBusParm; 568 dsa.subBusNumber = subBusParm;
@@ -620,18 +574,14 @@ static inline u64 HvCallPci_unmaskInterrupts(u16 busNumberParm,
620 574
621 return retVal; 575 return retVal;
622} 576}
623//============================================================================
624 577
625static inline u64 HvCallPci_getBusUnitInfo(u16 busNumberParm, 578static inline u64 HvCallPci_getBusUnitInfo(u16 busNumberParm, u8 subBusParm,
626 u8 subBusParm, 579 u8 deviceIdParm, u64 parms, u32 sizeofParms)
627 u8 deviceIdParm,
628 u64 parms,
629 u32 sizeofParms)
630{ 580{
631 struct HvCallPci_DsaAddr dsa; 581 struct HvCallPci_DsaAddr dsa;
632 u64 retVal; 582 u64 retVal;
633 583
634 *((u64*)&dsa) = 0; 584 *((u64*)&dsa) = 0;
635 585
636 dsa.busNumber = busNumberParm; 586 dsa.busNumber = busNumberParm;
637 dsa.subBusNumber = subBusParm; 587 dsa.subBusNumber = subBusParm;
@@ -643,9 +593,9 @@ static inline u64 HvCallPci_getBusUnitInfo(u16 busNumberParm,
643 593
644 return retVal; 594 return retVal;
645} 595}
646//============================================================================
647 596
648static inline int HvCallPci_getBusVpd(u16 busNumParm, u64 destParm, u16 sizeParm) 597static inline int HvCallPci_getBusVpd(u16 busNumParm, u64 destParm,
598 u16 sizeParm)
649{ 599{
650 int xRetSize; 600 int xRetSize;
651 u64 xRc = HvCall4(HvCallPciGetCardVpd, busNumParm, destParm, sizeParm, HvCallPci_BusVpd); 601 u64 xRc = HvCall4(HvCallPciGetCardVpd, busNumParm, destParm, sizeParm, HvCallPci_BusVpd);
@@ -656,9 +606,9 @@ static inline int HvCallPci_getBusVpd(u16 busNumParm, u64 destParm, u16 sizeParm
656 xRetSize = xRc & 0xFFFF; 606 xRetSize = xRc & 0xFFFF;
657 return xRetSize; 607 return xRetSize;
658} 608}
659//============================================================================
660 609
661static inline int HvCallPci_getBusAdapterVpd(u16 busNumParm, u64 destParm, u16 sizeParm) 610static inline int HvCallPci_getBusAdapterVpd(u16 busNumParm, u64 destParm,
611 u16 sizeParm)
662{ 612{
663 int xRetSize; 613 int xRetSize;
664 u64 xRc = HvCall4(HvCallPciGetCardVpd, busNumParm, destParm, sizeParm, HvCallPci_BusAdapterVpd); 614 u64 xRc = HvCall4(HvCallPciGetCardVpd, busNumParm, destParm, sizeParm, HvCallPci_BusAdapterVpd);
@@ -669,5 +619,5 @@ static inline int HvCallPci_getBusAdapterVpd(u16 busNumParm, u64 destParm, u16 s
669 xRetSize = xRc & 0xFFFF; 619 xRetSize = xRc & 0xFFFF;
670 return xRetSize; 620 return xRetSize;
671} 621}
672//============================================================================ 622
673#endif /* _HVCALLPCI_H */ 623#endif /* _HVCALLPCI_H */
diff --git a/include/asm-ppc64/iSeries/HvCallSc.h b/include/asm-ppc64/iSeries/HvCallSc.h
index eea258447642..c32145f9ec75 100644
--- a/include/asm-ppc64/iSeries/HvCallSc.h
+++ b/include/asm-ppc64/iSeries/HvCallSc.h
@@ -1,17 +1,17 @@
1/* 1/*
2 * HvCallSc.h 2 * HvCallSc.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
@@ -30,22 +30,22 @@
30#define HvCallSm 0x8007000000000000ul 30#define HvCallSm 0x8007000000000000ul
31#define HvCallXm 0x8009000000000000ul 31#define HvCallXm 0x8009000000000000ul
32 32
33u64 HvCall0( u64 ); 33u64 HvCall0(u64);
34u64 HvCall1( u64, u64 ); 34u64 HvCall1(u64, u64);
35u64 HvCall2( u64, u64, u64 ); 35u64 HvCall2(u64, u64, u64);
36u64 HvCall3( u64, u64, u64, u64 ); 36u64 HvCall3(u64, u64, u64, u64);
37u64 HvCall4( u64, u64, u64, u64, u64 ); 37u64 HvCall4(u64, u64, u64, u64, u64);
38u64 HvCall5( u64, u64, u64, u64, u64, u64 ); 38u64 HvCall5(u64, u64, u64, u64, u64, u64);
39u64 HvCall6( u64, u64, u64, u64, u64, u64, u64 ); 39u64 HvCall6(u64, u64, u64, u64, u64, u64, u64);
40u64 HvCall7( u64, u64, u64, u64, u64, u64, u64, u64 ); 40u64 HvCall7(u64, u64, u64, u64, u64, u64, u64, u64);
41 41
42u64 HvCall0Ret16( u64, void * ); 42u64 HvCall0Ret16(u64, void *);
43u64 HvCall1Ret16( u64, void *, u64 ); 43u64 HvCall1Ret16(u64, void *, u64);
44u64 HvCall2Ret16( u64, void *, u64, u64 ); 44u64 HvCall2Ret16(u64, void *, u64, u64);
45u64 HvCall3Ret16( u64, void *, u64, u64, u64 ); 45u64 HvCall3Ret16(u64, void *, u64, u64, u64);
46u64 HvCall4Ret16( u64, void *, u64, u64, u64, u64 ); 46u64 HvCall4Ret16(u64, void *, u64, u64, u64, u64);
47u64 HvCall5Ret16( u64, void *, u64, u64, u64, u64, u64 ); 47u64 HvCall5Ret16(u64, void *, u64, u64, u64, u64, u64);
48u64 HvCall6Ret16( u64, void *, u64, u64, u64, u64, u64, u64 ); 48u64 HvCall6Ret16(u64, void *, u64, u64, u64, u64, u64, u64);
49u64 HvCall7Ret16( u64, void *, u64, u64 ,u64 ,u64 ,u64 ,u64 ,u64 ); 49u64 HvCall7Ret16(u64, void *, u64, u64 ,u64 ,u64 ,u64 ,u64 ,u64);
50 50
51#endif /* _HVCALLSC_H */ 51#endif /* _HVCALLSC_H */
diff --git a/include/asm-ppc64/iSeries/HvCallSm.h b/include/asm-ppc64/iSeries/HvCallSm.h
index 9050c94a529d..ef6b303e4d28 100644
--- a/include/asm-ppc64/iSeries/HvCallSm.h
+++ b/include/asm-ppc64/iSeries/HvCallSm.h
@@ -1,17 +1,17 @@
1/* 1/*
2 * HvCallSm.h 2 * HvCallSm.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
@@ -19,34 +19,23 @@
19#ifndef _HVCALLSM_H 19#ifndef _HVCALLSM_H
20#define _HVCALLSM_H 20#define _HVCALLSM_H
21 21
22//============================================================================ 22/*
23// 23 * This file contains the "hypervisor call" interface which is used to
24// This file contains the "hypervisor call" interface which is used to 24 * drive the hypervisor from the OS.
25// drive the hypervisor from the OS. 25 */
26//
27//============================================================================
28 26
29//-------------------------------------------------------------------
30// Standard Includes
31//-------------------------------------------------------------------
32#include <asm/iSeries/HvCallSc.h> 27#include <asm/iSeries/HvCallSc.h>
33#include <asm/iSeries/HvTypes.h> 28#include <asm/iSeries/HvTypes.h>
34 29
35//-----------------------------------------------------------------------------
36// Constants
37//-----------------------------------------------------------------------------
38
39#define HvCallSmGet64BitsOfAccessMap HvCallSm + 11 30#define HvCallSmGet64BitsOfAccessMap HvCallSm + 11
40 31
41 32static inline u64 HvCallSm_get64BitsOfAccessMap(HvLpIndex lpIndex,
42//============================================================================ 33 u64 indexIntoBitMap)
43static inline u64 HvCallSm_get64BitsOfAccessMap(
44 HvLpIndex lpIndex, u64 indexIntoBitMap )
45{ 34{
46 u64 retval = HvCall2(HvCallSmGet64BitsOfAccessMap, lpIndex, 35 u64 retval = HvCall2(HvCallSmGet64BitsOfAccessMap, lpIndex,
47 indexIntoBitMap ); 36 indexIntoBitMap );
48 // getPaca()->adjustHmtForNoOfSpinLocksHeld(); 37 // getPaca()->adjustHmtForNoOfSpinLocksHeld();
49 return retval; 38 return retval;
50} 39}
51//============================================================================ 40
52#endif /* _HVCALLSM_H */ 41#endif /* _HVCALLSM_H */
diff --git a/include/asm-ppc64/iSeries/HvCallXm.h b/include/asm-ppc64/iSeries/HvCallXm.h
index bfb898f4db8d..a99f29b93611 100644
--- a/include/asm-ppc64/iSeries/HvCallXm.h
+++ b/include/asm-ppc64/iSeries/HvCallXm.h
@@ -1,30 +1,13 @@
1//============================================================================ 1/*
2// Header File Id 2 * This file contains the "hypervisor call" interface which is used to
3// Name______________: HvCallXm.H 3 * drive the hypervisor from SLIC.
4// 4 */
5// Description_______:
6//
7// This file contains the "hypervisor call" interface which is used to
8// drive the hypervisor from SLIC.
9//
10//============================================================================
11#ifndef _HVCALLXM_H 5#ifndef _HVCALLXM_H
12#define _HVCALLXM_H 6#define _HVCALLXM_H
13 7
14//-------------------------------------------------------------------
15// Forward declarations
16//-------------------------------------------------------------------
17
18//-------------------------------------------------------------------
19// Standard Includes
20//-------------------------------------------------------------------
21#include <asm/iSeries/HvCallSc.h> 8#include <asm/iSeries/HvCallSc.h>
22#include <asm/iSeries/HvTypes.h> 9#include <asm/iSeries/HvTypes.h>
23 10
24//-----------------------------------------------------------------------------
25// Constants
26//-----------------------------------------------------------------------------
27
28#define HvCallXmGetTceTableParms HvCallXm + 0 11#define HvCallXmGetTceTableParms HvCallXm + 0
29#define HvCallXmTestBus HvCallXm + 1 12#define HvCallXmTestBus HvCallXm + 1
30#define HvCallXmConnectBusUnit HvCallXm + 2 13#define HvCallXmConnectBusUnit HvCallXm + 2
@@ -33,47 +16,46 @@
33#define HvCallXmSetTce HvCallXm + 11 16#define HvCallXmSetTce HvCallXm + 11
34#define HvCallXmSetTces HvCallXm + 13 17#define HvCallXmSetTces HvCallXm + 13
35 18
36 19static inline void HvCallXm_getTceTableParms(u64 cb)
37
38//============================================================================
39static inline void HvCallXm_getTceTableParms(u64 cb)
40{ 20{
41 HvCall1(HvCallXmGetTceTableParms, cb); 21 HvCall1(HvCallXmGetTceTableParms, cb);
42 // getPaca()->adjustHmtForNoOfSpinLocksHeld(); 22 // getPaca()->adjustHmtForNoOfSpinLocksHeld();
43} 23}
44//============================================================================ 24
45static inline u64 HvCallXm_setTce(u64 tceTableToken, u64 tceOffset, u64 tce) 25static inline u64 HvCallXm_setTce(u64 tceTableToken, u64 tceOffset, u64 tce)
46{ 26{
47 u64 retval = HvCall3(HvCallXmSetTce, tceTableToken, tceOffset, tce ); 27 u64 retval = HvCall3(HvCallXmSetTce, tceTableToken, tceOffset, tce );
48 // getPaca()->adjustHmtForNoOfSpinLocksHeld(); 28 // getPaca()->adjustHmtForNoOfSpinLocksHeld();
49 return retval; 29 return retval;
50} 30}
51//============================================================================ 31
52static inline u64 HvCallXm_setTces(u64 tceTableToken, u64 tceOffset, u64 numTces, u64 tce1, u64 tce2, u64 tce3, u64 tce4) 32static inline u64 HvCallXm_setTces(u64 tceTableToken, u64 tceOffset,
53{ 33 u64 numTces, u64 tce1, u64 tce2, u64 tce3, u64 tce4)
34{
54 u64 retval = HvCall7(HvCallXmSetTces, tceTableToken, tceOffset, numTces, 35 u64 retval = HvCall7(HvCallXmSetTces, tceTableToken, tceOffset, numTces,
55 tce1, tce2, tce3, tce4 ); 36 tce1, tce2, tce3, tce4 );
56 // getPaca()->adjustHmtForNoOfSpinLocksHeld(); 37 // getPaca()->adjustHmtForNoOfSpinLocksHeld();
57 return retval; 38 return retval;
58} 39}
59//============================================================================= 40
60static inline u64 HvCallXm_testBus(u16 busNumber) 41static inline u64 HvCallXm_testBus(u16 busNumber)
61{ 42{
62 u64 retVal = HvCall1(HvCallXmTestBus, busNumber); 43 u64 retVal = HvCall1(HvCallXmTestBus, busNumber);
63 // getPaca()->adjustHmtForNoOfSpinLocksHeld(); 44 // getPaca()->adjustHmtForNoOfSpinLocksHeld();
64 return retVal; 45 return retVal;
65} 46}
66//===================================================================================== 47
67static inline u64 HvCallXm_testBusUnit(u16 busNumber, u8 subBusNumber, u8 deviceId) 48static inline u64 HvCallXm_testBusUnit(u16 busNumber, u8 subBusNumber,
49 u8 deviceId)
68{ 50{
69 u64 busUnitNumber = (subBusNumber << 8) | deviceId; 51 u64 busUnitNumber = (subBusNumber << 8) | deviceId;
70 u64 retVal = HvCall2(HvCallXmTestBusUnit, busNumber, busUnitNumber); 52 u64 retVal = HvCall2(HvCallXmTestBusUnit, busNumber, busUnitNumber);
71 // getPaca()->adjustHmtForNoOfSpinLocksHeld(); 53 // getPaca()->adjustHmtForNoOfSpinLocksHeld();
72 return retVal; 54 return retVal;
73} 55}
74//===================================================================================== 56
75static inline u64 HvCallXm_connectBusUnit(u16 busNumber, u8 subBusNumber, u8 deviceId, 57static inline u64 HvCallXm_connectBusUnit(u16 busNumber, u8 subBusNumber,
76 u64 interruptToken) 58 u8 deviceId, u64 interruptToken)
77{ 59{
78 u64 busUnitNumber = (subBusNumber << 8) | deviceId; 60 u64 busUnitNumber = (subBusNumber << 8) | deviceId;
79 u64 queueIndex = 0; // HvLpConfig::mapDsaToQueueIndex(HvLpDSA(busNumber, xBoard, xCard)); 61 u64 queueIndex = 0; // HvLpConfig::mapDsaToQueueIndex(HvLpDSA(busNumber, xBoard, xCard));
@@ -83,13 +65,12 @@ static inline u64 HvCallXm_connectBusUnit(u16 busNumber, u8 subBusNumber, u8 dev
83 // getPaca()->adjustHmtForNoOfSpinLocksHeld(); 65 // getPaca()->adjustHmtForNoOfSpinLocksHeld();
84 return retVal; 66 return retVal;
85} 67}
86//===================================================================================== 68
87static inline u64 HvCallXm_loadTod(void) 69static inline u64 HvCallXm_loadTod(void)
88{ 70{
89 u64 retVal = HvCall0(HvCallXmLoadTod); 71 u64 retVal = HvCall0(HvCallXmLoadTod);
90 // getPaca()->adjustHmtForNoOfSpinLocksHeld(); 72 // getPaca()->adjustHmtForNoOfSpinLocksHeld();
91 return retVal; 73 return retVal;
92} 74}
93//=====================================================================================
94 75
95#endif /* _HVCALLXM_H */ 76#endif /* _HVCALLXM_H */
diff --git a/include/asm-ppc64/iSeries/HvLpConfig.h b/include/asm-ppc64/iSeries/HvLpConfig.h
index bdbd70f42c9d..47311cc952d9 100644
--- a/include/asm-ppc64/iSeries/HvLpConfig.h
+++ b/include/asm-ppc64/iSeries/HvLpConfig.h
@@ -1,17 +1,17 @@
1/* 1/*
2 * HvLpConfig.h 2 * HvLpConfig.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
@@ -19,262 +19,285 @@
19#ifndef _HVLPCONFIG_H 19#ifndef _HVLPCONFIG_H
20#define _HVLPCONFIG_H 20#define _HVLPCONFIG_H
21 21
22//=========================================================================== 22/*
23// 23 * This file contains the interface to the LPAR configuration data
24// This file contains the interface to the LPAR configuration data 24 * to determine which resources should be allocated to each partition.
25// to determine which resources should be allocated to each partition. 25 */
26//
27//===========================================================================
28 26
29#include <asm/iSeries/HvCallCfg.h> 27#include <asm/iSeries/HvCallCfg.h>
30#include <asm/iSeries/HvTypes.h> 28#include <asm/iSeries/HvTypes.h>
31#include <asm/iSeries/ItLpNaca.h> 29#include <asm/iSeries/ItLpNaca.h>
32#include <asm/iSeries/LparData.h> 30#include <asm/iSeries/LparData.h>
33 31
34//-------------------------------------------------------------------
35// Constants
36//-------------------------------------------------------------------
37
38extern HvLpIndex HvLpConfig_getLpIndex_outline(void); 32extern HvLpIndex HvLpConfig_getLpIndex_outline(void);
39 33
40//===================================================================
41static inline HvLpIndex HvLpConfig_getLpIndex(void) 34static inline HvLpIndex HvLpConfig_getLpIndex(void)
42{ 35{
43 return itLpNaca.xLpIndex; 36 return itLpNaca.xLpIndex;
44} 37}
45//=================================================================== 38
46static inline HvLpIndex HvLpConfig_getPrimaryLpIndex(void) 39static inline HvLpIndex HvLpConfig_getPrimaryLpIndex(void)
47{ 40{
48 return itLpNaca.xPrimaryLpIndex; 41 return itLpNaca.xPrimaryLpIndex;
49} 42}
50//================================================================= 43
51static inline HvLpIndex HvLpConfig_getLps(void) 44static inline HvLpIndex HvLpConfig_getLps(void)
52{ 45{
53 return HvCallCfg_getLps(); 46 return HvCallCfg_getLps();
54} 47}
55//================================================================= 48
56static inline HvLpIndexMap HvLpConfig_getActiveLpMap(void) 49static inline HvLpIndexMap HvLpConfig_getActiveLpMap(void)
57{ 50{
58 return HvCallCfg_getActiveLpMap(); 51 return HvCallCfg_getActiveLpMap();
59} 52}
60//================================================================= 53
61static inline u64 HvLpConfig_getSystemMsMegs(void) 54static inline u64 HvLpConfig_getSystemMsMegs(void)
62{ 55{
63 return HvCallCfg_getSystemMsChunks() / HVCHUNKSPERMEG; 56 return HvCallCfg_getSystemMsChunks() / HVCHUNKSPERMEG;
64} 57}
65//================================================================= 58
66static inline u64 HvLpConfig_getSystemMsChunks(void) 59static inline u64 HvLpConfig_getSystemMsChunks(void)
67{ 60{
68 return HvCallCfg_getSystemMsChunks(); 61 return HvCallCfg_getSystemMsChunks();
69} 62}
70//================================================================= 63
71static inline u64 HvLpConfig_getSystemMsPages(void) 64static inline u64 HvLpConfig_getSystemMsPages(void)
72{ 65{
73 return HvCallCfg_getSystemMsChunks() * HVPAGESPERCHUNK; 66 return HvCallCfg_getSystemMsChunks() * HVPAGESPERCHUNK;
74} 67}
75//================================================================ 68
76static inline u64 HvLpConfig_getMsMegs(void) 69static inline u64 HvLpConfig_getMsMegs(void)
77{ 70{
78 return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(),HvCallCfg_Cur) / HVCHUNKSPERMEG; 71 return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(), HvCallCfg_Cur)
72 / HVCHUNKSPERMEG;
79} 73}
80//================================================================ 74
81static inline u64 HvLpConfig_getMsChunks(void) 75static inline u64 HvLpConfig_getMsChunks(void)
82{ 76{
83 return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(),HvCallCfg_Cur); 77 return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(), HvCallCfg_Cur);
84} 78}
85//================================================================ 79
86static inline u64 HvLpConfig_getMsPages(void) 80static inline u64 HvLpConfig_getMsPages(void)
87{ 81{
88 return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(),HvCallCfg_Cur) * HVPAGESPERCHUNK; 82 return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(), HvCallCfg_Cur)
83 * HVPAGESPERCHUNK;
89} 84}
90//================================================================ 85
91static inline u64 HvLpConfig_getMinMsMegs(void) 86static inline u64 HvLpConfig_getMinMsMegs(void)
92{ 87{
93 return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(),HvCallCfg_Min) / HVCHUNKSPERMEG; 88 return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(), HvCallCfg_Min)
89 / HVCHUNKSPERMEG;
94} 90}
95//================================================================ 91
96static inline u64 HvLpConfig_getMinMsChunks(void) 92static inline u64 HvLpConfig_getMinMsChunks(void)
97{ 93{
98 return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(),HvCallCfg_Min); 94 return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(), HvCallCfg_Min);
99} 95}
100//================================================================ 96
101static inline u64 HvLpConfig_getMinMsPages(void) 97static inline u64 HvLpConfig_getMinMsPages(void)
102{ 98{
103 return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(),HvCallCfg_Min) * HVPAGESPERCHUNK; 99 return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(), HvCallCfg_Min)
100 * HVPAGESPERCHUNK;
104} 101}
105//================================================================ 102
106static inline u64 HvLpConfig_getMinRuntimeMsMegs(void) 103static inline u64 HvLpConfig_getMinRuntimeMsMegs(void)
107{ 104{
108 return HvCallCfg_getMinRuntimeMsChunks(HvLpConfig_getLpIndex()) / HVCHUNKSPERMEG; 105 return HvCallCfg_getMinRuntimeMsChunks(HvLpConfig_getLpIndex())
106 / HVCHUNKSPERMEG;
109} 107}
110//=============================================================== 108
111static inline u64 HvLpConfig_getMinRuntimeMsChunks(void) 109static inline u64 HvLpConfig_getMinRuntimeMsChunks(void)
112{ 110{
113 return HvCallCfg_getMinRuntimeMsChunks(HvLpConfig_getLpIndex()); 111 return HvCallCfg_getMinRuntimeMsChunks(HvLpConfig_getLpIndex());
114} 112}
115//=============================================================== 113
116static inline u64 HvLpConfig_getMinRuntimeMsPages(void) 114static inline u64 HvLpConfig_getMinRuntimeMsPages(void)
117{ 115{
118 return HvCallCfg_getMinRuntimeMsChunks(HvLpConfig_getLpIndex()) * HVPAGESPERCHUNK; 116 return HvCallCfg_getMinRuntimeMsChunks(HvLpConfig_getLpIndex())
117 * HVPAGESPERCHUNK;
119} 118}
120//=============================================================== 119
121static inline u64 HvLpConfig_getMaxMsMegs(void) 120static inline u64 HvLpConfig_getMaxMsMegs(void)
122{ 121{
123 return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(),HvCallCfg_Max) / HVCHUNKSPERMEG; 122 return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(), HvCallCfg_Max)
123 / HVCHUNKSPERMEG;
124} 124}
125//=============================================================== 125
126static inline u64 HvLpConfig_getMaxMsChunks(void) 126static inline u64 HvLpConfig_getMaxMsChunks(void)
127{ 127{
128 return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(),HvCallCfg_Max); 128 return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(), HvCallCfg_Max);
129} 129}
130//=============================================================== 130
131static inline u64 HvLpConfig_getMaxMsPages(void) 131static inline u64 HvLpConfig_getMaxMsPages(void)
132{ 132{
133 return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(),HvCallCfg_Max) * HVPAGESPERCHUNK; 133 return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(), HvCallCfg_Max)
134 * HVPAGESPERCHUNK;
134} 135}
135//=============================================================== 136
136static inline u64 HvLpConfig_getInitMsMegs(void) 137static inline u64 HvLpConfig_getInitMsMegs(void)
137{ 138{
138 return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(),HvCallCfg_Init) / HVCHUNKSPERMEG; 139 return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(), HvCallCfg_Init)
140 / HVCHUNKSPERMEG;
139} 141}
140//=============================================================== 142
141static inline u64 HvLpConfig_getInitMsChunks(void) 143static inline u64 HvLpConfig_getInitMsChunks(void)
142{ 144{
143 return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(),HvCallCfg_Init); 145 return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(), HvCallCfg_Init);
144} 146}
145//=============================================================== 147
146static inline u64 HvLpConfig_getInitMsPages(void) 148static inline u64 HvLpConfig_getInitMsPages(void)
147{ return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(),HvCallCfg_Init) * HVPAGESPERCHUNK; 149{
150 return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(), HvCallCfg_Init)
151 * HVPAGESPERCHUNK;
148} 152}
149//=============================================================== 153
150static inline u64 HvLpConfig_getSystemPhysicalProcessors(void) 154static inline u64 HvLpConfig_getSystemPhysicalProcessors(void)
151{ 155{
152 return HvCallCfg_getSystemPhysicalProcessors(); 156 return HvCallCfg_getSystemPhysicalProcessors();
153} 157}
154//=============================================================== 158
155static inline u64 HvLpConfig_getSystemLogicalProcessors(void) 159static inline u64 HvLpConfig_getSystemLogicalProcessors(void)
156{ 160{
157 return HvCallCfg_getSystemPhysicalProcessors() * (/*getPaca()->getSecondaryThreadCount() +*/ 1); 161 return HvCallCfg_getSystemPhysicalProcessors()
162 * (/*getPaca()->getSecondaryThreadCount() +*/ 1);
158} 163}
159//=============================================================== 164
160static inline u64 HvLpConfig_getNumProcsInSharedPool(HvLpSharedPoolIndex sPI) 165static inline u64 HvLpConfig_getNumProcsInSharedPool(HvLpSharedPoolIndex sPI)
161{ 166{
162 return HvCallCfg_getNumProcsInSharedPool(sPI); 167 return HvCallCfg_getNumProcsInSharedPool(sPI);
163} 168}
164//=============================================================== 169
165static inline u64 HvLpConfig_getPhysicalProcessors(void) 170static inline u64 HvLpConfig_getPhysicalProcessors(void)
166{ 171{
167 return HvCallCfg_getPhysicalProcessors(HvLpConfig_getLpIndex(),HvCallCfg_Cur); 172 return HvCallCfg_getPhysicalProcessors(HvLpConfig_getLpIndex(),
173 HvCallCfg_Cur);
168} 174}
169//=============================================================== 175
170static inline u64 HvLpConfig_getLogicalProcessors(void) 176static inline u64 HvLpConfig_getLogicalProcessors(void)
171{ 177{
172 return HvCallCfg_getPhysicalProcessors(HvLpConfig_getLpIndex(),HvCallCfg_Cur) * (/*getPaca()->getSecondaryThreadCount() +*/ 1); 178 return HvCallCfg_getPhysicalProcessors(HvLpConfig_getLpIndex(),
179 HvCallCfg_Cur)
180 * (/*getPaca()->getSecondaryThreadCount() +*/ 1);
173} 181}
174//=============================================================== 182
175static inline HvLpSharedPoolIndex HvLpConfig_getSharedPoolIndex(void) 183static inline HvLpSharedPoolIndex HvLpConfig_getSharedPoolIndex(void)
176{ 184{
177 return HvCallCfg_getSharedPoolIndex(HvLpConfig_getLpIndex()); 185 return HvCallCfg_getSharedPoolIndex(HvLpConfig_getLpIndex());
178} 186}
179//=============================================================== 187
180static inline u64 HvLpConfig_getSharedProcUnits(void) 188static inline u64 HvLpConfig_getSharedProcUnits(void)
181{ 189{
182 return HvCallCfg_getSharedProcUnits(HvLpConfig_getLpIndex(),HvCallCfg_Cur); 190 return HvCallCfg_getSharedProcUnits(HvLpConfig_getLpIndex(),
191 HvCallCfg_Cur);
183} 192}
184//=============================================================== 193
185static inline u64 HvLpConfig_getMinSharedProcUnits(void) 194static inline u64 HvLpConfig_getMinSharedProcUnits(void)
186{ 195{
187 return HvCallCfg_getSharedProcUnits(HvLpConfig_getLpIndex(),HvCallCfg_Min); 196 return HvCallCfg_getSharedProcUnits(HvLpConfig_getLpIndex(),
197 HvCallCfg_Min);
188} 198}
189//=============================================================== 199
190static inline u64 HvLpConfig_getMaxSharedProcUnits(void) 200static inline u64 HvLpConfig_getMaxSharedProcUnits(void)
191{ 201{
192 return HvCallCfg_getSharedProcUnits(HvLpConfig_getLpIndex(),HvCallCfg_Max); 202 return HvCallCfg_getSharedProcUnits(HvLpConfig_getLpIndex(),
203 HvCallCfg_Max);
193} 204}
194//=============================================================== 205
195static inline u64 HvLpConfig_getMinPhysicalProcessors(void) 206static inline u64 HvLpConfig_getMinPhysicalProcessors(void)
196{ 207{
197 return HvCallCfg_getPhysicalProcessors(HvLpConfig_getLpIndex(),HvCallCfg_Min); 208 return HvCallCfg_getPhysicalProcessors(HvLpConfig_getLpIndex(),
209 HvCallCfg_Min);
198} 210}
199//=============================================================== 211
200static inline u64 HvLpConfig_getMinLogicalProcessors(void) 212static inline u64 HvLpConfig_getMinLogicalProcessors(void)
201{ 213{
202 return HvCallCfg_getPhysicalProcessors(HvLpConfig_getLpIndex(),HvCallCfg_Min) * (/*getPaca()->getSecondaryThreadCount() +*/ 1); 214 return HvCallCfg_getPhysicalProcessors(HvLpConfig_getLpIndex(),
215 HvCallCfg_Min)
216 * (/*getPaca()->getSecondaryThreadCount() +*/ 1);
203} 217}
204//=============================================================== 218
205static inline u64 HvLpConfig_getMaxPhysicalProcessors(void) 219static inline u64 HvLpConfig_getMaxPhysicalProcessors(void)
206{ 220{
207 return HvCallCfg_getPhysicalProcessors(HvLpConfig_getLpIndex(),HvCallCfg_Max); 221 return HvCallCfg_getPhysicalProcessors(HvLpConfig_getLpIndex(),
222 HvCallCfg_Max);
208} 223}
209//=============================================================== 224
210static inline u64 HvLpConfig_getMaxLogicalProcessors(void) 225static inline u64 HvLpConfig_getMaxLogicalProcessors(void)
211{ 226{
212 return HvCallCfg_getPhysicalProcessors(HvLpConfig_getLpIndex(),HvCallCfg_Max) * (/*getPaca()->getSecondaryThreadCount() +*/ 1); 227 return HvCallCfg_getPhysicalProcessors(HvLpConfig_getLpIndex(),
228 HvCallCfg_Max)
229 * (/*getPaca()->getSecondaryThreadCount() +*/ 1);
213} 230}
214//=============================================================== 231
215static inline u64 HvLpConfig_getInitPhysicalProcessors(void) 232static inline u64 HvLpConfig_getInitPhysicalProcessors(void)
216{ 233{
217 return HvCallCfg_getPhysicalProcessors(HvLpConfig_getLpIndex(),HvCallCfg_Init); 234 return HvCallCfg_getPhysicalProcessors(HvLpConfig_getLpIndex(),
235 HvCallCfg_Init);
218} 236}
219//=============================================================== 237
220static inline u64 HvLpConfig_getInitLogicalProcessors(void) 238static inline u64 HvLpConfig_getInitLogicalProcessors(void)
221{ 239{
222 return HvCallCfg_getPhysicalProcessors(HvLpConfig_getLpIndex(),HvCallCfg_Init) * (/*getPaca()->getSecondaryThreadCount() +*/ 1); 240 return HvCallCfg_getPhysicalProcessors(HvLpConfig_getLpIndex(),
241 HvCallCfg_Init)
242 * (/*getPaca()->getSecondaryThreadCount() +*/ 1);
223} 243}
224//================================================================ 244
225static inline HvLpVirtualLanIndexMap HvLpConfig_getVirtualLanIndexMap(void) 245static inline HvLpVirtualLanIndexMap HvLpConfig_getVirtualLanIndexMap(void)
226{ 246{
227 return HvCallCfg_getVirtualLanIndexMap(HvLpConfig_getLpIndex_outline()); 247 return HvCallCfg_getVirtualLanIndexMap(HvLpConfig_getLpIndex_outline());
228} 248}
229//=============================================================== 249
230static inline HvLpVirtualLanIndexMap HvLpConfig_getVirtualLanIndexMapForLp(HvLpIndex lp) 250static inline HvLpVirtualLanIndexMap HvLpConfig_getVirtualLanIndexMapForLp(
251 HvLpIndex lp)
231{ 252{
232 return HvCallCfg_getVirtualLanIndexMap(lp); 253 return HvCallCfg_getVirtualLanIndexMap(lp);
233} 254}
234//================================================================ 255
235static inline HvLpIndex HvLpConfig_getBusOwner(HvBusNumber busNumber) 256static inline HvLpIndex HvLpConfig_getBusOwner(HvBusNumber busNumber)
236{ 257{
237 return HvCallCfg_getBusOwner(busNumber); 258 return HvCallCfg_getBusOwner(busNumber);
238} 259}
239//=============================================================== 260
240static inline int HvLpConfig_isBusDedicated(HvBusNumber busNumber) 261static inline int HvLpConfig_isBusDedicated(HvBusNumber busNumber)
241{ 262{
242 return HvCallCfg_isBusDedicated(busNumber); 263 return HvCallCfg_isBusDedicated(busNumber);
243} 264}
244//================================================================ 265
245static inline HvLpIndexMap HvLpConfig_getBusAllocation(HvBusNumber busNumber) 266static inline HvLpIndexMap HvLpConfig_getBusAllocation(HvBusNumber busNumber)
246{ 267{
247 return HvCallCfg_getBusAllocation(busNumber); 268 return HvCallCfg_getBusAllocation(busNumber);
248} 269}
249//================================================================ 270
250// returns the absolute real address of the load area 271/* returns the absolute real address of the load area */
251static inline u64 HvLpConfig_getLoadAddress(void) 272static inline u64 HvLpConfig_getLoadAddress(void)
252{ 273{
253 return itLpNaca.xLoadAreaAddr & 0x7fffffffffffffff; 274 return itLpNaca.xLoadAreaAddr & 0x7fffffffffffffff;
254} 275}
255//================================================================ 276
256static inline u64 HvLpConfig_getLoadPages(void) 277static inline u64 HvLpConfig_getLoadPages(void)
257{ 278{
258 return itLpNaca.xLoadAreaChunks * HVPAGESPERCHUNK; 279 return itLpNaca.xLoadAreaChunks * HVPAGESPERCHUNK;
259} 280}
260//================================================================ 281
261static inline int HvLpConfig_isBusOwnedByThisLp(HvBusNumber busNumber) 282static inline int HvLpConfig_isBusOwnedByThisLp(HvBusNumber busNumber)
262{ 283{
263 HvLpIndex busOwner = HvLpConfig_getBusOwner(busNumber); 284 HvLpIndex busOwner = HvLpConfig_getBusOwner(busNumber);
264 return (busOwner == HvLpConfig_getLpIndex()); 285 return (busOwner == HvLpConfig_getLpIndex());
265} 286}
266//================================================================ 287
267static inline int HvLpConfig_doLpsCommunicateOnVirtualLan(HvLpIndex lp1, HvLpIndex lp2) 288static inline int HvLpConfig_doLpsCommunicateOnVirtualLan(HvLpIndex lp1,
289 HvLpIndex lp2)
268{ 290{
269 HvLpVirtualLanIndexMap virtualLanIndexMap1 = HvCallCfg_getVirtualLanIndexMap( lp1 ); 291 HvLpVirtualLanIndexMap virtualLanIndexMap1 =
270 HvLpVirtualLanIndexMap virtualLanIndexMap2 = HvCallCfg_getVirtualLanIndexMap( lp2 ); 292 HvCallCfg_getVirtualLanIndexMap(lp1);
293 HvLpVirtualLanIndexMap virtualLanIndexMap2 =
294 HvCallCfg_getVirtualLanIndexMap(lp2);
271 return ((virtualLanIndexMap1 & virtualLanIndexMap2) != 0); 295 return ((virtualLanIndexMap1 & virtualLanIndexMap2) != 0);
272} 296}
273//================================================================ 297
274static inline HvLpIndex HvLpConfig_getHostingLpIndex(HvLpIndex lp) 298static inline HvLpIndex HvLpConfig_getHostingLpIndex(HvLpIndex lp)
275{ 299{
276 return HvCallCfg_getHostingLpIndex(lp); 300 return HvCallCfg_getHostingLpIndex(lp);
277} 301}
278//================================================================
279 302
280#endif /* _HVLPCONFIG_H */ 303#endif /* _HVLPCONFIG_H */
diff --git a/include/asm-ppc64/iSeries/HvLpEvent.h b/include/asm-ppc64/iSeries/HvLpEvent.h
index 30936e433064..865000de79b6 100644
--- a/include/asm-ppc64/iSeries/HvLpEvent.h
+++ b/include/asm-ppc64/iSeries/HvLpEvent.h
@@ -1,27 +1,24 @@
1/* 1/*
2 * HvLpEvent.h 2 * HvLpEvent.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 class for HV events in the system. */
21// 21
22// This file contains the class for HV events in the system.
23//
24//=====================================================================
25#ifndef _HVLPEVENT_H 22#ifndef _HVLPEVENT_H
26#define _HVLPEVENT_H 23#define _HVLPEVENT_H
27 24
@@ -30,69 +27,70 @@
30#include <asm/iSeries/HvTypes.h> 27#include <asm/iSeries/HvTypes.h>
31#include <asm/iSeries/HvCallEvent.h> 28#include <asm/iSeries/HvCallEvent.h>
32 29
33//===================================================================== 30/*
34// 31 * HvLpEvent is the structure for Lp Event messages passed between
35// HvLpEvent is the structure for Lp Event messages passed between 32 * partitions through PLIC.
36// partitions through PLIC. 33 */
37// 34
38//===================================================================== 35struct HvEventFlags {
39 36 u8 xValid:1; /* Indicates a valid request x00-x00 */
40struct HvEventFlags 37 u8 xRsvd1:4; /* Reserved ... */
41{ 38 u8 xAckType:1; /* Immediate or deferred ... */
42 u8 xValid:1; // Indicates a valid request x00-x00 39 u8 xAckInd:1; /* Indicates if ACK required ... */
43 u8 xRsvd1:4; // Reserved ... 40 u8 xFunction:1; /* Interrupt or Acknowledge ... */
44 u8 xAckType:1; // Immediate or deferred ...
45 u8 xAckInd:1; // Indicates if ACK required ...
46 u8 xFunction:1; // Interrupt or Acknowledge ...
47}; 41};
48 42
49 43
50struct HvLpEvent 44struct HvLpEvent {
51{ 45 struct HvEventFlags xFlags; /* Event flags x00-x00 */
52 struct HvEventFlags xFlags; // Event flags x00-x00 46 u8 xType; /* Type of message x01-x01 */
53 u8 xType; // Type of message x01-x01 47 u16 xSubtype; /* Subtype for event x02-x03 */
54 u16 xSubtype; // Subtype for event x02-x03 48 u8 xSourceLp; /* Source LP x04-x04 */
55 u8 xSourceLp; // Source LP x04-x04 49 u8 xTargetLp; /* Target LP x05-x05 */
56 u8 xTargetLp; // Target LP x05-x05 50 u8 xSizeMinus1; /* Size of Derived class - 1 x06-x06 */
57 u8 xSizeMinus1; // Size of Derived class - 1 x06-x06 51 u8 xRc; /* RC for Ack flows x07-x07 */
58 u8 xRc; // RC for Ack flows x07-x07 52 u16 xSourceInstanceId; /* Source sides instance id x08-x09 */
59 u16 xSourceInstanceId; // Source sides instance id x08-x09 53 u16 xTargetInstanceId; /* Target sides instance id x0A-x0B */
60 u16 xTargetInstanceId; // Target sides instance id x0A-x0B
61 union { 54 union {
62 u32 xSubtypeData; // Data usable by the subtype x0C-x0F 55 u32 xSubtypeData; /* Data usable by the subtype x0C-x0F */
63 u16 xSubtypeDataShort[2]; // Data as 2 shorts 56 u16 xSubtypeDataShort[2]; /* Data as 2 shorts */
64 u8 xSubtypeDataChar[4]; // Data as 4 chars 57 u8 xSubtypeDataChar[4]; /* Data as 4 chars */
65 } x; 58 } x;
66 59
67 u64 xCorrelationToken; // Unique value for source/type x10-x17 60 u64 xCorrelationToken; /* Unique value for source/type x10-x17 */
68}; 61};
69 62
70// Lp Event handler function
71typedef void (*LpEventHandler)(struct HvLpEvent *, struct pt_regs *); 63typedef void (*LpEventHandler)(struct HvLpEvent *, struct pt_regs *);
72 64
73// Register a handler for an event type 65/* Register a handler for an event type - returns 0 on success */
74// returns 0 on success 66extern int HvLpEvent_registerHandler(HvLpEvent_Type eventType,
75extern int HvLpEvent_registerHandler( HvLpEvent_Type eventType, LpEventHandler hdlr); 67 LpEventHandler hdlr);
76
77// Unregister a handler for an event type
78// This call will sleep until the handler being removed is guaranteed to
79// be no longer executing on any CPU. Do not call with locks held.
80//
81// returns 0 on success
82// Unregister will fail if there are any paths open for the type
83extern int HvLpEvent_unregisterHandler( HvLpEvent_Type eventType );
84 68
85// Open an Lp Event Path for an event type 69/*
86// returns 0 on success 70 * Unregister a handler for an event type
87// openPath will fail if there is no handler registered for the event type. 71 *
88// The lpIndex specified is the partition index for the target partition 72 * This call will sleep until the handler being removed is guaranteed to
89// (for VirtualIo, VirtualLan and SessionMgr) other types specify zero) 73 * be no longer executing on any CPU. Do not call with locks held.
90extern int HvLpEvent_openPath( HvLpEvent_Type eventType, HvLpIndex lpIndex ); 74 *
75 * returns 0 on success
76 * Unregister will fail if there are any paths open for the type
77 */
78extern int HvLpEvent_unregisterHandler(HvLpEvent_Type eventType);
91 79
80/*
81 * Open an Lp Event Path for an event type
82 * returns 0 on success
83 * openPath will fail if there is no handler registered for the event type.
84 * The lpIndex specified is the partition index for the target partition
85 * (for VirtualIo, VirtualLan and SessionMgr) other types specify zero)
86 */
87extern int HvLpEvent_openPath(HvLpEvent_Type eventType, HvLpIndex lpIndex);
92 88
93// Close an Lp Event Path for a type and partition 89/*
94// returns 0 on sucess 90 * Close an Lp Event Path for a type and partition
95extern int HvLpEvent_closePath( HvLpEvent_Type eventType, HvLpIndex lpIndex ); 91 * returns 0 on sucess
92 */
93extern int HvLpEvent_closePath(HvLpEvent_Type eventType, HvLpIndex lpIndex);
96 94
97#define HvLpEvent_Type_Hypervisor 0 95#define HvLpEvent_Type_Hypervisor 0
98#define HvLpEvent_Type_MachineFac 1 96#define HvLpEvent_Type_MachineFac 1
@@ -141,4 +139,4 @@ extern int HvLpEvent_closePath( HvLpEvent_Type eventType, HvLpIndex lpIndex );
141#define HvLpDma_Rc_InvalidAddress 4 139#define HvLpDma_Rc_InvalidAddress 4
142#define HvLpDma_Rc_InvalidLength 5 140#define HvLpDma_Rc_InvalidLength 5
143 141
144#endif // _HVLPEVENT_H 142#endif /* _HVLPEVENT_H */
diff --git a/include/asm-ppc64/iSeries/HvReleaseData.h b/include/asm-ppc64/iSeries/HvReleaseData.h
index 183e5e738c26..c0cd21caf8fd 100644
--- a/include/asm-ppc64/iSeries/HvReleaseData.h
+++ b/include/asm-ppc64/iSeries/HvReleaseData.h
@@ -1,17 +1,17 @@
1/* 1/*
2 * HvReleaseData.h 2 * HvReleaseData.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
@@ -19,47 +19,43 @@
19#ifndef _HVRELEASEDATA_H 19#ifndef _HVRELEASEDATA_H
20#define _HVRELEASEDATA_H 20#define _HVRELEASEDATA_H
21 21
22//============================================================================= 22/*
23// 23 * This control block contains the critical information about the
24// This control block contains the critical information about the 24 * release so that it can be changed in the future (ie, the virtual
25// release so that it can be changed in the future (ie, the virtual 25 * address of the OS's NACA).
26// address of the OS's NACA). 26 */
27//
28#include <asm/types.h> 27#include <asm/types.h>
29#include <asm/naca.h> 28#include <asm/naca.h>
30 29
31//============================================================================= 30/*
32// 31 * When we IPL a secondary partition, we will check if if the
33// When we IPL a secondary partition, we will check if if the 32 * secondary xMinPlicVrmIndex > the primary xVrmIndex.
34// secondary xMinPlicVrmIndex > the primary xVrmIndex. 33 * If it is then this tells PLIC that this secondary is not
35// If it is then this tells PLIC that this secondary is not 34 * supported running on this "old" of a level of PLIC.
36// supported running on this "old" of a level of PLIC. 35 *
37// 36 * Likewise, we will compare the primary xMinSlicVrmIndex to
38// Likewise, we will compare the primary xMinSlicVrmIndex to 37 * the secondary xVrmIndex.
39// the secondary xVrmIndex. 38 * If the primary xMinSlicVrmDelta > secondary xVrmDelta then we
40// If the primary xMinSlicVrmDelta > secondary xVrmDelta then we 39 * know that this PLIC does not support running an OS "that old".
41// know that this PLIC does not support running an OS "that old". 40 */
42//
43//=============================================================================
44 41
45struct HvReleaseData 42struct HvReleaseData {
46{ 43 u32 xDesc; /* Descriptor "HvRD" ebcdic x00-x03 */
47 u32 xDesc; // Descriptor "HvRD" ebcdic x00-x03 44 u16 xSize; /* Size of this control block x04-x05 */
48 u16 xSize; // Size of this control block x04-x05 45 u16 xVpdAreasPtrOffset; /* Offset in NACA of ItVpdAreas x06-x07 */
49 u16 xVpdAreasPtrOffset; // Offset in NACA of ItVpdAreas x06-x07 46 struct naca_struct *xSlicNacaAddr; /* Virt addr of SLIC NACA x08-x0F */
50 struct naca_struct * xSlicNacaAddr; // Virt addr of SLIC NACA x08-x0F 47 u32 xMsNucDataOffset; /* Offset of Linux Mapping Data x10-x13 */
51 u32 xMsNucDataOffset; // Offset of Linux Mapping Data x10-x13 48 u32 xRsvd1; /* Reserved x14-x17 */
52 u32 xRsvd1; // Reserved x14-x17 49 u16 xTagsMode:1; /* 0 == tags active, 1 == tags inactive */
53 u16 xTagsMode:1; // 0 == tags active, 1 == tags inactive 50 u16 xAddressSize:1; /* 0 == 64-bit, 1 == 32-bit */
54 u16 xAddressSize:1; // 0 == 64-bit, 1 == 32-bit 51 u16 xNoSharedProcs:1; /* 0 == shared procs, 1 == no shared */
55 u16 xNoSharedProcs:1; // 0 == shared procs, 1 == no shared 52 u16 xNoHMT:1; /* 0 == allow HMT, 1 == no HMT */
56 u16 xNoHMT:1; // 0 == allow HMT, 1 == no HMT 53 u16 xRsvd2:12; /* Reserved x18-x19 */
57 u16 xRsvd2:12; // Reserved x18-x19 54 u16 xVrmIndex; /* VRM Index of OS image x1A-x1B */
58 u16 xVrmIndex; // VRM Index of OS image x1A-x1B 55 u16 xMinSupportedPlicVrmIndex; /* Min PLIC level (soft) x1C-x1D */
59 u16 xMinSupportedPlicVrmIndex;// Min PLIC level (soft) x1C-x1D 56 u16 xMinCompatablePlicVrmIndex; /* Min PLIC levelP (hard) x1E-x1F */
60 u16 xMinCompatablePlicVrmIndex;// Min PLIC levelP (hard) x1E-x1F 57 char xVrmName[12]; /* Displayable name x20-x2B */
61 char xVrmName[12]; // Displayable name x20-x2B 58 char xRsvd3[20]; /* Reserved x2C-x3F */
62 char xRsvd3[20]; // Reserved x2C-x3F
63}; 59};
64 60
65#endif /* _HVRELEASEDATA_H */ 61#endif /* _HVRELEASEDATA_H */
diff --git a/include/asm-ppc64/iSeries/HvTypes.h b/include/asm-ppc64/iSeries/HvTypes.h
index 3ec49c1aec32..111191ddb181 100644
--- a/include/asm-ppc64/iSeries/HvTypes.h
+++ b/include/asm-ppc64/iSeries/HvTypes.h
@@ -1,17 +1,17 @@
1/* 1/*
2 * HvTypes.h 2 * HvTypes.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
@@ -19,74 +19,62 @@
19#ifndef _HVTYPES_H 19#ifndef _HVTYPES_H
20#define _HVTYPES_H 20#define _HVTYPES_H
21 21
22//=========================================================================== 22/*
23// Header File Id 23 * General typedefs for the hypervisor.
24// Name______________: HvTypes.H 24 */
25//
26// Description_______:
27//
28// General typedefs for the hypervisor.
29//
30// Declared Class(es):
31//
32//===========================================================================
33 25
34#include <asm/types.h> 26#include <asm/types.h>
35 27
36//-------------------------------------------------------------------
37// Typedefs
38//-------------------------------------------------------------------
39typedef u8 HvLpIndex; 28typedef u8 HvLpIndex;
40typedef u16 HvLpInstanceId; 29typedef u16 HvLpInstanceId;
41typedef u64 HvLpTOD; 30typedef u64 HvLpTOD;
42typedef u64 HvLpSystemSerialNum; 31typedef u64 HvLpSystemSerialNum;
43typedef u8 HvLpDeviceSerialNum[12]; 32typedef u8 HvLpDeviceSerialNum[12];
44typedef u16 HvLpSanHwSet; 33typedef u16 HvLpSanHwSet;
45typedef u16 HvLpBus; 34typedef u16 HvLpBus;
46typedef u16 HvLpBoard; 35typedef u16 HvLpBoard;
47typedef u16 HvLpCard; 36typedef u16 HvLpCard;
48typedef u8 HvLpDeviceType[4]; 37typedef u8 HvLpDeviceType[4];
49typedef u8 HvLpDeviceModel[3]; 38typedef u8 HvLpDeviceModel[3];
50typedef u64 HvIoToken; 39typedef u64 HvIoToken;
51typedef u8 HvLpName[8]; 40typedef u8 HvLpName[8];
52typedef u32 HvIoId; 41typedef u32 HvIoId;
53typedef u64 HvRealMemoryIndex; 42typedef u64 HvRealMemoryIndex;
54typedef u32 HvLpIndexMap; // Must hold HvMaxArchitectedLps bits!!! 43typedef u32 HvLpIndexMap; /* Must hold HvMaxArchitectedLps bits!!! */
55typedef u16 HvLpVrmIndex; 44typedef u16 HvLpVrmIndex;
56typedef u32 HvXmGenerationId; 45typedef u32 HvXmGenerationId;
57typedef u8 HvLpBusPool; 46typedef u8 HvLpBusPool;
58typedef u8 HvLpSharedPoolIndex; 47typedef u8 HvLpSharedPoolIndex;
59typedef u16 HvLpSharedProcUnitsX100; 48typedef u16 HvLpSharedProcUnitsX100;
60typedef u8 HvLpVirtualLanIndex; 49typedef u8 HvLpVirtualLanIndex;
61typedef u16 HvLpVirtualLanIndexMap; // Must hold HvMaxArchitectedVirtualLans bits!!! 50typedef u16 HvLpVirtualLanIndexMap; /* Must hold HvMaxArchitectedVirtualLans bits!!! */
62typedef u16 HvBusNumber; // Hypervisor Bus Number 51typedef u16 HvBusNumber; /* Hypervisor Bus Number */
63typedef u8 HvSubBusNumber; // Hypervisor SubBus Number 52typedef u8 HvSubBusNumber; /* Hypervisor SubBus Number */
64typedef u8 HvAgentId; // Hypervisor DevFn 53typedef u8 HvAgentId; /* Hypervisor DevFn */
54
65 55
56#define HVMAXARCHITECTEDLPS 32
57#define HVMAXARCHITECTEDVIRTUALLANS 16
58#define HVMAXARCHITECTEDVIRTUALDISKS 32
59#define HVMAXARCHITECTEDVIRTUALCDROMS 8
60#define HVMAXARCHITECTEDVIRTUALTAPES 8
61#define HVCHUNKSIZE (256 * 1024)
62#define HVPAGESIZE (4 * 1024)
63#define HVLPMINMEGSPRIMARY 256
64#define HVLPMINMEGSSECONDARY 64
65#define HVCHUNKSPERMEG 4
66#define HVPAGESPERMEG 256
67#define HVPAGESPERCHUNK 64
66 68
67#define HVMAXARCHITECTEDLPS 32 69#define HvMaxArchitectedLps ((HvLpIndex)HVMAXARCHITECTEDLPS)
68#define HVMAXARCHITECTEDVIRTUALLANS 16
69#define HVMAXARCHITECTEDVIRTUALDISKS 32
70#define HVMAXARCHITECTEDVIRTUALCDROMS 8
71#define HVMAXARCHITECTEDVIRTUALTAPES 8
72#define HVCHUNKSIZE 256 * 1024
73#define HVPAGESIZE 4 * 1024
74#define HVLPMINMEGSPRIMARY 256
75#define HVLPMINMEGSSECONDARY 64
76#define HVCHUNKSPERMEG 4
77#define HVPAGESPERMEG 256
78#define HVPAGESPERCHUNK 64
79
80#define HvMaxArchitectedLps ((HvLpIndex)HVMAXARCHITECTEDLPS)
81#define HvMaxArchitectedVirtualLans ((HvLpVirtualLanIndex)16) 70#define HvMaxArchitectedVirtualLans ((HvLpVirtualLanIndex)16)
82#define HvLpIndexInvalid ((HvLpIndex)0xff) 71#define HvLpIndexInvalid ((HvLpIndex)0xff)
83 72
84//-------------------------------------------------------------------- 73/*
85// Enums for the sub-components under PLIC 74 * Enums for the sub-components under PLIC
86// Used in HvCall and HvPrimaryCall 75 * Used in HvCall and HvPrimaryCall
87//-------------------------------------------------------------------- 76 */
88enum HvCallCompIds 77enum HvCallCompIds {
89{
90 HvCallCompId = 0, 78 HvCallCompId = 0,
91 HvCallCpuCtlsCompId = 1, 79 HvCallCpuCtlsCompId = 1,
92 HvCallCfgCompId = 2, 80 HvCallCfgCompId = 2,
@@ -97,18 +85,18 @@ enum HvCallCompIds
97 HvCallSmCompId = 7, 85 HvCallSmCompId = 7,
98 HvCallSpdCompId = 8, 86 HvCallSpdCompId = 8,
99 HvCallXmCompId = 9, 87 HvCallXmCompId = 9,
100 HvCallRioCompId = 10, 88 HvCallRioCompId = 10,
101 HvCallRsvd3CompId = 11, 89 HvCallRsvd3CompId = 11,
102 HvCallRsvd2CompId = 12, 90 HvCallRsvd2CompId = 12,
103 HvCallRsvd1CompId = 13, 91 HvCallRsvd1CompId = 13,
104 HvCallMaxCompId = 14, 92 HvCallMaxCompId = 14,
105 HvPrimaryCallCompId = 0, 93 HvPrimaryCallCompId = 0,
106 HvPrimaryCallCfgCompId = 1, 94 HvPrimaryCallCfgCompId = 1,
107 HvPrimaryCallPciCompId = 2, 95 HvPrimaryCallPciCompId = 2,
108 HvPrimaryCallSmCompId = 3, 96 HvPrimaryCallSmCompId = 3,
109 HvPrimaryCallSpdCompId = 4, 97 HvPrimaryCallSpdCompId = 4,
110 HvPrimaryCallXmCompId = 5, 98 HvPrimaryCallXmCompId = 5,
111 HvPrimaryCallRioCompId = 6, 99 HvPrimaryCallRioCompId = 6,
112 HvPrimaryCallRsvd7CompId = 7, 100 HvPrimaryCallRsvd7CompId = 7,
113 HvPrimaryCallRsvd6CompId = 8, 101 HvPrimaryCallRsvd6CompId = 8,
114 HvPrimaryCallRsvd5CompId = 9, 102 HvPrimaryCallRsvd5CompId = 9,
@@ -116,7 +104,7 @@ enum HvCallCompIds
116 HvPrimaryCallRsvd3CompId = 11, 104 HvPrimaryCallRsvd3CompId = 11,
117 HvPrimaryCallRsvd2CompId = 12, 105 HvPrimaryCallRsvd2CompId = 12,
118 HvPrimaryCallRsvd1CompId = 13, 106 HvPrimaryCallRsvd1CompId = 13,
119 HvPrimaryCallMaxCompId = HvCallMaxCompId 107 HvPrimaryCallMaxCompId = HvCallMaxCompId
120}; 108};
121 109
122struct HvLpBufferList { 110struct HvLpBufferList {