Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame^] | 1 | /* |
| 2 | * This file contains the "hypervisor call" interface which is used to |
| 3 | * drive the hypervisor from SLIC. |
| 4 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 5 | #ifndef _HVCALLXM_H |
| 6 | #define _HVCALLXM_H |
| 7 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 8 | #include <asm/iSeries/HvCallSc.h> |
| 9 | #include <asm/iSeries/HvTypes.h> |
| 10 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 11 | #define HvCallXmGetTceTableParms HvCallXm + 0 |
| 12 | #define HvCallXmTestBus HvCallXm + 1 |
| 13 | #define HvCallXmConnectBusUnit HvCallXm + 2 |
| 14 | #define HvCallXmLoadTod HvCallXm + 8 |
| 15 | #define HvCallXmTestBusUnit HvCallXm + 9 |
| 16 | #define HvCallXmSetTce HvCallXm + 11 |
| 17 | #define HvCallXmSetTces HvCallXm + 13 |
| 18 | |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame^] | 19 | static inline void HvCallXm_getTceTableParms(u64 cb) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 20 | { |
| 21 | HvCall1(HvCallXmGetTceTableParms, cb); |
| 22 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); |
| 23 | } |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame^] | 24 | |
| 25 | static inline u64 HvCallXm_setTce(u64 tceTableToken, u64 tceOffset, u64 tce) |
| 26 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 27 | u64 retval = HvCall3(HvCallXmSetTce, tceTableToken, tceOffset, tce ); |
| 28 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); |
| 29 | return retval; |
| 30 | } |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame^] | 31 | |
| 32 | static inline u64 HvCallXm_setTces(u64 tceTableToken, u64 tceOffset, |
| 33 | u64 numTces, u64 tce1, u64 tce2, u64 tce3, u64 tce4) |
| 34 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 35 | u64 retval = HvCall7(HvCallXmSetTces, tceTableToken, tceOffset, numTces, |
| 36 | tce1, tce2, tce3, tce4 ); |
| 37 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); |
| 38 | return retval; |
| 39 | } |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame^] | 40 | |
| 41 | static inline u64 HvCallXm_testBus(u16 busNumber) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 42 | { |
| 43 | u64 retVal = HvCall1(HvCallXmTestBus, busNumber); |
| 44 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); |
| 45 | return retVal; |
| 46 | } |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame^] | 47 | |
| 48 | static inline u64 HvCallXm_testBusUnit(u16 busNumber, u8 subBusNumber, |
| 49 | u8 deviceId) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 50 | { |
| 51 | u64 busUnitNumber = (subBusNumber << 8) | deviceId; |
| 52 | u64 retVal = HvCall2(HvCallXmTestBusUnit, busNumber, busUnitNumber); |
| 53 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); |
| 54 | return retVal; |
| 55 | } |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame^] | 56 | |
| 57 | static inline u64 HvCallXm_connectBusUnit(u16 busNumber, u8 subBusNumber, |
| 58 | u8 deviceId, u64 interruptToken) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 59 | { |
| 60 | u64 busUnitNumber = (subBusNumber << 8) | deviceId; |
| 61 | u64 queueIndex = 0; // HvLpConfig::mapDsaToQueueIndex(HvLpDSA(busNumber, xBoard, xCard)); |
| 62 | |
| 63 | u64 retVal = HvCall5(HvCallXmConnectBusUnit, busNumber, busUnitNumber, |
| 64 | interruptToken, 0, queueIndex); |
| 65 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); |
| 66 | return retVal; |
| 67 | } |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame^] | 68 | |
| 69 | static inline u64 HvCallXm_loadTod(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 70 | { |
| 71 | u64 retVal = HvCall0(HvCallXmLoadTod); |
| 72 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); |
| 73 | return retVal; |
| 74 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 75 | |
| 76 | #endif /* _HVCALLXM_H */ |