Commit 6b7feecb authored by Stephen Rothwell's avatar Stephen Rothwell Committed by Linus Torvalds

[PATCH] ppc64 iSeries: obvious code simplifications

This patch does some obvious code cleanups in the iSeries headers files.
	- simplifies the bodies of lots of inline functions
	- parenthesises a macros result
	- removes C++ wrapping
	- adds "extern" to some function declarations
There are no semantic changes.
Signed-off-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent fcee3895
...@@ -69,37 +69,27 @@ enum HvCallCfg_ReqQual { ...@@ -69,37 +69,27 @@ enum HvCallCfg_ReqQual {
static inline HvLpIndex HvCallCfg_getLps(void) static inline HvLpIndex HvCallCfg_getLps(void)
{ {
HvLpIndex retVal = HvCall0(HvCallCfgGetLps); return HvCall0(HvCallCfgGetLps);
// getPaca()->adjustHmtForNoOfSpinLocksHeld();
return retVal;
} }
static inline int HvCallCfg_isBusDedicated(u64 busIndex) static inline int HvCallCfg_isBusDedicated(u64 busIndex)
{ {
int retVal = HvCall1(HvCallCfgIsBusDedicated,busIndex); return HvCall1(HvCallCfgIsBusDedicated, busIndex);
// getPaca()->adjustHmtForNoOfSpinLocksHeld();
return retVal;
} }
static inline HvLpIndex HvCallCfg_getBusOwner(u64 busIndex) static inline HvLpIndex HvCallCfg_getBusOwner(u64 busIndex)
{ {
HvLpIndex retVal = HvCall1(HvCallCfgGetBusOwner,busIndex); return HvCall1(HvCallCfgGetBusOwner, busIndex);
// getPaca()->adjustHmtForNoOfSpinLocksHeld();
return retVal;
} }
static inline HvLpIndexMap HvCallCfg_getBusAllocation(u64 busIndex) static inline HvLpIndexMap HvCallCfg_getBusAllocation(u64 busIndex)
{ {
HvLpIndexMap retVal = HvCall1(HvCallCfgGetBusAllocation,busIndex); return HvCall1(HvCallCfgGetBusAllocation, busIndex);
// getPaca()->adjustHmtForNoOfSpinLocksHeld();
return retVal;
} }
static inline HvLpIndexMap HvCallCfg_getActiveLpMap(void) static inline HvLpIndexMap HvCallCfg_getActiveLpMap(void)
{ {
HvLpIndexMap retVal = HvCall0(HvCallCfgGetActiveLpMap); return HvCall0(HvCallCfgGetActiveLpMap);
// getPaca()->adjustHmtForNoOfSpinLocksHeld();
return retVal;
} }
static inline HvLpVirtualLanIndexMap HvCallCfg_getVirtualLanIndexMap( static inline HvLpVirtualLanIndexMap HvCallCfg_getVirtualLanIndexMap(
...@@ -112,23 +102,18 @@ static inline HvLpVirtualLanIndexMap HvCallCfg_getVirtualLanIndexMap( ...@@ -112,23 +102,18 @@ static inline HvLpVirtualLanIndexMap HvCallCfg_getVirtualLanIndexMap(
u64 retVal = HvCall1(HvCallCfgGetVirtualLanIndexMap, lp); u64 retVal = HvCall1(HvCallCfgGetVirtualLanIndexMap, lp);
if (retVal == -1) if (retVal == -1)
retVal = 0; retVal = 0;
// getPaca()->adjustHmtForNoOfSpinLocksHeld();
return retVal; return retVal;
} }
static inline u64 HvCallCfg_getSystemMsChunks(void) static inline u64 HvCallCfg_getSystemMsChunks(void)
{ {
u64 retVal = HvCall0(HvCallCfgGetSystemMsChunks); return HvCall0(HvCallCfgGetSystemMsChunks);
// getPaca()->adjustHmtForNoOfSpinLocksHeld();
return retVal;
} }
static inline u64 HvCallCfg_getMsChunks(HvLpIndex lp, static inline u64 HvCallCfg_getMsChunks(HvLpIndex lp,
enum HvCallCfg_ReqQual qual) enum HvCallCfg_ReqQual qual)
{ {
u64 retVal = HvCall2(HvCallCfgGetMsChunks,lp,qual); return HvCall2(HvCallCfgGetMsChunks, lp, qual);
// getPaca()->adjustHmtForNoOfSpinLocksHeld();
return retVal;
} }
static inline u64 HvCallCfg_getMinRuntimeMsChunks(HvLpIndex lp) static inline u64 HvCallCfg_getMinRuntimeMsChunks(HvLpIndex lp)
...@@ -142,65 +127,51 @@ static inline u64 HvCallCfg_getMinRuntimeMsChunks(HvLpIndex lp) ...@@ -142,65 +127,51 @@ static inline u64 HvCallCfg_getMinRuntimeMsChunks(HvLpIndex lp)
static inline u64 HvCallCfg_setMinRuntimeMsChunks(u64 chunks) static inline u64 HvCallCfg_setMinRuntimeMsChunks(u64 chunks)
{ {
u64 retVal = HvCall1(HvCallCfgSetMinRuntimeMsChunks,chunks); return HvCall1(HvCallCfgSetMinRuntimeMsChunks, chunks);
// getPaca()->adjustHmtForNoOfSpinLocksHeld();
return retVal;
} }
static inline u64 HvCallCfg_getSystemPhysicalProcessors(void) static inline u64 HvCallCfg_getSystemPhysicalProcessors(void)
{ {
u64 retVal = HvCall0(HvCallCfgGetSystemPhysicalProcessors); return HvCall0(HvCallCfgGetSystemPhysicalProcessors);
// getPaca()->adjustHmtForNoOfSpinLocksHeld();
return retVal;
} }
static inline u64 HvCallCfg_getPhysicalProcessors(HvLpIndex lp, static inline u64 HvCallCfg_getPhysicalProcessors(HvLpIndex lp,
enum HvCallCfg_ReqQual qual) enum HvCallCfg_ReqQual qual)
{ {
u64 retVal = HvCall2(HvCallCfgGetPhysicalProcessors,lp,qual); return HvCall2(HvCallCfgGetPhysicalProcessors, lp, qual);
// getPaca()->adjustHmtForNoOfSpinLocksHeld();
return retVal;
} }
static inline u64 HvCallCfg_getConfiguredBusUnitsForInterruptProc(HvLpIndex lp, static inline u64 HvCallCfg_getConfiguredBusUnitsForInterruptProc(HvLpIndex lp,
u16 hvLogicalProcIndex) u16 hvLogicalProcIndex)
{ {
u64 retVal = HvCall2(HvCallCfgGetConfiguredBusUnitsForIntProc,lp,hvLogicalProcIndex); return HvCall2(HvCallCfgGetConfiguredBusUnitsForIntProc, lp,
// getPaca()->adjustHmtForNoOfSpinLocksHeld(); hvLogicalProcIndex);
return retVal;
} }
static inline HvLpSharedPoolIndex HvCallCfg_getSharedPoolIndex(HvLpIndex lp) static inline HvLpSharedPoolIndex HvCallCfg_getSharedPoolIndex(HvLpIndex lp)
{ {
HvLpSharedPoolIndex retVal = return HvCall1(HvCallCfgGetSharedPoolIndex, lp);
HvCall1(HvCallCfgGetSharedPoolIndex,lp);
// getPaca()->adjustHmtForNoOfSpinLocksHeld();
return retVal;
} }
static inline u64 HvCallCfg_getSharedProcUnits(HvLpIndex lp, static inline u64 HvCallCfg_getSharedProcUnits(HvLpIndex lp,
enum HvCallCfg_ReqQual qual) enum HvCallCfg_ReqQual qual)
{ {
u64 retVal = HvCall2(HvCallCfgGetSharedProcUnits,lp,qual); return HvCall2(HvCallCfgGetSharedProcUnits, lp, qual);
// getPaca()->adjustHmtForNoOfSpinLocksHeld();
return retVal;
} }
static inline u64 HvCallCfg_getNumProcsInSharedPool(HvLpSharedPoolIndex sPI) static inline u64 HvCallCfg_getNumProcsInSharedPool(HvLpSharedPoolIndex sPI)
{ {
u16 retVal = HvCall1(HvCallCfgGetNumProcsInSharedPool,sPI); u16 retVal = HvCall1(HvCallCfgGetNumProcsInSharedPool, sPI);
// getPaca()->adjustHmtForNoOfSpinLocksHeld();
return retVal; return retVal;
} }
static inline HvLpIndex HvCallCfg_getHostingLpIndex(HvLpIndex lp) static inline HvLpIndex HvCallCfg_getHostingLpIndex(HvLpIndex lp)
{ {
u64 retVal = HvCall1(HvCallCfgGetHostingLpIndex,lp); u64 retVal = HvCall1(HvCallCfgGetHostingLpIndex, lp);
// getPaca()->adjustHmtForNoOfSpinLocksHeld();
return retVal; return retVal;
} }
......
...@@ -82,13 +82,11 @@ typedef u64 HvLpDma_Rc; ...@@ -82,13 +82,11 @@ typedef u64 HvLpDma_Rc;
static inline void HvCallEvent_getOverflowLpEvents(u8 queueIndex) static inline void HvCallEvent_getOverflowLpEvents(u8 queueIndex)
{ {
HvCall1(HvCallEventGetOverflowLpEvents, queueIndex); HvCall1(HvCallEventGetOverflowLpEvents, queueIndex);
// getPaca()->adjustHmtForNoOfSpinLocksHeld();
} }
static inline void HvCallEvent_setInterLpQueueIndex(u8 queueIndex) static inline void HvCallEvent_setInterLpQueueIndex(u8 queueIndex)
{ {
HvCall1(HvCallEventSetInterLpQueueIndex, queueIndex); HvCall1(HvCallEventSetInterLpQueueIndex, queueIndex);
// getPaca()->adjustHmtForNoOfSpinLocksHeld();
} }
static inline void HvCallEvent_setLpEventStack(u8 queueIndex, static inline void HvCallEvent_setLpEventStack(u8 queueIndex,
...@@ -99,7 +97,6 @@ static inline void HvCallEvent_setLpEventStack(u8 queueIndex, ...@@ -99,7 +97,6 @@ static inline void HvCallEvent_setLpEventStack(u8 queueIndex,
abs_addr = virt_to_abs(eventStackAddr); abs_addr = virt_to_abs(eventStackAddr);
HvCall3(HvCallEventSetLpEventStack, queueIndex, abs_addr, HvCall3(HvCallEventSetLpEventStack, queueIndex, abs_addr,
eventStackSize); eventStackSize);
// getPaca()->adjustHmtForNoOfSpinLocksHeld();
} }
static inline void HvCallEvent_setLpEventQueueInterruptProc(u8 queueIndex, static inline void HvCallEvent_setLpEventQueueInterruptProc(u8 queueIndex,
...@@ -107,22 +104,18 @@ static inline void HvCallEvent_setLpEventQueueInterruptProc(u8 queueIndex, ...@@ -107,22 +104,18 @@ static inline void HvCallEvent_setLpEventQueueInterruptProc(u8 queueIndex,
{ {
HvCall2(HvCallEventSetLpEventQueueInterruptProc, queueIndex, HvCall2(HvCallEventSetLpEventQueueInterruptProc, queueIndex,
lpLogicalProcIndex); lpLogicalProcIndex);
// getPaca()->adjustHmtForNoOfSpinLocksHeld();
} }
static inline HvLpEvent_Rc HvCallEvent_signalLpEvent(struct HvLpEvent *event) static inline HvLpEvent_Rc HvCallEvent_signalLpEvent(struct HvLpEvent *event)
{ {
u64 abs_addr; u64 abs_addr;
HvLpEvent_Rc retVal;
#ifdef DEBUG_SENDEVENT #ifdef DEBUG_SENDEVENT
printk("HvCallEvent_signalLpEvent: *event = %016lx\n ", printk("HvCallEvent_signalLpEvent: *event = %016lx\n ",
(unsigned long)event); (unsigned long)event);
#endif #endif
abs_addr = virt_to_abs(event); abs_addr = virt_to_abs(event);
retVal = (HvLpEvent_Rc)HvCall1(HvCallEventSignalLpEvent, abs_addr); return HvCall1(HvCallEventSignalLpEvent, abs_addr);
// getPaca()->adjustHmtForNoOfSpinLocksHeld();
return retVal;
} }
static inline HvLpEvent_Rc HvCallEvent_signalLpEventFast(HvLpIndex targetLp, static inline HvLpEvent_Rc HvCallEvent_signalLpEventFast(HvLpIndex targetLp,
...@@ -132,8 +125,6 @@ static inline HvLpEvent_Rc HvCallEvent_signalLpEventFast(HvLpIndex targetLp, ...@@ -132,8 +125,6 @@ static inline HvLpEvent_Rc HvCallEvent_signalLpEventFast(HvLpIndex targetLp,
u64 eventData1, u64 eventData2, u64 eventData3, u64 eventData1, u64 eventData2, u64 eventData3,
u64 eventData4, u64 eventData5) u64 eventData4, u64 eventData5)
{ {
HvLpEvent_Rc retVal;
/* Pack the misc bits into a single Dword to pass to PLIC */ /* Pack the misc bits into a single Dword to pass to PLIC */
union { union {
struct HvCallEvent_PackedParms parms; struct HvCallEvent_PackedParms parms;
...@@ -148,67 +139,49 @@ static inline HvLpEvent_Rc HvCallEvent_signalLpEventFast(HvLpIndex targetLp, ...@@ -148,67 +139,49 @@ static inline HvLpEvent_Rc HvCallEvent_signalLpEventFast(HvLpIndex targetLp,
packed.parms.xSourceInstId = sourceInstanceId; packed.parms.xSourceInstId = sourceInstanceId;
packed.parms.xTargetInstId = targetInstanceId; packed.parms.xTargetInstId = targetInstanceId;
retVal = (HvLpEvent_Rc)HvCall7(HvCallEventSignalLpEventParms, return HvCall7(HvCallEventSignalLpEventParms, packed.dword,
packed.dword, correlationToken, eventData1,eventData2, correlationToken, eventData1, eventData2,
eventData3,eventData4, eventData5); eventData3, eventData4, eventData5);
// getPaca()->adjustHmtForNoOfSpinLocksHeld();
return retVal;
} }
static inline HvLpEvent_Rc HvCallEvent_ackLpEvent(struct HvLpEvent *event) static inline HvLpEvent_Rc HvCallEvent_ackLpEvent(struct HvLpEvent *event)
{ {
u64 abs_addr; u64 abs_addr;
HvLpEvent_Rc retVal;
abs_addr = virt_to_abs(event); abs_addr = virt_to_abs(event);
retVal = (HvLpEvent_Rc)HvCall1(HvCallEventAckLpEvent, abs_addr); return HvCall1(HvCallEventAckLpEvent, abs_addr);
// getPaca()->adjustHmtForNoOfSpinLocksHeld();
return retVal;
} }
static inline HvLpEvent_Rc HvCallEvent_cancelLpEvent(struct HvLpEvent *event) static inline HvLpEvent_Rc HvCallEvent_cancelLpEvent(struct HvLpEvent *event)
{ {
u64 abs_addr; u64 abs_addr;
HvLpEvent_Rc retVal;
abs_addr = virt_to_abs(event); abs_addr = virt_to_abs(event);
retVal = (HvLpEvent_Rc)HvCall1(HvCallEventCancelLpEvent, abs_addr); return HvCall1(HvCallEventCancelLpEvent, abs_addr);
// getPaca()->adjustHmtForNoOfSpinLocksHeld();
return retVal;
} }
static inline HvLpInstanceId HvCallEvent_getSourceLpInstanceId( static inline HvLpInstanceId HvCallEvent_getSourceLpInstanceId(
HvLpIndex targetLp, HvLpEvent_Type type) HvLpIndex targetLp, HvLpEvent_Type type)
{ {
HvLpInstanceId retVal; return HvCall2(HvCallEventGetSourceLpInstanceId, targetLp, type);
retVal = HvCall2(HvCallEventGetSourceLpInstanceId, targetLp, type);
// getPaca()->adjustHmtForNoOfSpinLocksHeld();
return retVal;
} }
static inline HvLpInstanceId HvCallEvent_getTargetLpInstanceId( static inline HvLpInstanceId HvCallEvent_getTargetLpInstanceId(
HvLpIndex targetLp, HvLpEvent_Type type) HvLpIndex targetLp, HvLpEvent_Type type)
{ {
HvLpInstanceId retVal; return HvCall2(HvCallEventGetTargetLpInstanceId, targetLp, type);
retVal = HvCall2(HvCallEventGetTargetLpInstanceId, targetLp, type);
// getPaca()->adjustHmtForNoOfSpinLocksHeld();
return retVal;
} }
static inline void HvCallEvent_openLpEventPath(HvLpIndex targetLp, static inline void HvCallEvent_openLpEventPath(HvLpIndex targetLp,
HvLpEvent_Type type) HvLpEvent_Type type)
{ {
HvCall2(HvCallEventOpenLpEventPath, targetLp, type); HvCall2(HvCallEventOpenLpEventPath, targetLp, type);
// getPaca()->adjustHmtForNoOfSpinLocksHeld();
} }
static inline void HvCallEvent_closeLpEventPath(HvLpIndex targetLp, static inline void HvCallEvent_closeLpEventPath(HvLpIndex targetLp,
HvLpEvent_Type type) HvLpEvent_Type type)
{ {
HvCall2(HvCallEventCloseLpEventPath, targetLp, type); HvCall2(HvCallEventCloseLpEventPath, targetLp, type);
// getPaca()->adjustHmtForNoOfSpinLocksHeld();
} }
static inline HvLpDma_Rc HvCallEvent_dmaBufList(HvLpEvent_Type type, static inline HvLpDma_Rc HvCallEvent_dmaBufList(HvLpEvent_Type type,
...@@ -220,7 +193,6 @@ static inline HvLpDma_Rc HvCallEvent_dmaBufList(HvLpEvent_Type type, ...@@ -220,7 +193,6 @@ static inline HvLpDma_Rc HvCallEvent_dmaBufList(HvLpEvent_Type type,
/* Do these need to be converted to absolute addresses? */ /* Do these need to be converted to absolute addresses? */
u64 localBufList, u64 remoteBufList, u32 transferLength) u64 localBufList, u64 remoteBufList, u32 transferLength)
{ {
HvLpDma_Rc retVal;
/* Pack the misc bits into a single Dword to pass to PLIC */ /* Pack the misc bits into a single Dword to pass to PLIC */
union { union {
struct HvCallEvent_PackedDmaParms parms; struct HvCallEvent_PackedDmaParms parms;
...@@ -237,11 +209,8 @@ static inline HvLpDma_Rc HvCallEvent_dmaBufList(HvLpEvent_Type type, ...@@ -237,11 +209,8 @@ static inline HvLpDma_Rc HvCallEvent_dmaBufList(HvLpEvent_Type type,
packed.parms.xLocalInstId = localInstanceId; packed.parms.xLocalInstId = localInstanceId;
packed.parms.xRemoteInstId = remoteInstanceId; packed.parms.xRemoteInstId = remoteInstanceId;
retVal = (HvLpDma_Rc)HvCall4(HvCallEventDmaBufList, return HvCall4(HvCallEventDmaBufList, packed.dword, localBufList,
packed.dword, localBufList, remoteBufList, remoteBufList, transferLength);
transferLength);
// getPaca()->adjustHmtForNoOfSpinLocksHeld();
return retVal;
} }
static inline HvLpDma_Rc HvCallEvent_dmaSingle(HvLpEvent_Type type, static inline HvLpDma_Rc HvCallEvent_dmaSingle(HvLpEvent_Type type,
...@@ -252,7 +221,6 @@ static inline HvLpDma_Rc HvCallEvent_dmaSingle(HvLpEvent_Type type, ...@@ -252,7 +221,6 @@ static inline HvLpDma_Rc HvCallEvent_dmaSingle(HvLpEvent_Type type,
HvLpDma_AddressType remoteAddressType, HvLpDma_AddressType remoteAddressType,
u64 localAddrOrTce, u64 remoteAddrOrTce, u32 transferLength) u64 localAddrOrTce, u64 remoteAddrOrTce, u32 transferLength)
{ {
HvLpDma_Rc retVal;
/* Pack the misc bits into a single Dword to pass to PLIC */ /* Pack the misc bits into a single Dword to pass to PLIC */
union { union {
struct HvCallEvent_PackedDmaParms parms; struct HvCallEvent_PackedDmaParms parms;
...@@ -269,24 +237,17 @@ static inline HvLpDma_Rc HvCallEvent_dmaSingle(HvLpEvent_Type type, ...@@ -269,24 +237,17 @@ static inline HvLpDma_Rc HvCallEvent_dmaSingle(HvLpEvent_Type type,
packed.parms.xLocalInstId = localInstanceId; packed.parms.xLocalInstId = localInstanceId;
packed.parms.xRemoteInstId = remoteInstanceId; packed.parms.xRemoteInstId = remoteInstanceId;
retVal = (HvLpDma_Rc)HvCall4(HvCallEventDmaSingle, return (HvLpDma_Rc)HvCall4(HvCallEventDmaSingle, packed.dword,
packed.dword, localAddrOrTce, remoteAddrOrTce, localAddrOrTce, remoteAddrOrTce, transferLength);
transferLength);
// getPaca()->adjustHmtForNoOfSpinLocksHeld();
return retVal;
} }
static inline HvLpDma_Rc HvCallEvent_dmaToSp(void *local, u32 remote, static inline HvLpDma_Rc HvCallEvent_dmaToSp(void *local, u32 remote,
u32 length, HvLpDma_Direction dir) u32 length, HvLpDma_Direction dir)
{ {
u64 abs_addr; u64 abs_addr;
HvLpDma_Rc retVal;
abs_addr = virt_to_abs(local); abs_addr = virt_to_abs(local);
retVal = (HvLpDma_Rc)HvCall4(HvCallEventDmaToSp, abs_addr, remote, return HvCall4(HvCallEventDmaToSp, abs_addr, remote, length, dir);
length, dir);
// getPaca()->adjustHmtForNoOfSpinLocksHeld();
return retVal;
} }
#endif /* _HVCALLEVENT_H */ #endif /* _HVCALLEVENT_H */
...@@ -43,34 +43,27 @@ ...@@ -43,34 +43,27 @@
static inline u64 HvCallHpt_getHptAddress(void) static inline u64 HvCallHpt_getHptAddress(void)
{ {
u64 retval = HvCall0(HvCallHptGetHptAddress); return HvCall0(HvCallHptGetHptAddress);
// getPaca()->adjustHmtForNoOfSpinLocksHeld();
return retval;
} }
static inline u64 HvCallHpt_getHptPages(void) static inline u64 HvCallHpt_getHptPages(void)
{ {
u64 retval = HvCall0(HvCallHptGetHptPages); return HvCall0(HvCallHptGetHptPages);
// getPaca()->adjustHmtForNoOfSpinLocksHeld();
return retval;
} }
static inline void HvCallHpt_setPp(u32 hpteIndex, u8 value) static inline void HvCallHpt_setPp(u32 hpteIndex, u8 value)
{ {
HvCall2(HvCallHptSetPp, hpteIndex, value); HvCall2(HvCallHptSetPp, hpteIndex, value);
// getPaca()->adjustHmtForNoOfSpinLocksHeld();
} }
static inline void HvCallHpt_setSwBits(u32 hpteIndex, u8 bitson, u8 bitsoff) static inline void HvCallHpt_setSwBits(u32 hpteIndex, u8 bitson, u8 bitsoff)
{ {
HvCall3(HvCallHptSetSwBits, hpteIndex, bitson, bitsoff); HvCall3(HvCallHptSetSwBits, hpteIndex, bitson, bitsoff);
// getPaca()->adjustHmtForNoOfSpinLocksHeld();
} }
static inline void HvCallHpt_invalidateNoSyncICache(u32 hpteIndex) static inline void HvCallHpt_invalidateNoSyncICache(u32 hpteIndex)
{ {
HvCall1(HvCallHptInvalidateNoSyncICache, hpteIndex); HvCall1(HvCallHptInvalidateNoSyncICache, hpteIndex);
// getPaca()->adjustHmtForNoOfSpinLocksHeld();
} }
static inline u64 HvCallHpt_invalidateSetSwBitsGet(u32 hpteIndex, u8 bitson, static inline u64 HvCallHpt_invalidateSetSwBitsGet(u32 hpteIndex, u8 bitson,
...@@ -81,36 +74,30 @@ static inline u64 HvCallHpt_invalidateSetSwBitsGet(u32 hpteIndex, u8 bitson, ...@@ -81,36 +74,30 @@ static inline u64 HvCallHpt_invalidateSetSwBitsGet(u32 hpteIndex, u8 bitson,
compressedStatus = HvCall4(HvCallHptInvalidateSetSwBitsGet, compressedStatus = HvCall4(HvCallHptInvalidateSetSwBitsGet,
hpteIndex, bitson, bitsoff, 1); hpteIndex, bitson, bitsoff, 1);
HvCall1(HvCallHptInvalidateNoSyncICache, hpteIndex); HvCall1(HvCallHptInvalidateNoSyncICache, hpteIndex);
// getPaca()->adjustHmtForNoOfSpinLocksHeld();
return compressedStatus; return compressedStatus;
} }
static inline u64 HvCallHpt_findValid(HPTE *hpte, u64 vpn) static inline u64 HvCallHpt_findValid(HPTE *hpte, u64 vpn)
{ {
u64 retIndex = HvCall3Ret16( HvCallHptFindValid, hpte, vpn, 0, 0 ); return HvCall3Ret16(HvCallHptFindValid, hpte, vpn, 0, 0);
// getPaca()->adjustHmtForNoOfSpinLocksHeld();
return retIndex;
} }
static inline u64 HvCallHpt_findNextValid(HPTE *hpte, u32 hpteIndex, static inline u64 HvCallHpt_findNextValid(HPTE *hpte, u32 hpteIndex,
u8 bitson, u8 bitsoff) u8 bitson, u8 bitsoff)
{ {
u64 retIndex = HvCall3Ret16( HvCallHptFindNextValid, hpte, hpteIndex, bitson, bitsoff ); return HvCall3Ret16(HvCallHptFindNextValid, hpte, hpteIndex,
// getPaca()->adjustHmtForNoOfSpinLocksHeld(); bitson, bitsoff);
return retIndex;
} }
static inline void HvCallHpt_get(HPTE *hpte, u32 hpteIndex) static inline void HvCallHpt_get(HPTE *hpte, u32 hpteIndex)
{ {
HvCall2Ret16(HvCallHptGet, hpte, hpteIndex, 0); HvCall2Ret16(HvCallHptGet, hpte, hpteIndex, 0);
// getPaca()->adjustHmtForNoOfSpinLocksHeld();
} }
static inline void HvCallHpt_addValidate(u32 hpteIndex, u32 hBit, HPTE *hpte) static inline void HvCallHpt_addValidate(u32 hpteIndex, u32 hBit, HPTE *hpte)
{ {
HvCall4(HvCallHptAddValidate, hpteIndex, hBit, (*((u64 *)hpte)), HvCall4(HvCallHptAddValidate, hpteIndex, hBit, (*((u64 *)hpte)),
(*(((u64 *)hpte)+1))); (*(((u64 *)hpte)+1)));
// getPaca()->adjustHmtForNoOfSpinLocksHeld();
} }
#endif /* _HVCALLHPT_H */ #endif /* _HVCALLHPT_H */
This diff is collapsed.
...@@ -32,10 +32,7 @@ ...@@ -32,10 +32,7 @@
static inline u64 HvCallSm_get64BitsOfAccessMap(HvLpIndex lpIndex, static inline u64 HvCallSm_get64BitsOfAccessMap(HvLpIndex lpIndex,
u64 indexIntoBitMap) u64 indexIntoBitMap)
{ {
u64 retval = HvCall2(HvCallSmGet64BitsOfAccessMap, lpIndex, return HvCall2(HvCallSmGet64BitsOfAccessMap, lpIndex, indexIntoBitMap);
indexIntoBitMap );
// getPaca()->adjustHmtForNoOfSpinLocksHeld();
return retval;
} }
#endif /* _HVCALLSM_H */ #endif /* _HVCALLSM_H */
...@@ -19,58 +19,43 @@ ...@@ -19,58 +19,43 @@
static inline void HvCallXm_getTceTableParms(u64 cb) static inline void HvCallXm_getTceTableParms(u64 cb)
{ {
HvCall1(HvCallXmGetTceTableParms, cb); HvCall1(HvCallXmGetTceTableParms, cb);
// getPaca()->adjustHmtForNoOfSpinLocksHeld();
} }
static inline u64 HvCallXm_setTce(u64 tceTableToken, u64 tceOffset, u64 tce) static inline u64 HvCallXm_setTce(u64 tceTableToken, u64 tceOffset, u64 tce)
{ {
u64 retval = HvCall3(HvCallXmSetTce, tceTableToken, tceOffset, tce ); return HvCall3(HvCallXmSetTce, tceTableToken, tceOffset, tce);
// getPaca()->adjustHmtForNoOfSpinLocksHeld();
return retval;
} }
static inline u64 HvCallXm_setTces(u64 tceTableToken, u64 tceOffset, static inline u64 HvCallXm_setTces(u64 tceTableToken, u64 tceOffset,
u64 numTces, u64 tce1, u64 tce2, u64 tce3, u64 tce4) u64 numTces, u64 tce1, u64 tce2, u64 tce3, u64 tce4)
{ {
u64 retval = HvCall7(HvCallXmSetTces, tceTableToken, tceOffset, numTces, return HvCall7(HvCallXmSetTces, tceTableToken, tceOffset, numTces,
tce1, tce2, tce3, tce4 ); tce1, tce2, tce3, tce4);
// getPaca()->adjustHmtForNoOfSpinLocksHeld();
return retval;
} }
static inline u64 HvCallXm_testBus(u16 busNumber) static inline u64 HvCallXm_testBus(u16 busNumber)
{ {
u64 retVal = HvCall1(HvCallXmTestBus, busNumber); return HvCall1(HvCallXmTestBus, busNumber);
// getPaca()->adjustHmtForNoOfSpinLocksHeld();
return retVal;
} }
static inline u64 HvCallXm_testBusUnit(u16 busNumber, u8 subBusNumber, static inline u64 HvCallXm_testBusUnit(u16 busNumber, u8 subBusNumber,
u8 deviceId) u8 deviceId)
{ {
u64 busUnitNumber = (subBusNumber << 8) | deviceId; return HvCall2(HvCallXmTestBusUnit, busNumber,
u64 retVal = HvCall2(HvCallXmTestBusUnit, busNumber, busUnitNumber); (subBusNumber << 8) | deviceId);
// getPaca()->adjustHmtForNoOfSpinLocksHeld();
return retVal;
} }
static inline u64 HvCallXm_connectBusUnit(u16 busNumber, u8 subBusNumber, static inline u64 HvCallXm_connectBusUnit(u16 busNumber, u8 subBusNumber,
u8 deviceId, u64 interruptToken) u8 deviceId, u64 interruptToken)
{ {
u64 busUnitNumber = (subBusNumber << 8) | deviceId; return HvCall5(HvCallXmConnectBusUnit, busNumber,
u64 queueIndex = 0; // HvLpConfig::mapDsaToQueueIndex(HvLpDSA(busNumber, xBoard, xCard)); (subBusNumber << 8) | deviceId, interruptToken, 0,
0 /* HvLpConfig::mapDsaToQueueIndex(HvLpDSA(busNumber, xBoard, xCard)) */);
u64 retVal = HvCall5(HvCallXmConnectBusUnit, busNumber, busUnitNumber,
interruptToken, 0, queueIndex);
// getPaca()->adjustHmtForNoOfSpinLocksHeld();
return retVal;
} }
static inline u64 HvCallXm_loadTod(void) static inline u64 HvCallXm_loadTod(void)
{ {
u64 retVal = HvCall0(HvCallXmLoadTod); return HvCall0(HvCallXmLoadTod);
// getPaca()->adjustHmtForNoOfSpinLocksHeld();
return retVal;
} }
#endif /* _HVCALLXM_H */ #endif /* _HVCALLXM_H */
...@@ -281,8 +281,7 @@ static inline u64 HvLpConfig_getLoadPages(void) ...@@ -281,8 +281,7 @@ static inline u64 HvLpConfig_getLoadPages(void)
static inline int HvLpConfig_isBusOwnedByThisLp(HvBusNumber busNumber) static inline int HvLpConfig_isBusOwnedByThisLp(HvBusNumber busNumber)
{ {
HvLpIndex busOwner = HvLpConfig_getBusOwner(busNumber); return (HvLpConfig_getBusOwner(busNumber) == HvLpConfig_getLpIndex());
return (busOwner == HvLpConfig_getLpIndex());
} }
static inline int HvLpConfig_doLpsCommunicateOnVirtualLan(HvLpIndex lp1, static inline int HvLpConfig_doLpsCommunicateOnVirtualLan(HvLpIndex lp1,
......
#ifndef __XMPCILPEVENT_H__ #ifndef __XMPCILPEVENT_H__
#define __XMPCILPEVENT_H__ #define __XMPCILPEVENT_H__
#ifdef __cplusplus extern int XmPciLpEvent_init(void);
extern "C" { extern void ppc_irq_dispatch_handler(struct pt_regs *regs, int irq);
#endif
int XmPciLpEvent_init(void);
void ppc_irq_dispatch_handler(struct pt_regs *regs, int irq);
#ifdef __cplusplus
}
#endif
#endif /* __XMPCILPEVENT_H__ */ #endif /* __XMPCILPEVENT_H__ */
#ifndef __ISERIES_IRQ_H__ #ifndef __ISERIES_IRQ_H__
#define __ISERIES_IRQ_H__ #define __ISERIES_IRQ_H__
#ifdef __cplusplus extern void iSeries_init_IRQ(void);
extern "C" { extern int iSeries_allocate_IRQ(HvBusNumber, HvSubBusNumber, HvAgentId);
#endif extern int iSeries_assign_IRQ(int, HvBusNumber, HvSubBusNumber, HvAgentId);
extern void iSeries_activate_IRQs(void);
void iSeries_init_IRQ(void); extern int XmPciLpEvent_init(void);
int iSeries_allocate_IRQ(HvBusNumber, HvSubBusNumber, HvAgentId);
int iSeries_assign_IRQ(int, HvBusNumber, HvSubBusNumber, HvAgentId);
void iSeries_activate_IRQs(void);
int XmPciLpEvent_init(void);
#ifdef __cplusplus
}
#endif
#endif /* __ISERIES_IRQ_H__ */ #endif /* __ISERIES_IRQ_H__ */
...@@ -55,7 +55,7 @@ struct iSeries_Device_Node; ...@@ -55,7 +55,7 @@ struct iSeries_Device_Node;
*/ */
#define ISERIES_PCI_AGENTID(idsel, func) \ #define ISERIES_PCI_AGENTID(idsel, func) \
((idsel & 0x0F) << 4) | (func & 0x07) (((idsel & 0x0F) << 4) | (func & 0x07))
#define ISERIES_ENCODE_DEVICE(agentid) \ #define ISERIES_ENCODE_DEVICE(agentid) \
((0x10) | ((agentid & 0x20) >> 2) | (agentid & 0x07)) ((0x10) | ((agentid & 0x20) >> 2) | (agentid & 0x07))
......
...@@ -58,16 +58,16 @@ ...@@ -58,16 +58,16 @@
*/ */
typedef void (vio_event_handler_t) (struct HvLpEvent * event); typedef void (vio_event_handler_t) (struct HvLpEvent * event);
int viopath_open(HvLpIndex remoteLp, int subtype, int numReq); extern int viopath_open(HvLpIndex remoteLp, int subtype, int numReq);
int viopath_close(HvLpIndex remoteLp, int subtype, int numReq); extern int viopath_close(HvLpIndex remoteLp, int subtype, int numReq);
int vio_setHandler(int subtype, vio_event_handler_t * beh); extern int vio_setHandler(int subtype, vio_event_handler_t * beh);
int vio_clearHandler(int subtype); extern int vio_clearHandler(int subtype);
int viopath_isactive(HvLpIndex lp); extern int viopath_isactive(HvLpIndex lp);
HvLpInstanceId viopath_sourceinst(HvLpIndex lp); extern HvLpInstanceId viopath_sourceinst(HvLpIndex lp);
HvLpInstanceId viopath_targetinst(HvLpIndex lp); extern HvLpInstanceId viopath_targetinst(HvLpIndex lp);
void vio_set_hostlp(void); extern void vio_set_hostlp(void);
void *vio_get_event_buffer(int subtype); extern void *vio_get_event_buffer(int subtype);
void vio_free_event_buffer(int subtype, void *buffer); extern void vio_free_event_buffer(int subtype, void *buffer);
extern HvLpIndex viopath_hostLp; extern HvLpIndex viopath_hostLp;
extern HvLpIndex viopath_ourLp; extern HvLpIndex viopath_ourLp;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment