aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-powerpc
diff options
context:
space:
mode:
authorStephen Rothwell <sfr@canb.auug.org.au>2006-01-11 21:48:52 -0500
committerPaul Mackerras <paulus@samba.org>2006-01-12 04:09:29 -0500
commit6814350b80e0e7dfb87d2faebbcbef876573897c (patch)
treed2baed2f198a7106a459bc9c3584e2b654eca069 /include/asm-powerpc
parentcbbcf3401173f11f7e4c03c7ec8955ea29cd83b5 (diff)
[PATCH] powerpc: remove bitfields from hv_call_event.h
Also does some comment cleanups and removal of unnecessary variables. Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'include/asm-powerpc')
-rw-r--r--include/asm-powerpc/iseries/hv_call_event.h134
1 files changed, 36 insertions, 98 deletions
diff --git a/include/asm-powerpc/iseries/hv_call_event.h b/include/asm-powerpc/iseries/hv_call_event.h
index 46763a30590a..4cec4762076d 100644
--- a/include/asm-powerpc/iseries/hv_call_event.h
+++ b/include/asm-powerpc/iseries/hv_call_event.h
@@ -1,5 +1,4 @@
1/* 1/*
2 * HvCallEvent.h
3 * Copyright (C) 2001 Mike Corrigan IBM Corporation 2 * Copyright (C) 2001 Mike Corrigan IBM Corporation
4 * 3 *
5 * This program is free software; you can redistribute it and/or modify 4 * This program is free software; you can redistribute it and/or modify
@@ -15,8 +14,7 @@
15 * You should have received a copy of the GNU General Public License 14 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software 15 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */ 17 *
19/*
20 * This file contains the "hypervisor call" interface which is used to 18 * This file contains the "hypervisor call" interface which is used to
21 * drive the hypervisor from the OS. 19 * drive the hypervisor from the OS.
22 */ 20 */
@@ -33,32 +31,9 @@ typedef u8 HvLpEvent_Type;
33typedef u8 HvLpEvent_AckInd; 31typedef u8 HvLpEvent_AckInd;
34typedef u8 HvLpEvent_AckType; 32typedef u8 HvLpEvent_AckType;
35 33
36struct HvCallEvent_PackedParms {
37 u8 xAckType:1;
38 u8 xAckInd:1;
39 u8 xRsvd:1;
40 u8 xTargetLp:5;
41 u8 xType;
42 u16 xSubtype;
43 HvLpInstanceId xSourceInstId;
44 HvLpInstanceId xTargetInstId;
45};
46
47typedef u8 HvLpDma_Direction; 34typedef u8 HvLpDma_Direction;
48typedef u8 HvLpDma_AddressType; 35typedef u8 HvLpDma_AddressType;
49 36
50struct HvCallEvent_PackedDmaParms {
51 u8 xDirection:1;
52 u8 xLocalAddrType:1;
53 u8 xRemoteAddrType:1;
54 u8 xRsvd1:5;
55 HvLpIndex xRemoteLp;
56 u8 xType;
57 u8 xRsvd2;
58 HvLpInstanceId xLocalInstId;
59 HvLpInstanceId xRemoteInstId;
60};
61
62typedef u64 HvLpEvent_Rc; 37typedef u64 HvLpEvent_Rc;
63typedef u64 HvLpDma_Rc; 38typedef u64 HvLpDma_Rc;
64 39
@@ -92,11 +67,8 @@ static inline void HvCallEvent_setInterLpQueueIndex(u8 queueIndex)
92static inline void HvCallEvent_setLpEventStack(u8 queueIndex, 67static inline void HvCallEvent_setLpEventStack(u8 queueIndex,
93 char *eventStackAddr, u32 eventStackSize) 68 char *eventStackAddr, u32 eventStackSize)
94{ 69{
95 u64 abs_addr; 70 HvCall3(HvCallEventSetLpEventStack, queueIndex,
96 71 virt_to_abs(eventStackAddr), eventStackSize);
97 abs_addr = virt_to_abs(eventStackAddr);
98 HvCall3(HvCallEventSetLpEventStack, queueIndex, abs_addr,
99 eventStackSize);
100} 72}
101 73
102static inline void HvCallEvent_setLpEventQueueInterruptProc(u8 queueIndex, 74static inline void HvCallEvent_setLpEventQueueInterruptProc(u8 queueIndex,
@@ -108,14 +80,7 @@ static inline void HvCallEvent_setLpEventQueueInterruptProc(u8 queueIndex,
108 80
109static inline HvLpEvent_Rc HvCallEvent_signalLpEvent(struct HvLpEvent *event) 81static inline HvLpEvent_Rc HvCallEvent_signalLpEvent(struct HvLpEvent *event)
110{ 82{
111 u64 abs_addr; 83 return HvCall1(HvCallEventSignalLpEvent, virt_to_abs(event));
112
113#ifdef DEBUG_SENDEVENT
114 printk("HvCallEvent_signalLpEvent: *event = %016lx\n ",
115 (unsigned long)event);
116#endif
117 abs_addr = virt_to_abs(event);
118 return HvCall1(HvCallEventSignalLpEvent, abs_addr);
119} 84}
120 85
121static inline HvLpEvent_Rc HvCallEvent_signalLpEventFast(HvLpIndex targetLp, 86static inline HvLpEvent_Rc HvCallEvent_signalLpEventFast(HvLpIndex targetLp,
@@ -127,17 +92,21 @@ static inline HvLpEvent_Rc HvCallEvent_signalLpEventFast(HvLpIndex targetLp,
127{ 92{
128 /* Pack the misc bits into a single Dword to pass to PLIC */ 93 /* Pack the misc bits into a single Dword to pass to PLIC */
129 union { 94 union {
130 struct HvCallEvent_PackedParms parms; 95 struct {
96 u8 ack_and_target;
97 u8 type;
98 u16 subtype;
99 HvLpInstanceId src_inst;
100 HvLpInstanceId target_inst;
101 } parms;
131 u64 dword; 102 u64 dword;
132 } packed; 103 } packed;
133 packed.parms.xAckType = ackType; 104
134 packed.parms.xAckInd = ackInd; 105 packed.parms.ack_and_target = (ackType << 7) | (ackInd << 6) | targetLp;
135 packed.parms.xRsvd = 0; 106 packed.parms.type = type;
136 packed.parms.xTargetLp = targetLp; 107 packed.parms.subtype = subtype;
137 packed.parms.xType = type; 108 packed.parms.src_inst = sourceInstanceId;
138 packed.parms.xSubtype = subtype; 109 packed.parms.target_inst = targetInstanceId;
139 packed.parms.xSourceInstId = sourceInstanceId;
140 packed.parms.xTargetInstId = targetInstanceId;
141 110
142 return HvCall7(HvCallEventSignalLpEventParms, packed.dword, 111 return HvCall7(HvCallEventSignalLpEventParms, packed.dword,
143 correlationToken, eventData1, eventData2, 112 correlationToken, eventData1, eventData2,
@@ -146,18 +115,12 @@ static inline HvLpEvent_Rc HvCallEvent_signalLpEventFast(HvLpIndex targetLp,
146 115
147static inline HvLpEvent_Rc HvCallEvent_ackLpEvent(struct HvLpEvent *event) 116static inline HvLpEvent_Rc HvCallEvent_ackLpEvent(struct HvLpEvent *event)
148{ 117{
149 u64 abs_addr; 118 return HvCall1(HvCallEventAckLpEvent, virt_to_abs(event));
150
151 abs_addr = virt_to_abs(event);
152 return HvCall1(HvCallEventAckLpEvent, abs_addr);
153} 119}
154 120
155static inline HvLpEvent_Rc HvCallEvent_cancelLpEvent(struct HvLpEvent *event) 121static inline HvLpEvent_Rc HvCallEvent_cancelLpEvent(struct HvLpEvent *event)
156{ 122{
157 u64 abs_addr; 123 return HvCall1(HvCallEventCancelLpEvent, virt_to_abs(event));
158
159 abs_addr = virt_to_abs(event);
160 return HvCall1(HvCallEventCancelLpEvent, abs_addr);
161} 124}
162 125
163static inline HvLpInstanceId HvCallEvent_getSourceLpInstanceId( 126static inline HvLpInstanceId HvCallEvent_getSourceLpInstanceId(
@@ -195,59 +158,34 @@ static inline HvLpDma_Rc HvCallEvent_dmaBufList(HvLpEvent_Type type,
195{ 158{
196 /* Pack the misc bits into a single Dword to pass to PLIC */ 159 /* Pack the misc bits into a single Dword to pass to PLIC */
197 union { 160 union {
198 struct HvCallEvent_PackedDmaParms parms; 161 struct {
162 u8 flags;
163 HvLpIndex remote;
164 u8 type;
165 u8 reserved;
166 HvLpInstanceId local_inst;
167 HvLpInstanceId remote_inst;
168 } parms;
199 u64 dword; 169 u64 dword;
200 } packed; 170 } packed;
201 171
202 packed.parms.xDirection = direction; 172 packed.parms.flags = (direction << 7) |
203 packed.parms.xLocalAddrType = localAddressType; 173 (localAddressType << 6) | (remoteAddressType << 5);
204 packed.parms.xRemoteAddrType = remoteAddressType; 174 packed.parms.remote = remoteLp;
205 packed.parms.xRsvd1 = 0; 175 packed.parms.type = type;
206 packed.parms.xRemoteLp = remoteLp; 176 packed.parms.reserved = 0;
207 packed.parms.xType = type; 177 packed.parms.local_inst = localInstanceId;
208 packed.parms.xRsvd2 = 0; 178 packed.parms.remote_inst = remoteInstanceId;
209 packed.parms.xLocalInstId = localInstanceId;
210 packed.parms.xRemoteInstId = remoteInstanceId;
211 179
212 return HvCall4(HvCallEventDmaBufList, packed.dword, localBufList, 180 return HvCall4(HvCallEventDmaBufList, packed.dword, localBufList,
213 remoteBufList, transferLength); 181 remoteBufList, transferLength);
214} 182}
215 183
216static inline HvLpDma_Rc HvCallEvent_dmaSingle(HvLpEvent_Type type,
217 HvLpIndex remoteLp, HvLpDma_Direction direction,
218 HvLpInstanceId localInstanceId,
219 HvLpInstanceId remoteInstanceId,
220 HvLpDma_AddressType localAddressType,
221 HvLpDma_AddressType remoteAddressType,
222 u64 localAddrOrTce, u64 remoteAddrOrTce, u32 transferLength)
223{
224 /* Pack the misc bits into a single Dword to pass to PLIC */
225 union {
226 struct HvCallEvent_PackedDmaParms parms;
227 u64 dword;
228 } packed;
229
230 packed.parms.xDirection = direction;
231 packed.parms.xLocalAddrType = localAddressType;
232 packed.parms.xRemoteAddrType = remoteAddressType;
233 packed.parms.xRsvd1 = 0;
234 packed.parms.xRemoteLp = remoteLp;
235 packed.parms.xType = type;
236 packed.parms.xRsvd2 = 0;
237 packed.parms.xLocalInstId = localInstanceId;
238 packed.parms.xRemoteInstId = remoteInstanceId;
239
240 return (HvLpDma_Rc)HvCall4(HvCallEventDmaSingle, packed.dword,
241 localAddrOrTce, remoteAddrOrTce, transferLength);
242}
243
244static inline HvLpDma_Rc HvCallEvent_dmaToSp(void *local, u32 remote, 184static inline HvLpDma_Rc HvCallEvent_dmaToSp(void *local, u32 remote,
245 u32 length, HvLpDma_Direction dir) 185 u32 length, HvLpDma_Direction dir)
246{ 186{
247 u64 abs_addr; 187 return HvCall4(HvCallEventDmaToSp, virt_to_abs(local), remote,
248 188 length, dir);
249 abs_addr = virt_to_abs(local);
250 return HvCall4(HvCallEventDmaToSp, abs_addr, remote, length, dir);
251} 189}
252 190
253#endif /* _ASM_POWERPC_ISERIES_HV_CALL_EVENT_H */ 191#endif /* _ASM_POWERPC_ISERIES_HV_CALL_EVENT_H */