aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/sgi-xp/xp.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/misc/sgi-xp/xp.h')
-rw-r--r--drivers/misc/sgi-xp/xp.h45
1 files changed, 15 insertions, 30 deletions
diff --git a/drivers/misc/sgi-xp/xp.h b/drivers/misc/sgi-xp/xp.h
index 9ac5758f4d08..859a5281c61b 100644
--- a/drivers/misc/sgi-xp/xp.h
+++ b/drivers/misc/sgi-xp/xp.h
@@ -87,39 +87,18 @@
87#endif 87#endif
88 88
89/* 89/*
90 * The format of an XPC message is as follows: 90 * Define macro, XPC_MSG_SIZE(), is provided for the user
91 *
92 * +-------+--------------------------------+
93 * | flags |////////////////////////////////|
94 * +-------+--------------------------------+
95 * | message # |
96 * +----------------------------------------+
97 * | payload (user-defined message) |
98 * | |
99 * :
100 * | |
101 * +----------------------------------------+
102 *
103 * The size of the payload is defined by the user via xpc_connect(). A user-
104 * defined message resides in the payload area.
105 *
106 * The size of a message entry (within a message queue) must be a cacheline
107 * sized multiple in order to facilitate the BTE transfer of messages from one
108 * message queue to another. A macro, XPC_MSG_SIZE(), is provided for the user
109 * that wants to fit as many msg entries as possible in a given memory size 91 * that wants to fit as many msg entries as possible in a given memory size
110 * (e.g. a memory page). 92 * (e.g. a memory page).
111 */ 93 */
112struct xpc_msg { 94#define XPC_MSG_MAX_SIZE 128
113 u8 flags; /* FOR XPC INTERNAL USE ONLY */ 95#define XPC_MSG_HDR_MAX_SIZE 16
114 u8 reserved[7]; /* FOR XPC INTERNAL USE ONLY */ 96#define XPC_MSG_PAYLOAD_MAX_SIZE (XPC_MSG_MAX_SIZE - XPC_MSG_HDR_MAX_SIZE)
115 s64 number; /* FOR XPC INTERNAL USE ONLY */
116
117 u64 payload; /* user defined portion of message */
118};
119 97
120#define XPC_MSG_PAYLOAD_OFFSET (u64) (&((struct xpc_msg *)0)->payload)
121#define XPC_MSG_SIZE(_payload_size) \ 98#define XPC_MSG_SIZE(_payload_size) \
122 L1_CACHE_ALIGN(XPC_MSG_PAYLOAD_OFFSET + (_payload_size)) 99 ALIGN(XPC_MSG_HDR_MAX_SIZE + (_payload_size), \
100 is_uv() ? 64 : 128)
101
123 102
124/* 103/*
125 * Define the return values and values passed to user's callout functions. 104 * Define the return values and values passed to user's callout functions.
@@ -210,7 +189,10 @@ enum xp_retval {
210 xpGruCopyError, /* 58: gru_copy_gru() returned error */ 189 xpGruCopyError, /* 58: gru_copy_gru() returned error */
211 xpGruSendMqError, /* 59: gru send message queue related error */ 190 xpGruSendMqError, /* 59: gru send message queue related error */
212 191
213 xpUnknownReason /* 60: unknown reason - must be last in enum */ 192 xpBadChannelNumber, /* 60: invalid channel number */
193 xpBadMsgType, /* 60: invalid message type */
194
195 xpUnknownReason /* 61: unknown reason - must be last in enum */
214}; 196};
215 197
216/* 198/*
@@ -261,6 +243,9 @@ typedef void (*xpc_channel_func) (enum xp_retval reason, short partid,
261 * calling xpc_received(). 243 * calling xpc_received().
262 * 244 *
263 * All other reason codes indicate failure. 245 * All other reason codes indicate failure.
246 *
247 * NOTE: The user defined function must be callable by an interrupt handler
248 * and thus cannot block.
264 */ 249 */
265typedef void (*xpc_notify_func) (enum xp_retval reason, short partid, 250typedef void (*xpc_notify_func) (enum xp_retval reason, short partid,
266 int ch_number, void *key); 251 int ch_number, void *key);
@@ -284,7 +269,7 @@ struct xpc_registration {
284 xpc_channel_func func; /* function to call */ 269 xpc_channel_func func; /* function to call */
285 void *key; /* pointer to user's key */ 270 void *key; /* pointer to user's key */
286 u16 nentries; /* #of msg entries in local msg queue */ 271 u16 nentries; /* #of msg entries in local msg queue */
287 u16 msg_size; /* message queue's message size */ 272 u16 entry_size; /* message queue's message entry size */
288 u32 assigned_limit; /* limit on #of assigned kthreads */ 273 u32 assigned_limit; /* limit on #of assigned kthreads */
289 u32 idle_limit; /* limit on #of idle kthreads */ 274 u32 idle_limit; /* limit on #of idle kthreads */
290} ____cacheline_aligned; 275} ____cacheline_aligned;