Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 2498
b: refs/heads/master
c: 2310c97
h: refs/heads/master
v: v3
  • Loading branch information
Stephen Rothwell authored and Linus Torvalds committed Jun 22, 2005
1 parent 9835c1c commit 6a33193
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 147 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: dd61ce922770b299081c3e729ea65758ed676034
refs/heads/master: 2310c977a9b7a4d08fbaa74e694b49b38d49f5ae
129 changes: 0 additions & 129 deletions trunk/include/asm-ppc64/iSeries/HvCallCfg.h

This file was deleted.

59 changes: 42 additions & 17 deletions trunk/include/asm-ppc64/iSeries/HvLpConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,26 @@
* to determine which resources should be allocated to each partition.
*/

#include <asm/iSeries/HvCallCfg.h>
#include <asm/iSeries/HvCallSc.h>
#include <asm/iSeries/HvTypes.h>
#include <asm/iSeries/ItLpNaca.h>

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

#define HvCallCfgGetSystemPhysicalProcessors HvCallCfg + 6
#define HvCallCfgGetPhysicalProcessors HvCallCfg + 7
#define HvCallCfgGetMsChunks HvCallCfg + 9
#define HvCallCfgGetSharedPoolIndex HvCallCfg + 20
#define HvCallCfgGetSharedProcUnits HvCallCfg + 21
#define HvCallCfgGetNumProcsInSharedPool HvCallCfg + 22
#define HvCallCfgGetVirtualLanIndexMap HvCallCfg + 30
#define HvCallCfgGetHostingLpIndex HvCallCfg + 32

extern HvLpIndex HvLpConfig_getLpIndex_outline(void);

static inline HvLpIndex HvLpConfig_getLpIndex(void)
Expand All @@ -42,72 +58,81 @@ static inline HvLpIndex HvLpConfig_getPrimaryLpIndex(void)

static inline u64 HvLpConfig_getMsChunks(void)
{
return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(), HvCallCfg_Cur);
return HvCall2(HvCallCfgGetMsChunks, HvLpConfig_getLpIndex(),
HvCallCfg_Cur);
}

static inline u64 HvLpConfig_getSystemPhysicalProcessors(void)
{
return HvCallCfg_getSystemPhysicalProcessors();
return HvCall0(HvCallCfgGetSystemPhysicalProcessors);
}

static inline u64 HvLpConfig_getNumProcsInSharedPool(HvLpSharedPoolIndex sPI)
{
return HvCallCfg_getNumProcsInSharedPool(sPI);
return (u16)HvCall1(HvCallCfgGetNumProcsInSharedPool, sPI);
}

static inline u64 HvLpConfig_getPhysicalProcessors(void)
{
return HvCallCfg_getPhysicalProcessors(HvLpConfig_getLpIndex(),
return HvCall2(HvCallCfgGetPhysicalProcessors, HvLpConfig_getLpIndex(),
HvCallCfg_Cur);
}

static inline HvLpSharedPoolIndex HvLpConfig_getSharedPoolIndex(void)
{
return HvCallCfg_getSharedPoolIndex(HvLpConfig_getLpIndex());
return HvCall1(HvCallCfgGetSharedPoolIndex, HvLpConfig_getLpIndex());
}

static inline u64 HvLpConfig_getSharedProcUnits(void)
{
return HvCallCfg_getSharedProcUnits(HvLpConfig_getLpIndex(),
return HvCall2(HvCallCfgGetSharedProcUnits, HvLpConfig_getLpIndex(),
HvCallCfg_Cur);
}

static inline u64 HvLpConfig_getMaxSharedProcUnits(void)
{
return HvCallCfg_getSharedProcUnits(HvLpConfig_getLpIndex(),
return HvCall2(HvCallCfgGetSharedProcUnits, HvLpConfig_getLpIndex(),
HvCallCfg_Max);
}

static inline u64 HvLpConfig_getMaxPhysicalProcessors(void)
{
return HvCallCfg_getPhysicalProcessors(HvLpConfig_getLpIndex(),
return HvCall2(HvCallCfgGetPhysicalProcessors, HvLpConfig_getLpIndex(),
HvCallCfg_Max);
}

static inline HvLpVirtualLanIndexMap HvLpConfig_getVirtualLanIndexMap(void)
static inline HvLpVirtualLanIndexMap HvLpConfig_getVirtualLanIndexMapForLp(
HvLpIndex lp)
{
return HvCallCfg_getVirtualLanIndexMap(HvLpConfig_getLpIndex_outline());
/*
* This is a new function in V5R1 so calls to this on older
* hypervisors will return -1
*/
u64 retVal = HvCall1(HvCallCfgGetVirtualLanIndexMap, lp);
if (retVal == -1)
retVal = 0;
return retVal;
}

static inline HvLpVirtualLanIndexMap HvLpConfig_getVirtualLanIndexMapForLp(
HvLpIndex lp)
static inline HvLpVirtualLanIndexMap HvLpConfig_getVirtualLanIndexMap(void)
{
return HvCallCfg_getVirtualLanIndexMap(lp);
return HvLpConfig_getVirtualLanIndexMapForLp(
HvLpConfig_getLpIndex_outline());
}

static inline int HvLpConfig_doLpsCommunicateOnVirtualLan(HvLpIndex lp1,
HvLpIndex lp2)
{
HvLpVirtualLanIndexMap virtualLanIndexMap1 =
HvCallCfg_getVirtualLanIndexMap(lp1);
HvLpConfig_getVirtualLanIndexMapForLp(lp1);
HvLpVirtualLanIndexMap virtualLanIndexMap2 =
HvCallCfg_getVirtualLanIndexMap(lp2);
HvLpConfig_getVirtualLanIndexMapForLp(lp2);
return ((virtualLanIndexMap1 & virtualLanIndexMap2) != 0);
}

static inline HvLpIndex HvLpConfig_getHostingLpIndex(HvLpIndex lp)
{
return HvCallCfg_getHostingLpIndex(lp);
return HvCall1(HvCallCfgGetHostingLpIndex, lp);
}

#endif /* _HVLPCONFIG_H */

0 comments on commit 6a33193

Please sign in to comment.