aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-ppc64/iSeries/HvLpConfig.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-ppc64/iSeries/HvLpConfig.h')
-rw-r--r--include/asm-ppc64/iSeries/HvLpConfig.h59
1 files changed, 42 insertions, 17 deletions
diff --git a/include/asm-ppc64/iSeries/HvLpConfig.h b/include/asm-ppc64/iSeries/HvLpConfig.h
index 78d68281cc8b..f1cf1e70ca3c 100644
--- a/include/asm-ppc64/iSeries/HvLpConfig.h
+++ b/include/asm-ppc64/iSeries/HvLpConfig.h
@@ -24,10 +24,26 @@
24 * to determine which resources should be allocated to each partition. 24 * to determine which resources should be allocated to each partition.
25 */ 25 */
26 26
27#include <asm/iSeries/HvCallCfg.h> 27#include <asm/iSeries/HvCallSc.h>
28#include <asm/iSeries/HvTypes.h> 28#include <asm/iSeries/HvTypes.h>
29#include <asm/iSeries/ItLpNaca.h> 29#include <asm/iSeries/ItLpNaca.h>
30 30
31enum {
32 HvCallCfg_Cur = 0,
33 HvCallCfg_Init = 1,
34 HvCallCfg_Max = 2,
35 HvCallCfg_Min = 3
36};
37
38#define HvCallCfgGetSystemPhysicalProcessors HvCallCfg + 6
39#define HvCallCfgGetPhysicalProcessors HvCallCfg + 7
40#define HvCallCfgGetMsChunks HvCallCfg + 9
41#define HvCallCfgGetSharedPoolIndex HvCallCfg + 20
42#define HvCallCfgGetSharedProcUnits HvCallCfg + 21
43#define HvCallCfgGetNumProcsInSharedPool HvCallCfg + 22
44#define HvCallCfgGetVirtualLanIndexMap HvCallCfg + 30
45#define HvCallCfgGetHostingLpIndex HvCallCfg + 32
46
31extern HvLpIndex HvLpConfig_getLpIndex_outline(void); 47extern HvLpIndex HvLpConfig_getLpIndex_outline(void);
32 48
33static inline HvLpIndex HvLpConfig_getLpIndex(void) 49static inline HvLpIndex HvLpConfig_getLpIndex(void)
@@ -42,72 +58,81 @@ static inline HvLpIndex HvLpConfig_getPrimaryLpIndex(void)
42 58
43static inline u64 HvLpConfig_getMsChunks(void) 59static inline u64 HvLpConfig_getMsChunks(void)
44{ 60{
45 return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(), HvCallCfg_Cur); 61 return HvCall2(HvCallCfgGetMsChunks, HvLpConfig_getLpIndex(),
62 HvCallCfg_Cur);
46} 63}
47 64
48static inline u64 HvLpConfig_getSystemPhysicalProcessors(void) 65static inline u64 HvLpConfig_getSystemPhysicalProcessors(void)
49{ 66{
50 return HvCallCfg_getSystemPhysicalProcessors(); 67 return HvCall0(HvCallCfgGetSystemPhysicalProcessors);
51} 68}
52 69
53static inline u64 HvLpConfig_getNumProcsInSharedPool(HvLpSharedPoolIndex sPI) 70static inline u64 HvLpConfig_getNumProcsInSharedPool(HvLpSharedPoolIndex sPI)
54{ 71{
55 return HvCallCfg_getNumProcsInSharedPool(sPI); 72 return (u16)HvCall1(HvCallCfgGetNumProcsInSharedPool, sPI);
56} 73}
57 74
58static inline u64 HvLpConfig_getPhysicalProcessors(void) 75static inline u64 HvLpConfig_getPhysicalProcessors(void)
59{ 76{
60 return HvCallCfg_getPhysicalProcessors(HvLpConfig_getLpIndex(), 77 return HvCall2(HvCallCfgGetPhysicalProcessors, HvLpConfig_getLpIndex(),
61 HvCallCfg_Cur); 78 HvCallCfg_Cur);
62} 79}
63 80
64static inline HvLpSharedPoolIndex HvLpConfig_getSharedPoolIndex(void) 81static inline HvLpSharedPoolIndex HvLpConfig_getSharedPoolIndex(void)
65{ 82{
66 return HvCallCfg_getSharedPoolIndex(HvLpConfig_getLpIndex()); 83 return HvCall1(HvCallCfgGetSharedPoolIndex, HvLpConfig_getLpIndex());
67} 84}
68 85
69static inline u64 HvLpConfig_getSharedProcUnits(void) 86static inline u64 HvLpConfig_getSharedProcUnits(void)
70{ 87{
71 return HvCallCfg_getSharedProcUnits(HvLpConfig_getLpIndex(), 88 return HvCall2(HvCallCfgGetSharedProcUnits, HvLpConfig_getLpIndex(),
72 HvCallCfg_Cur); 89 HvCallCfg_Cur);
73} 90}
74 91
75static inline u64 HvLpConfig_getMaxSharedProcUnits(void) 92static inline u64 HvLpConfig_getMaxSharedProcUnits(void)
76{ 93{
77 return HvCallCfg_getSharedProcUnits(HvLpConfig_getLpIndex(), 94 return HvCall2(HvCallCfgGetSharedProcUnits, HvLpConfig_getLpIndex(),
78 HvCallCfg_Max); 95 HvCallCfg_Max);
79} 96}
80 97
81static inline u64 HvLpConfig_getMaxPhysicalProcessors(void) 98static inline u64 HvLpConfig_getMaxPhysicalProcessors(void)
82{ 99{
83 return HvCallCfg_getPhysicalProcessors(HvLpConfig_getLpIndex(), 100 return HvCall2(HvCallCfgGetPhysicalProcessors, HvLpConfig_getLpIndex(),
84 HvCallCfg_Max); 101 HvCallCfg_Max);
85} 102}
86 103
87static inline HvLpVirtualLanIndexMap HvLpConfig_getVirtualLanIndexMap(void) 104static inline HvLpVirtualLanIndexMap HvLpConfig_getVirtualLanIndexMapForLp(
105 HvLpIndex lp)
88{ 106{
89 return HvCallCfg_getVirtualLanIndexMap(HvLpConfig_getLpIndex_outline()); 107 /*
108 * This is a new function in V5R1 so calls to this on older
109 * hypervisors will return -1
110 */
111 u64 retVal = HvCall1(HvCallCfgGetVirtualLanIndexMap, lp);
112 if (retVal == -1)
113 retVal = 0;
114 return retVal;
90} 115}
91 116
92static inline HvLpVirtualLanIndexMap HvLpConfig_getVirtualLanIndexMapForLp( 117static inline HvLpVirtualLanIndexMap HvLpConfig_getVirtualLanIndexMap(void)
93 HvLpIndex lp)
94{ 118{
95 return HvCallCfg_getVirtualLanIndexMap(lp); 119 return HvLpConfig_getVirtualLanIndexMapForLp(
120 HvLpConfig_getLpIndex_outline());
96} 121}
97 122
98static inline int HvLpConfig_doLpsCommunicateOnVirtualLan(HvLpIndex lp1, 123static inline int HvLpConfig_doLpsCommunicateOnVirtualLan(HvLpIndex lp1,
99 HvLpIndex lp2) 124 HvLpIndex lp2)
100{ 125{
101 HvLpVirtualLanIndexMap virtualLanIndexMap1 = 126 HvLpVirtualLanIndexMap virtualLanIndexMap1 =
102 HvCallCfg_getVirtualLanIndexMap(lp1); 127 HvLpConfig_getVirtualLanIndexMapForLp(lp1);
103 HvLpVirtualLanIndexMap virtualLanIndexMap2 = 128 HvLpVirtualLanIndexMap virtualLanIndexMap2 =
104 HvCallCfg_getVirtualLanIndexMap(lp2); 129 HvLpConfig_getVirtualLanIndexMapForLp(lp2);
105 return ((virtualLanIndexMap1 & virtualLanIndexMap2) != 0); 130 return ((virtualLanIndexMap1 & virtualLanIndexMap2) != 0);
106} 131}
107 132
108static inline HvLpIndex HvLpConfig_getHostingLpIndex(HvLpIndex lp) 133static inline HvLpIndex HvLpConfig_getHostingLpIndex(HvLpIndex lp)
109{ 134{
110 return HvCallCfg_getHostingLpIndex(lp); 135 return HvCall1(HvCallCfgGetHostingLpIndex, lp);
111} 136}
112 137
113#endif /* _HVLPCONFIG_H */ 138#endif /* _HVLPCONFIG_H */