diff options
author | Dean Nelson <dcn@sgi.com> | 2008-07-30 01:34:08 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-30 12:41:49 -0400 |
commit | 97bf1aa1e1bb18de9bb1987c6eb9ad751bf08aab (patch) | |
tree | c07472cdffc9c53aefa7f7eeb6098b18bc4f7ac1 /drivers/misc/sgi-xp/xp.h | |
parent | aaa3cd694c0c4ae534e8aafdf4227e395c57d6bd (diff) |
sgi-xp: move xpc_allocate() into xpc_send()/xpc_send_notify()
Move xpc_allocate() functionality into xpc_send()/xpc_send_notify() so
xpc_allocate() no longer needs to be called by XPNET.
Signed-off-by: Dean Nelson <dcn@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/misc/sgi-xp/xp.h')
-rw-r--r-- | drivers/misc/sgi-xp/xp.h | 44 |
1 files changed, 17 insertions, 27 deletions
diff --git a/drivers/misc/sgi-xp/xp.h b/drivers/misc/sgi-xp/xp.h index 0f75592896dd..43bf2470850e 100644 --- a/drivers/misc/sgi-xp/xp.h +++ b/drivers/misc/sgi-xp/xp.h | |||
@@ -116,12 +116,6 @@ | |||
116 | * The size of the payload is defined by the user via xpc_connect(). A user- | 116 | * The size of the payload is defined by the user via xpc_connect(). A user- |
117 | * defined message resides in the payload area. | 117 | * defined message resides in the payload area. |
118 | * | 118 | * |
119 | * The user should have no dealings with the message header, but only the | ||
120 | * message's payload. When a message entry is allocated (via xpc_allocate()) | ||
121 | * a pointer to the payload area is returned and not the actual beginning of | ||
122 | * the XPC message. The user then constructs a message in the payload area | ||
123 | * and passes that pointer as an argument on xpc_send() or xpc_send_notify(). | ||
124 | * | ||
125 | * The size of a message entry (within a message queue) must be a cacheline | 119 | * The size of a message entry (within a message queue) must be a cacheline |
126 | * sized multiple in order to facilitate the BTE transfer of messages from one | 120 | * sized multiple in order to facilitate the BTE transfer of messages from one |
127 | * message queue to another. A macro, XPC_MSG_SIZE(), is provided for the user | 121 | * message queue to another. A macro, XPC_MSG_SIZE(), is provided for the user |
@@ -221,9 +215,10 @@ enum xp_retval { | |||
221 | xpBteCopyError, /* 52: bte_copy() returned error */ | 215 | xpBteCopyError, /* 52: bte_copy() returned error */ |
222 | xpSalError, /* 53: sn SAL error */ | 216 | xpSalError, /* 53: sn SAL error */ |
223 | xpRsvdPageNotSet, /* 54: the reserved page is not set up */ | 217 | xpRsvdPageNotSet, /* 54: the reserved page is not set up */ |
218 | xpPayloadTooBig, /* 55: payload too large for message slot */ | ||
224 | 219 | ||
225 | xpUnsupported, /* 55: unsupported functionality or resource */ | 220 | xpUnsupported, /* 56: unsupported functionality or resource */ |
226 | xpUnknownReason /* 56: unknown reason - must be last in enum */ | 221 | xpUnknownReason /* 57: unknown reason - must be last in enum */ |
227 | }; | 222 | }; |
228 | 223 | ||
229 | /* | 224 | /* |
@@ -304,16 +299,15 @@ struct xpc_registration { | |||
304 | 299 | ||
305 | #define XPC_CHANNEL_REGISTERED(_c) (xpc_registrations[_c].func != NULL) | 300 | #define XPC_CHANNEL_REGISTERED(_c) (xpc_registrations[_c].func != NULL) |
306 | 301 | ||
307 | /* the following are valid xpc_allocate() flags */ | 302 | /* the following are valid xpc_send() or xpc_send_notify() flags */ |
308 | #define XPC_WAIT 0 /* wait flag */ | 303 | #define XPC_WAIT 0 /* wait flag */ |
309 | #define XPC_NOWAIT 1 /* no wait flag */ | 304 | #define XPC_NOWAIT 1 /* no wait flag */ |
310 | 305 | ||
311 | struct xpc_interface { | 306 | struct xpc_interface { |
312 | void (*connect) (int); | 307 | void (*connect) (int); |
313 | void (*disconnect) (int); | 308 | void (*disconnect) (int); |
314 | enum xp_retval (*allocate) (short, int, u32, void **); | 309 | enum xp_retval (*send) (short, int, u32, void *, u16); |
315 | enum xp_retval (*send) (short, int, void *); | 310 | enum xp_retval (*send_notify) (short, int, u32, void *, u16, |
316 | enum xp_retval (*send_notify) (short, int, void *, | ||
317 | xpc_notify_func, void *); | 311 | xpc_notify_func, void *); |
318 | void (*received) (short, int, void *); | 312 | void (*received) (short, int, void *); |
319 | enum xp_retval (*partid_to_nasids) (short, void *); | 313 | enum xp_retval (*partid_to_nasids) (short, void *); |
@@ -323,10 +317,9 @@ extern struct xpc_interface xpc_interface; | |||
323 | 317 | ||
324 | extern void xpc_set_interface(void (*)(int), | 318 | extern void xpc_set_interface(void (*)(int), |
325 | void (*)(int), | 319 | void (*)(int), |
326 | enum xp_retval (*)(short, int, u32, void **), | 320 | enum xp_retval (*)(short, int, u32, void *, u16), |
327 | enum xp_retval (*)(short, int, void *), | 321 | enum xp_retval (*)(short, int, u32, void *, u16, |
328 | enum xp_retval (*)(short, int, void *, | 322 | xpc_notify_func, void *), |
329 | xpc_notify_func, void *), | ||
330 | void (*)(short, int, void *), | 323 | void (*)(short, int, void *), |
331 | enum xp_retval (*)(short, void *)); | 324 | enum xp_retval (*)(short, void *)); |
332 | extern void xpc_clear_interface(void); | 325 | extern void xpc_clear_interface(void); |
@@ -336,22 +329,19 @@ extern enum xp_retval xpc_connect(int, xpc_channel_func, void *, u16, | |||
336 | extern void xpc_disconnect(int); | 329 | extern void xpc_disconnect(int); |
337 | 330 | ||
338 | static inline enum xp_retval | 331 | static inline enum xp_retval |
339 | xpc_allocate(short partid, int ch_number, u32 flags, void **payload) | 332 | xpc_send(short partid, int ch_number, u32 flags, void *payload, |
340 | { | 333 | u16 payload_size) |
341 | return xpc_interface.allocate(partid, ch_number, flags, payload); | ||
342 | } | ||
343 | |||
344 | static inline enum xp_retval | ||
345 | xpc_send(short partid, int ch_number, void *payload) | ||
346 | { | 334 | { |
347 | return xpc_interface.send(partid, ch_number, payload); | 335 | return xpc_interface.send(partid, ch_number, flags, payload, |
336 | payload_size); | ||
348 | } | 337 | } |
349 | 338 | ||
350 | static inline enum xp_retval | 339 | static inline enum xp_retval |
351 | xpc_send_notify(short partid, int ch_number, void *payload, | 340 | xpc_send_notify(short partid, int ch_number, u32 flags, void *payload, |
352 | xpc_notify_func func, void *key) | 341 | u16 payload_size, xpc_notify_func func, void *key) |
353 | { | 342 | { |
354 | return xpc_interface.send_notify(partid, ch_number, payload, func, key); | 343 | return xpc_interface.send_notify(partid, ch_number, flags, payload, |
344 | payload_size, func, key); | ||
355 | } | 345 | } |
356 | 346 | ||
357 | static inline void | 347 | static inline void |