blob: 8b9ba608daafe7cf28578c50f073a9eec1f82540 [file] [log] [blame]
Stephen Rothwell45dc76a2005-06-21 17:15:33 -07001/*
2 * This file contains the "hypervisor call" interface which is used to
3 * drive the hypervisor from SLIC.
4 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07005#ifndef _HVCALLXM_H
6#define _HVCALLXM_H
7
Linus Torvalds1da177e2005-04-16 15:20:36 -07008#include <asm/iSeries/HvCallSc.h>
9#include <asm/iSeries/HvTypes.h>
10
Linus Torvalds1da177e2005-04-16 15:20:36 -070011#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 Rothwelle7eb22d2005-06-21 17:15:44 -070019/*
20 * Structure passed to HvCallXm_getTceTableParms
21 */
22struct iommu_table_cb {
23 unsigned long itc_busno; /* Bus number for this tce table */
24 unsigned long itc_start; /* Will be NULL for secondary */
25 unsigned long itc_totalsize; /* Size (in pages) of whole table */
26 unsigned long itc_offset; /* Index into real tce table of the
27 start of our section */
28 unsigned long itc_size; /* Size (in pages) of our section */
29 unsigned long itc_index; /* Index of this tce table */
30 unsigned short itc_maxtables; /* Max num of tables for partition */
31 unsigned char itc_virtbus; /* Flag to indicate virtual bus */
32 unsigned char itc_slotno; /* IOA Tce Slot Index */
33 unsigned char itc_rsvd[4];
34};
35
Stephen Rothwell45dc76a2005-06-21 17:15:33 -070036static inline void HvCallXm_getTceTableParms(u64 cb)
Linus Torvalds1da177e2005-04-16 15:20:36 -070037{
38 HvCall1(HvCallXmGetTceTableParms, cb);
Linus Torvalds1da177e2005-04-16 15:20:36 -070039}
Stephen Rothwell45dc76a2005-06-21 17:15:33 -070040
41static inline u64 HvCallXm_setTce(u64 tceTableToken, u64 tceOffset, u64 tce)
42{
Stephen Rothwell6b7feec2005-06-21 17:15:35 -070043 return HvCall3(HvCallXmSetTce, tceTableToken, tceOffset, tce);
Linus Torvalds1da177e2005-04-16 15:20:36 -070044}
Stephen Rothwell45dc76a2005-06-21 17:15:33 -070045
46static inline u64 HvCallXm_setTces(u64 tceTableToken, u64 tceOffset,
47 u64 numTces, u64 tce1, u64 tce2, u64 tce3, u64 tce4)
48{
Stephen Rothwell6b7feec2005-06-21 17:15:35 -070049 return HvCall7(HvCallXmSetTces, tceTableToken, tceOffset, numTces,
50 tce1, tce2, tce3, tce4);
Linus Torvalds1da177e2005-04-16 15:20:36 -070051}
Stephen Rothwell45dc76a2005-06-21 17:15:33 -070052
53static inline u64 HvCallXm_testBus(u16 busNumber)
Linus Torvalds1da177e2005-04-16 15:20:36 -070054{
Stephen Rothwell6b7feec2005-06-21 17:15:35 -070055 return HvCall1(HvCallXmTestBus, busNumber);
Linus Torvalds1da177e2005-04-16 15:20:36 -070056}
Stephen Rothwell45dc76a2005-06-21 17:15:33 -070057
58static inline u64 HvCallXm_testBusUnit(u16 busNumber, u8 subBusNumber,
59 u8 deviceId)
Linus Torvalds1da177e2005-04-16 15:20:36 -070060{
Stephen Rothwell6b7feec2005-06-21 17:15:35 -070061 return HvCall2(HvCallXmTestBusUnit, busNumber,
62 (subBusNumber << 8) | deviceId);
Linus Torvalds1da177e2005-04-16 15:20:36 -070063}
Stephen Rothwell45dc76a2005-06-21 17:15:33 -070064
65static inline u64 HvCallXm_connectBusUnit(u16 busNumber, u8 subBusNumber,
66 u8 deviceId, u64 interruptToken)
Linus Torvalds1da177e2005-04-16 15:20:36 -070067{
Stephen Rothwell6b7feec2005-06-21 17:15:35 -070068 return HvCall5(HvCallXmConnectBusUnit, busNumber,
69 (subBusNumber << 8) | deviceId, interruptToken, 0,
70 0 /* HvLpConfig::mapDsaToQueueIndex(HvLpDSA(busNumber, xBoard, xCard)) */);
Linus Torvalds1da177e2005-04-16 15:20:36 -070071}
Stephen Rothwell45dc76a2005-06-21 17:15:33 -070072
73static inline u64 HvCallXm_loadTod(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -070074{
Stephen Rothwell6b7feec2005-06-21 17:15:35 -070075 return HvCall0(HvCallXmLoadTod);
Linus Torvalds1da177e2005-04-16 15:20:36 -070076}
Linus Torvalds1da177e2005-04-16 15:20:36 -070077
78#endif /* _HVCALLXM_H */