[c594489] | 1 | /*
|
---|
[df4ed85] | 2 | * Copyright (c) 2006 Ondrej Palkovsky
|
---|
[c594489] | 3 | * All rights reserved.
|
---|
| 4 | *
|
---|
| 5 | * Redistribution and use in source and binary forms, with or without
|
---|
| 6 | * modification, are permitted provided that the following conditions
|
---|
| 7 | * are met:
|
---|
| 8 | *
|
---|
| 9 | * - Redistributions of source code must retain the above copyright
|
---|
| 10 | * notice, this list of conditions and the following disclaimer.
|
---|
| 11 | * - Redistributions in binary form must reproduce the above copyright
|
---|
| 12 | * notice, this list of conditions and the following disclaimer in the
|
---|
| 13 | * documentation and/or other materials provided with the distribution.
|
---|
| 14 | * - The name of the author may not be used to endorse or promote products
|
---|
| 15 | * derived from this software without specific prior written permission.
|
---|
| 16 | *
|
---|
| 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
---|
| 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
---|
| 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
---|
| 20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
---|
| 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
---|
| 22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
---|
| 23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
---|
| 24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
---|
| 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
---|
| 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
---|
| 27 | */
|
---|
| 28 |
|
---|
[fadd381] | 29 | /** @addtogroup libc
|
---|
[b2951e2] | 30 | * @{
|
---|
| 31 | */
|
---|
| 32 | /** @file
|
---|
| 33 | */
|
---|
| 34 |
|
---|
[64d2b10] | 35 | #if ((defined(LIBC_IPC_H_)) && (!defined(LIBC_ASYNC_C_)))
|
---|
| 36 | #error Do not intermix low-level IPC interface and async framework
|
---|
| 37 | #endif
|
---|
| 38 |
|
---|
[fadd381] | 39 | #ifndef LIBC_ASYNC_H_
|
---|
| 40 | #define LIBC_ASYNC_H_
|
---|
[630c3a9] | 41 |
|
---|
[64d2b10] | 42 | #include <ipc/common.h>
|
---|
[bc1f1c2] | 43 | #include <fibril.h>
|
---|
[79ae36dd] | 44 | #include <fibril_synch.h>
|
---|
[f25b73d6] | 45 | #include <sys/time.h>
|
---|
[fc42b28] | 46 | #include <atomic.h>
|
---|
[0cc4313] | 47 | #include <bool.h>
|
---|
[64d2b10] | 48 | #include <task.h>
|
---|
[630c3a9] | 49 |
|
---|
[01ff41c] | 50 | typedef ipc_callid_t aid_t;
|
---|
[46eec3b] | 51 |
|
---|
| 52 | typedef void *(*async_client_data_ctor_t)(void);
|
---|
| 53 | typedef void (*async_client_data_dtor_t)(void *);
|
---|
| 54 |
|
---|
[11bb813] | 55 | typedef void (*async_client_conn_t)(ipc_callid_t, ipc_call_t *);
|
---|
[9db9b10] | 56 |
|
---|
[79ae36dd] | 57 | /** Exchange management style
|
---|
| 58 | *
|
---|
| 59 | */
|
---|
| 60 | typedef enum {
|
---|
| 61 | /** No explicit exchange management
|
---|
| 62 | *
|
---|
| 63 | * Suitable for protocols which use a single
|
---|
| 64 | * IPC message per exchange only.
|
---|
| 65 | *
|
---|
| 66 | */
|
---|
| 67 | EXCHANGE_ATOMIC = 0,
|
---|
| 68 |
|
---|
| 69 | /** Exchange management via phone cloning
|
---|
| 70 | *
|
---|
| 71 | * Suitable for servers which support client
|
---|
| 72 | * data tracking by task hashes and do not
|
---|
| 73 | * mind cloned phones.
|
---|
| 74 | *
|
---|
| 75 | */
|
---|
| 76 | EXCHANGE_PARALLEL,
|
---|
| 77 |
|
---|
| 78 | /** Exchange management via mutual exclusion
|
---|
| 79 | *
|
---|
| 80 | * Suitable for any kind of client/server communication,
|
---|
| 81 | * but can limit parallelism.
|
---|
| 82 | *
|
---|
| 83 | */
|
---|
| 84 | EXCHANGE_SERIALIZE
|
---|
| 85 | } exch_mgmt_t;
|
---|
| 86 |
|
---|
| 87 | /** Session data */
|
---|
| 88 | typedef struct {
|
---|
| 89 | /** List of inactive exchanges */
|
---|
| 90 | link_t exch_list;
|
---|
| 91 |
|
---|
| 92 | /** Exchange management style */
|
---|
| 93 | exch_mgmt_t mgmt;
|
---|
| 94 |
|
---|
| 95 | /** Session identification */
|
---|
| 96 | int phone;
|
---|
| 97 |
|
---|
| 98 | /** First clone connection argument */
|
---|
| 99 | sysarg_t arg1;
|
---|
| 100 |
|
---|
| 101 | /** Second clone connection argument */
|
---|
| 102 | sysarg_t arg2;
|
---|
| 103 |
|
---|
| 104 | /** Third clone connection argument */
|
---|
| 105 | sysarg_t arg3;
|
---|
| 106 |
|
---|
| 107 | /** Exchange mutex */
|
---|
| 108 | fibril_mutex_t mutex;
|
---|
| 109 |
|
---|
| 110 | /** Number of opened exchanges */
|
---|
| 111 | atomic_t refcnt;
|
---|
| 112 | } async_sess_t;
|
---|
| 113 |
|
---|
| 114 | /** Exchange data */
|
---|
| 115 | typedef struct {
|
---|
| 116 | /** Link into list of inactive exchanges */
|
---|
| 117 | link_t sess_link;
|
---|
| 118 |
|
---|
| 119 | /** Link into global list of inactive exchanges */
|
---|
| 120 | link_t global_link;
|
---|
| 121 |
|
---|
| 122 | /** Session pointer */
|
---|
| 123 | async_sess_t *sess;
|
---|
| 124 |
|
---|
| 125 | /** Exchange identification */
|
---|
| 126 | int phone;
|
---|
| 127 | } async_exch_t;
|
---|
| 128 |
|
---|
[8619f25] | 129 | extern atomic_t threads_in_ipc_wait;
|
---|
| 130 |
|
---|
[47b7006] | 131 | #define async_manager() \
|
---|
| 132 | fibril_switch(FIBRIL_TO_MANAGER)
|
---|
[9db9b10] | 133 |
|
---|
[47b7006] | 134 | #define async_get_call(data) \
|
---|
| 135 | async_get_call_timeout(data, 0)
|
---|
[440cff5] | 136 |
|
---|
[47b7006] | 137 | extern ipc_callid_t async_get_call_timeout(ipc_call_t *, suseconds_t);
|
---|
[db24058] | 138 |
|
---|
[0cc4313] | 139 | /*
|
---|
| 140 | * User-friendly wrappers for async_send_fast() and async_send_slow(). The
|
---|
| 141 | * macros are in the form async_send_m(), where m denotes the number of payload
|
---|
[79ae36dd] | 142 | * arguments. Each macros chooses between the fast and the slow version based
|
---|
[0cc4313] | 143 | * on m.
|
---|
[440cff5] | 144 | */
|
---|
| 145 |
|
---|
[79ae36dd] | 146 | #define async_send_0(exch, method, dataptr) \
|
---|
| 147 | async_send_fast(exch, method, 0, 0, 0, 0, dataptr)
|
---|
| 148 | #define async_send_1(exch, method, arg1, dataptr) \
|
---|
| 149 | async_send_fast(exch, method, arg1, 0, 0, 0, dataptr)
|
---|
| 150 | #define async_send_2(exch, method, arg1, arg2, dataptr) \
|
---|
| 151 | async_send_fast(exch, method, arg1, arg2, 0, 0, dataptr)
|
---|
| 152 | #define async_send_3(exch, method, arg1, arg2, arg3, dataptr) \
|
---|
| 153 | async_send_fast(exch, method, arg1, arg2, arg3, 0, dataptr)
|
---|
| 154 | #define async_send_4(exch, method, arg1, arg2, arg3, arg4, dataptr) \
|
---|
| 155 | async_send_fast(exch, method, arg1, arg2, arg3, arg4, dataptr)
|
---|
| 156 | #define async_send_5(exch, method, arg1, arg2, arg3, arg4, arg5, dataptr) \
|
---|
| 157 | async_send_slow(exch, method, arg1, arg2, arg3, arg4, arg5, dataptr)
|
---|
| 158 |
|
---|
| 159 | extern aid_t async_send_fast(async_exch_t *, sysarg_t, sysarg_t, sysarg_t,
|
---|
[11bb813] | 160 | sysarg_t, sysarg_t, ipc_call_t *);
|
---|
[79ae36dd] | 161 | extern aid_t async_send_slow(async_exch_t *, sysarg_t, sysarg_t, sysarg_t,
|
---|
| 162 | sysarg_t, sysarg_t, sysarg_t, ipc_call_t *);
|
---|
| 163 |
|
---|
[11bb813] | 164 | extern void async_wait_for(aid_t, sysarg_t *);
|
---|
| 165 | extern int async_wait_timeout(aid_t, sysarg_t *, suseconds_t);
|
---|
[440cff5] | 166 |
|
---|
[3c22f70] | 167 | extern fid_t async_new_connection(sysarg_t, sysarg_t, ipc_callid_t,
|
---|
[79ae36dd] | 168 | ipc_call_t *, async_client_conn_t);
|
---|
| 169 |
|
---|
[11bb813] | 170 | extern void async_usleep(suseconds_t);
|
---|
[9db9b10] | 171 | extern void async_create_manager(void);
|
---|
| 172 | extern void async_destroy_manager(void);
|
---|
[01ff41c] | 173 |
|
---|
[46eec3b] | 174 | extern void async_set_client_data_constructor(async_client_data_ctor_t);
|
---|
| 175 | extern void async_set_client_data_destructor(async_client_data_dtor_t);
|
---|
[79ae36dd] | 176 | extern void *async_get_client_data(void);
|
---|
[23882034] | 177 |
|
---|
[11bb813] | 178 | extern void async_set_client_connection(async_client_conn_t);
|
---|
| 179 | extern void async_set_interrupt_received(async_client_conn_t);
|
---|
[0cc4313] | 180 |
|
---|
[64d2b10] | 181 | /*
|
---|
| 182 | * Wrappers for simple communication.
|
---|
| 183 | */
|
---|
| 184 |
|
---|
[79ae36dd] | 185 | extern void async_msg_0(async_exch_t *, sysarg_t);
|
---|
| 186 | extern void async_msg_1(async_exch_t *, sysarg_t, sysarg_t);
|
---|
| 187 | extern void async_msg_2(async_exch_t *, sysarg_t, sysarg_t, sysarg_t);
|
---|
| 188 | extern void async_msg_3(async_exch_t *, sysarg_t, sysarg_t, sysarg_t, sysarg_t);
|
---|
| 189 | extern void async_msg_4(async_exch_t *, sysarg_t, sysarg_t, sysarg_t, sysarg_t,
|
---|
[64d2b10] | 190 | sysarg_t);
|
---|
[79ae36dd] | 191 | extern void async_msg_5(async_exch_t *, sysarg_t, sysarg_t, sysarg_t, sysarg_t,
|
---|
| 192 | sysarg_t, sysarg_t);
|
---|
[64d2b10] | 193 |
|
---|
| 194 | /*
|
---|
| 195 | * Wrappers for answer routines.
|
---|
| 196 | */
|
---|
| 197 |
|
---|
| 198 | extern sysarg_t async_answer_0(ipc_callid_t, sysarg_t);
|
---|
| 199 | extern sysarg_t async_answer_1(ipc_callid_t, sysarg_t, sysarg_t);
|
---|
| 200 | extern sysarg_t async_answer_2(ipc_callid_t, sysarg_t, sysarg_t, sysarg_t);
|
---|
| 201 | extern sysarg_t async_answer_3(ipc_callid_t, sysarg_t, sysarg_t, sysarg_t,
|
---|
| 202 | sysarg_t);
|
---|
| 203 | extern sysarg_t async_answer_4(ipc_callid_t, sysarg_t, sysarg_t, sysarg_t,
|
---|
| 204 | sysarg_t, sysarg_t);
|
---|
| 205 | extern sysarg_t async_answer_5(ipc_callid_t, sysarg_t, sysarg_t, sysarg_t,
|
---|
| 206 | sysarg_t, sysarg_t, sysarg_t);
|
---|
| 207 |
|
---|
| 208 | /*
|
---|
| 209 | * Wrappers for forwarding routines.
|
---|
| 210 | */
|
---|
| 211 |
|
---|
[79ae36dd] | 212 | extern int async_forward_fast(ipc_callid_t, async_exch_t *, sysarg_t, sysarg_t,
|
---|
| 213 | sysarg_t, unsigned int);
|
---|
| 214 | extern int async_forward_slow(ipc_callid_t, async_exch_t *, sysarg_t, sysarg_t,
|
---|
| 215 | sysarg_t, sysarg_t, sysarg_t, sysarg_t, unsigned int);
|
---|
[0cc4313] | 216 |
|
---|
| 217 | /*
|
---|
| 218 | * User-friendly wrappers for async_req_fast() and async_req_slow(). The macros
|
---|
| 219 | * are in the form async_req_m_n(), where m is the number of payload arguments
|
---|
[6b21292] | 220 | * and n is the number of return arguments. The macros decide between the fast
|
---|
[0cc4313] | 221 | * and slow verion based on m.
|
---|
| 222 | */
|
---|
[64d2b10] | 223 |
|
---|
[79ae36dd] | 224 | #define async_req_0_0(exch, method) \
|
---|
| 225 | async_req_fast(exch, method, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL)
|
---|
| 226 | #define async_req_0_1(exch, method, r1) \
|
---|
| 227 | async_req_fast(exch, method, 0, 0, 0, 0, r1, NULL, NULL, NULL, NULL)
|
---|
| 228 | #define async_req_0_2(exch, method, r1, r2) \
|
---|
| 229 | async_req_fast(exch, method, 0, 0, 0, 0, r1, r2, NULL, NULL, NULL)
|
---|
| 230 | #define async_req_0_3(exch, method, r1, r2, r3) \
|
---|
| 231 | async_req_fast(exch, method, 0, 0, 0, 0, r1, r2, r3, NULL, NULL)
|
---|
| 232 | #define async_req_0_4(exch, method, r1, r2, r3, r4) \
|
---|
| 233 | async_req_fast(exch, method, 0, 0, 0, 0, r1, r2, r3, r4, NULL)
|
---|
| 234 | #define async_req_0_5(exch, method, r1, r2, r3, r4, r5) \
|
---|
| 235 | async_req_fast(exch, method, 0, 0, 0, 0, r1, r2, r3, r4, r5)
|
---|
| 236 |
|
---|
| 237 | #define async_req_1_0(exch, method, arg1) \
|
---|
| 238 | async_req_fast(exch, method, arg1, 0, 0, 0, NULL, NULL, NULL, NULL, \
|
---|
| 239 | NULL)
|
---|
| 240 | #define async_req_1_1(exch, method, arg1, rc1) \
|
---|
| 241 | async_req_fast(exch, method, arg1, 0, 0, 0, rc1, NULL, NULL, NULL, \
|
---|
| 242 | NULL)
|
---|
| 243 | #define async_req_1_2(exch, method, arg1, rc1, rc2) \
|
---|
| 244 | async_req_fast(exch, method, arg1, 0, 0, 0, rc1, rc2, NULL, NULL, \
|
---|
| 245 | NULL)
|
---|
| 246 | #define async_req_1_3(exch, method, arg1, rc1, rc2, rc3) \
|
---|
| 247 | async_req_fast(exch, method, arg1, 0, 0, 0, rc1, rc2, rc3, NULL, \
|
---|
[9db9b10] | 248 | NULL)
|
---|
[79ae36dd] | 249 | #define async_req_1_4(exch, method, arg1, rc1, rc2, rc3, rc4) \
|
---|
| 250 | async_req_fast(exch, method, arg1, 0, 0, 0, rc1, rc2, rc3, rc4, \
|
---|
[9db9b10] | 251 | NULL)
|
---|
[79ae36dd] | 252 | #define async_req_1_5(exch, method, arg1, rc1, rc2, rc3, rc4, rc5) \
|
---|
| 253 | async_req_fast(exch, method, arg1, 0, 0, 0, rc1, rc2, rc3, rc4, \
|
---|
| 254 | rc5)
|
---|
| 255 |
|
---|
| 256 | #define async_req_2_0(exch, method, arg1, arg2) \
|
---|
| 257 | async_req_fast(exch, method, arg1, arg2, 0, 0, NULL, NULL, NULL, \
|
---|
| 258 | NULL, NULL)
|
---|
| 259 | #define async_req_2_1(exch, method, arg1, arg2, rc1) \
|
---|
| 260 | async_req_fast(exch, method, arg1, arg2, 0, 0, rc1, NULL, NULL, \
|
---|
| 261 | NULL, NULL)
|
---|
| 262 | #define async_req_2_2(exch, method, arg1, arg2, rc1, rc2) \
|
---|
| 263 | async_req_fast(exch, method, arg1, arg2, 0, 0, rc1, rc2, NULL, NULL, \
|
---|
[9db9b10] | 264 | NULL)
|
---|
[79ae36dd] | 265 | #define async_req_2_3(exch, method, arg1, arg2, rc1, rc2, rc3) \
|
---|
| 266 | async_req_fast(exch, method, arg1, arg2, 0, 0, rc1, rc2, rc3, NULL, \
|
---|
[9db9b10] | 267 | NULL)
|
---|
[79ae36dd] | 268 | #define async_req_2_4(exch, method, arg1, arg2, rc1, rc2, rc3, rc4) \
|
---|
| 269 | async_req_fast(exch, method, arg1, arg2, 0, 0, rc1, rc2, rc3, rc4, \
|
---|
[9db9b10] | 270 | NULL)
|
---|
[79ae36dd] | 271 | #define async_req_2_5(exch, method, arg1, arg2, rc1, rc2, rc3, rc4, rc5) \
|
---|
| 272 | async_req_fast(exch, method, arg1, arg2, 0, 0, rc1, rc2, rc3, rc4, \
|
---|
| 273 | rc5)
|
---|
| 274 |
|
---|
| 275 | #define async_req_3_0(exch, method, arg1, arg2, arg3) \
|
---|
| 276 | async_req_fast(exch, method, arg1, arg2, arg3, 0, NULL, NULL, NULL, \
|
---|
[9db9b10] | 277 | NULL, NULL)
|
---|
[79ae36dd] | 278 | #define async_req_3_1(exch, method, arg1, arg2, arg3, rc1) \
|
---|
| 279 | async_req_fast(exch, method, arg1, arg2, arg3, 0, rc1, NULL, NULL, \
|
---|
[9db9b10] | 280 | NULL, NULL)
|
---|
[79ae36dd] | 281 | #define async_req_3_2(exch, method, arg1, arg2, arg3, rc1, rc2) \
|
---|
| 282 | async_req_fast(exch, method, arg1, arg2, arg3, 0, rc1, rc2, NULL, \
|
---|
[9db9b10] | 283 | NULL, NULL)
|
---|
[79ae36dd] | 284 | #define async_req_3_3(exch, method, arg1, arg2, arg3, rc1, rc2, rc3) \
|
---|
| 285 | async_req_fast(exch, method, arg1, arg2, arg3, 0, rc1, rc2, rc3, \
|
---|
[9db9b10] | 286 | NULL, NULL)
|
---|
[79ae36dd] | 287 | #define async_req_3_4(exch, method, arg1, arg2, arg3, rc1, rc2, rc3, rc4) \
|
---|
| 288 | async_req_fast(exch, method, arg1, arg2, arg3, 0, rc1, rc2, rc3, \
|
---|
| 289 | rc4, NULL)
|
---|
| 290 | #define async_req_3_5(exch, method, arg1, arg2, arg3, rc1, rc2, rc3, rc4, \
|
---|
| 291 | rc5) \
|
---|
| 292 | async_req_fast(exch, method, arg1, arg2, arg3, 0, rc1, rc2, rc3, \
|
---|
| 293 | rc4, rc5)
|
---|
| 294 |
|
---|
| 295 | #define async_req_4_0(exch, method, arg1, arg2, arg3, arg4) \
|
---|
| 296 | async_req_fast(exch, method, arg1, arg2, arg3, arg4, NULL, NULL, \
|
---|
[9db9b10] | 297 | NULL, NULL, NULL)
|
---|
[79ae36dd] | 298 | #define async_req_4_1(exch, method, arg1, arg2, arg3, arg4, rc1) \
|
---|
| 299 | async_req_fast(exch, method, arg1, arg2, arg3, arg4, rc1, NULL, \
|
---|
[9db9b10] | 300 | NULL, NULL, NULL)
|
---|
[79ae36dd] | 301 | #define async_req_4_2(exch, method, arg1, arg2, arg3, arg4, rc1, rc2) \
|
---|
| 302 | async_req_fast(exch, method, arg1, arg2, arg3, arg4, rc1, rc2, NULL, \
|
---|
| 303 | NULL, NULL)
|
---|
| 304 | #define async_req_4_3(exch, method, arg1, arg2, arg3, arg4, rc1, rc2, rc3) \
|
---|
| 305 | async_req_fast(exch, method, arg1, arg2, arg3, arg4, rc1, rc2, rc3, \
|
---|
| 306 | NULL, NULL)
|
---|
| 307 | #define async_req_4_4(exch, method, arg1, arg2, arg3, arg4, rc1, rc2, rc3, \
|
---|
[0cc4313] | 308 | rc4) \
|
---|
[79ae36dd] | 309 | async_req_fast(exch, method, arg1, arg2, arg3, arg4, rc1, rc2, rc3, \
|
---|
| 310 | rc4, NULL)
|
---|
| 311 | #define async_req_4_5(exch, method, arg1, arg2, arg3, arg4, rc1, rc2, rc3, \
|
---|
[0cc4313] | 312 | rc4, rc5) \
|
---|
[79ae36dd] | 313 | async_req_fast(exch, method, arg1, arg2, arg3, arg4, rc1, rc2, rc3, \
|
---|
| 314 | rc4, rc5)
|
---|
| 315 |
|
---|
| 316 | #define async_req_5_0(exch, method, arg1, arg2, arg3, arg4, arg5) \
|
---|
| 317 | async_req_slow(exch, method, arg1, arg2, arg3, arg4, arg5, NULL, \
|
---|
| 318 | NULL, NULL, NULL, NULL)
|
---|
| 319 | #define async_req_5_1(exch, method, arg1, arg2, arg3, arg4, arg5, rc1) \
|
---|
| 320 | async_req_slow(exch, method, arg1, arg2, arg3, arg4, arg5, rc1, \
|
---|
| 321 | NULL, NULL, NULL, NULL)
|
---|
| 322 | #define async_req_5_2(exch, method, arg1, arg2, arg3, arg4, arg5, rc1, rc2) \
|
---|
| 323 | async_req_slow(exch, method, arg1, arg2, arg3, arg4, arg5, rc1, rc2, \
|
---|
| 324 | NULL, NULL, NULL)
|
---|
| 325 | #define async_req_5_3(exch, method, arg1, arg2, arg3, arg4, arg5, rc1, rc2, \
|
---|
[0cc4313] | 326 | rc3) \
|
---|
[79ae36dd] | 327 | async_req_slow(exch, method, arg1, arg2, arg3, arg4, arg5, rc1, rc2, \
|
---|
| 328 | rc3, NULL, NULL)
|
---|
| 329 | #define async_req_5_4(exch, method, arg1, arg2, arg3, arg4, arg5, rc1, rc2, \
|
---|
[0cc4313] | 330 | rc3, rc4) \
|
---|
[79ae36dd] | 331 | async_req_slow(exch, method, arg1, arg2, arg3, arg4, arg5, rc1, rc2, \
|
---|
| 332 | rc3, rc4, NULL)
|
---|
| 333 | #define async_req_5_5(exch, method, arg1, arg2, arg3, arg4, arg5, rc1, rc2, \
|
---|
[0cc4313] | 334 | rc3, rc4, rc5) \
|
---|
[79ae36dd] | 335 | async_req_slow(exch, method, arg1, arg2, arg3, arg4, arg5, rc1, rc2, \
|
---|
| 336 | rc3, rc4, rc5)
|
---|
[fc42b28] | 337 |
|
---|
[79ae36dd] | 338 | extern sysarg_t async_req_fast(async_exch_t *, sysarg_t, sysarg_t, sysarg_t,
|
---|
[11bb813] | 339 | sysarg_t, sysarg_t, sysarg_t *, sysarg_t *, sysarg_t *, sysarg_t *,
|
---|
| 340 | sysarg_t *);
|
---|
[79ae36dd] | 341 | extern sysarg_t async_req_slow(async_exch_t *, sysarg_t, sysarg_t, sysarg_t,
|
---|
| 342 | sysarg_t, sysarg_t, sysarg_t, sysarg_t *, sysarg_t *, sysarg_t *,
|
---|
| 343 | sysarg_t *, sysarg_t *);
|
---|
[085bd54] | 344 |
|
---|
[79ae36dd] | 345 | extern async_sess_t *async_connect_me(exch_mgmt_t, async_exch_t *);
|
---|
| 346 | extern async_sess_t *async_connect_me_to(exch_mgmt_t, async_exch_t *, sysarg_t,
|
---|
| 347 | sysarg_t, sysarg_t);
|
---|
| 348 | extern async_sess_t *async_connect_me_to_blocking(exch_mgmt_t, async_exch_t *,
|
---|
| 349 | sysarg_t, sysarg_t, sysarg_t);
|
---|
| 350 | extern async_sess_t *async_connect_kbox(task_id_t);
|
---|
[fc42b28] | 351 |
|
---|
[79ae36dd] | 352 | extern int async_connect_to_me(async_exch_t *, sysarg_t, sysarg_t, sysarg_t,
|
---|
[007e6efa] | 353 | async_client_conn_t);
|
---|
[79ae36dd] | 354 |
|
---|
| 355 | extern int async_hangup(async_sess_t *);
|
---|
[64d2b10] | 356 | extern void async_poke(void);
|
---|
[f74392f] | 357 |
|
---|
[79ae36dd] | 358 | extern async_exch_t *async_exchange_begin(async_sess_t *);
|
---|
| 359 | extern void async_exchange_end(async_exch_t *);
|
---|
| 360 |
|
---|
[0da4e41] | 361 | /*
|
---|
| 362 | * User-friendly wrappers for async_share_in_start().
|
---|
| 363 | */
|
---|
[64d2b10] | 364 |
|
---|
[79ae36dd] | 365 | #define async_share_in_start_0_0(exch, dst, size) \
|
---|
| 366 | async_share_in_start(exch, dst, size, 0, NULL)
|
---|
| 367 | #define async_share_in_start_0_1(exch, dst, size, flags) \
|
---|
| 368 | async_share_in_start(exch, dst, size, 0, flags)
|
---|
| 369 | #define async_share_in_start_1_0(exch, dst, size, arg) \
|
---|
| 370 | async_share_in_start(exch, dst, size, arg, NULL)
|
---|
| 371 | #define async_share_in_start_1_1(exch, dst, size, arg, flags) \
|
---|
| 372 | async_share_in_start(exch, dst, size, arg, flags)
|
---|
| 373 |
|
---|
| 374 | extern int async_share_in_start(async_exch_t *, void *, size_t, sysarg_t,
|
---|
| 375 | unsigned int *);
|
---|
[47b7006] | 376 | extern bool async_share_in_receive(ipc_callid_t *, size_t *);
|
---|
| 377 | extern int async_share_in_finalize(ipc_callid_t, void *, unsigned int);
|
---|
| 378 |
|
---|
[79ae36dd] | 379 | extern int async_share_out_start(async_exch_t *, void *, unsigned int);
|
---|
[47b7006] | 380 | extern bool async_share_out_receive(ipc_callid_t *, size_t *, unsigned int *);
|
---|
[0da4e41] | 381 | extern int async_share_out_finalize(ipc_callid_t, void *);
|
---|
[b4cbef1] | 382 |
|
---|
| 383 | /*
|
---|
| 384 | * User-friendly wrappers for async_data_read_forward_fast().
|
---|
| 385 | */
|
---|
[64d2b10] | 386 |
|
---|
[79ae36dd] | 387 | #define async_data_read_forward_0_0(exch, method, answer) \
|
---|
| 388 | async_data_read_forward_fast(exch, method, 0, 0, 0, 0, NULL)
|
---|
| 389 | #define async_data_read_forward_0_1(exch, method, answer) \
|
---|
| 390 | async_data_read_forward_fast(exch, method, 0, 0, 0, 0, answer)
|
---|
| 391 | #define async_data_read_forward_1_0(exch, method, arg1, answer) \
|
---|
| 392 | async_data_read_forward_fast(exch, method, arg1, 0, 0, 0, NULL)
|
---|
| 393 | #define async_data_read_forward_1_1(exch, method, arg1, answer) \
|
---|
| 394 | async_data_read_forward_fast(exch, method, arg1, 0, 0, 0, answer)
|
---|
| 395 | #define async_data_read_forward_2_0(exch, method, arg1, arg2, answer) \
|
---|
| 396 | async_data_read_forward_fast(exch, method, arg1, arg2, 0, 0, NULL)
|
---|
| 397 | #define async_data_read_forward_2_1(exch, method, arg1, arg2, answer) \
|
---|
| 398 | async_data_read_forward_fast(exch, method, arg1, arg2, 0, 0, answer)
|
---|
| 399 | #define async_data_read_forward_3_0(exch, method, arg1, arg2, arg3, answer) \
|
---|
| 400 | async_data_read_forward_fast(exch, method, arg1, arg2, arg3, 0, NULL)
|
---|
| 401 | #define async_data_read_forward_3_1(exch, method, arg1, arg2, arg3, answer) \
|
---|
| 402 | async_data_read_forward_fast(exch, method, arg1, arg2, arg3, 0, \
|
---|
| 403 | answer)
|
---|
| 404 | #define async_data_read_forward_4_0(exch, method, arg1, arg2, arg3, arg4, \
|
---|
| 405 | answer) \
|
---|
| 406 | async_data_read_forward_fast(exch, method, arg1, arg2, arg3, arg4, \
|
---|
[b4cbef1] | 407 | NULL)
|
---|
[79ae36dd] | 408 | #define async_data_read_forward_4_1(exch, method, arg1, arg2, arg3, arg4, \
|
---|
| 409 | answer) \
|
---|
| 410 | async_data_read_forward_fast(exch, method, arg1, arg2, arg3, arg4, \
|
---|
| 411 | answer)
|
---|
| 412 |
|
---|
| 413 | extern aid_t async_data_read(async_exch_t *, void *, size_t, ipc_call_t *);
|
---|
| 414 | extern int async_data_read_start(async_exch_t *, void *, size_t);
|
---|
[47b7006] | 415 | extern bool async_data_read_receive(ipc_callid_t *, size_t *);
|
---|
[0da4e41] | 416 | extern int async_data_read_finalize(ipc_callid_t, const void *, size_t);
|
---|
[eda925a] | 417 |
|
---|
[79ae36dd] | 418 | extern int async_data_read_forward_fast(async_exch_t *, sysarg_t, sysarg_t,
|
---|
| 419 | sysarg_t, sysarg_t, sysarg_t, ipc_call_t *);
|
---|
[b4cbef1] | 420 |
|
---|
| 421 | /*
|
---|
[eda925a] | 422 | * User-friendly wrappers for async_data_write_forward_fast().
|
---|
[b4cbef1] | 423 | */
|
---|
[64d2b10] | 424 |
|
---|
[79ae36dd] | 425 | #define async_data_write_forward_0_0(exch, method, answer) \
|
---|
| 426 | async_data_write_forward_fast(exch, method, 0, 0, 0, 0, NULL)
|
---|
| 427 | #define async_data_write_forward_0_1(exch, method, answer) \
|
---|
| 428 | async_data_write_forward_fast(exch, method, 0, 0, 0, 0, answer)
|
---|
| 429 | #define async_data_write_forward_1_0(exch, method, arg1, answer) \
|
---|
| 430 | async_data_write_forward_fast(exch, method, arg1, 0, 0, 0, NULL)
|
---|
| 431 | #define async_data_write_forward_1_1(exch, method, arg1, answer) \
|
---|
| 432 | async_data_write_forward_fast(exch, method, arg1, 0, 0, 0, answer)
|
---|
| 433 | #define async_data_write_forward_2_0(exch, method, arg1, arg2, answer) \
|
---|
| 434 | async_data_write_forward_fast(exch, method, arg1, arg2, 0, 0, NULL)
|
---|
| 435 | #define async_data_write_forward_2_1(exch, method, arg1, arg2, answer) \
|
---|
| 436 | async_data_write_forward_fast(exch, method, arg1, arg2, 0, 0, answer)
|
---|
| 437 | #define async_data_write_forward_3_0(exch, method, arg1, arg2, arg3, answer) \
|
---|
| 438 | async_data_write_forward_fast(exch, method, arg1, arg2, arg3, 0, \
|
---|
| 439 | NULL)
|
---|
| 440 | #define async_data_write_forward_3_1(exch, method, arg1, arg2, arg3, answer) \
|
---|
| 441 | async_data_write_forward_fast(exch, method, arg1, arg2, arg3, 0, \
|
---|
| 442 | answer)
|
---|
| 443 | #define async_data_write_forward_4_0(exch, method, arg1, arg2, arg3, arg4, \
|
---|
| 444 | answer) \
|
---|
| 445 | async_data_write_forward_fast(exch, method, arg1, arg2, arg3, arg4, \
|
---|
[b4cbef1] | 446 | NULL)
|
---|
[79ae36dd] | 447 | #define async_data_write_forward_4_1(exch, method, arg1, arg2, arg3, arg4, \
|
---|
| 448 | answer) \
|
---|
| 449 | async_data_write_forward_fast(exch, method, arg1, arg2, arg3, arg4, \
|
---|
| 450 | answer)
|
---|
| 451 |
|
---|
| 452 | extern int async_data_write_start(async_exch_t *, const void *, size_t);
|
---|
[47b7006] | 453 | extern bool async_data_write_receive(ipc_callid_t *, size_t *);
|
---|
[0da4e41] | 454 | extern int async_data_write_finalize(ipc_callid_t, void *, size_t);
|
---|
[eda925a] | 455 |
|
---|
| 456 | extern int async_data_write_accept(void **, const bool, const size_t,
|
---|
| 457 | const size_t, const size_t, size_t *);
|
---|
[47b7006] | 458 | extern void async_data_write_void(sysarg_t);
|
---|
[eda925a] | 459 |
|
---|
[79ae36dd] | 460 | extern int async_data_write_forward_fast(async_exch_t *, sysarg_t, sysarg_t,
|
---|
| 461 | sysarg_t, sysarg_t, sysarg_t, ipc_call_t *);
|
---|
| 462 |
|
---|
| 463 | extern int async_exchange_clone(async_exch_t *, async_exch_t *);
|
---|
| 464 | extern async_sess_t *async_clone_receive(exch_mgmt_t);
|
---|
| 465 | extern async_sess_t *async_callback_receive(exch_mgmt_t);
|
---|
[8869f7b] | 466 | extern async_sess_t *async_callback_receive_start(exch_mgmt_t, ipc_call_t *);
|
---|
[8aa42e3] | 467 |
|
---|
[630c3a9] | 468 | #endif
|
---|
[b2951e2] | 469 |
|
---|
[fadd381] | 470 | /** @}
|
---|
[b2951e2] | 471 | */
|
---|