[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>
|
---|
[f25b73d6] | 44 | #include <sys/time.h>
|
---|
[fc42b28] | 45 | #include <atomic.h>
|
---|
[0cc4313] | 46 | #include <bool.h>
|
---|
[64d2b10] | 47 | #include <task.h>
|
---|
[630c3a9] | 48 |
|
---|
[01ff41c] | 49 | typedef ipc_callid_t aid_t;
|
---|
[46eec3b] | 50 |
|
---|
| 51 | typedef void *(*async_client_data_ctor_t)(void);
|
---|
| 52 | typedef void (*async_client_data_dtor_t)(void *);
|
---|
| 53 |
|
---|
[9934f7d] | 54 | /** Client connection handler
|
---|
| 55 | *
|
---|
[3815efb] | 56 | * @param callid ID of incoming call or 0 if connection initiated from
|
---|
| 57 | * inside using async_connect_to_me()
|
---|
| 58 | * @param call Incoming call or 0 if connection initiated from inside
|
---|
| 59 | * @param arg Local argument passed from async_new_connection() or
|
---|
| 60 | * async_connect_to_me()
|
---|
[9934f7d] | 61 | */
|
---|
| 62 | typedef void (*async_client_conn_t)(ipc_callid_t, ipc_call_t *, void *);
|
---|
| 63 |
|
---|
| 64 | /** Interrupt handler */
|
---|
| 65 | typedef void (*async_interrupt_handler_t)(ipc_callid_t, ipc_call_t *);
|
---|
[9db9b10] | 66 |
|
---|
[79ae36dd] | 67 | /** Exchange management style
|
---|
| 68 | *
|
---|
| 69 | */
|
---|
| 70 | typedef enum {
|
---|
| 71 | /** No explicit exchange management
|
---|
| 72 | *
|
---|
| 73 | * Suitable for protocols which use a single
|
---|
| 74 | * IPC message per exchange only.
|
---|
| 75 | *
|
---|
| 76 | */
|
---|
| 77 | EXCHANGE_ATOMIC = 0,
|
---|
| 78 |
|
---|
| 79 | /** Exchange management via phone cloning
|
---|
| 80 | *
|
---|
| 81 | * Suitable for servers which support client
|
---|
| 82 | * data tracking by task hashes and do not
|
---|
| 83 | * mind cloned phones.
|
---|
| 84 | *
|
---|
| 85 | */
|
---|
| 86 | EXCHANGE_PARALLEL,
|
---|
| 87 |
|
---|
| 88 | /** Exchange management via mutual exclusion
|
---|
| 89 | *
|
---|
| 90 | * Suitable for any kind of client/server communication,
|
---|
| 91 | * but can limit parallelism.
|
---|
| 92 | *
|
---|
| 93 | */
|
---|
| 94 | EXCHANGE_SERIALIZE
|
---|
| 95 | } exch_mgmt_t;
|
---|
| 96 |
|
---|
[b76a7329] | 97 | /** Forward declarations */
|
---|
| 98 | struct _async_exch;
|
---|
| 99 | struct _async_sess;
|
---|
| 100 |
|
---|
| 101 | typedef struct _async_sess async_sess_t;
|
---|
| 102 | typedef struct _async_exch async_exch_t;
|
---|
[79ae36dd] | 103 |
|
---|
[8619f25] | 104 | extern atomic_t threads_in_ipc_wait;
|
---|
| 105 |
|
---|
[47b7006] | 106 | #define async_manager() \
|
---|
| 107 | fibril_switch(FIBRIL_TO_MANAGER)
|
---|
[9db9b10] | 108 |
|
---|
[47b7006] | 109 | #define async_get_call(data) \
|
---|
| 110 | async_get_call_timeout(data, 0)
|
---|
[440cff5] | 111 |
|
---|
[47b7006] | 112 | extern ipc_callid_t async_get_call_timeout(ipc_call_t *, suseconds_t);
|
---|
[db24058] | 113 |
|
---|
[0cc4313] | 114 | /*
|
---|
| 115 | * User-friendly wrappers for async_send_fast() and async_send_slow(). The
|
---|
| 116 | * macros are in the form async_send_m(), where m denotes the number of payload
|
---|
[79ae36dd] | 117 | * arguments. Each macros chooses between the fast and the slow version based
|
---|
[0cc4313] | 118 | * on m.
|
---|
[440cff5] | 119 | */
|
---|
| 120 |
|
---|
[79ae36dd] | 121 | #define async_send_0(exch, method, dataptr) \
|
---|
| 122 | async_send_fast(exch, method, 0, 0, 0, 0, dataptr)
|
---|
| 123 | #define async_send_1(exch, method, arg1, dataptr) \
|
---|
| 124 | async_send_fast(exch, method, arg1, 0, 0, 0, dataptr)
|
---|
| 125 | #define async_send_2(exch, method, arg1, arg2, dataptr) \
|
---|
| 126 | async_send_fast(exch, method, arg1, arg2, 0, 0, dataptr)
|
---|
| 127 | #define async_send_3(exch, method, arg1, arg2, arg3, dataptr) \
|
---|
| 128 | async_send_fast(exch, method, arg1, arg2, arg3, 0, dataptr)
|
---|
| 129 | #define async_send_4(exch, method, arg1, arg2, arg3, arg4, dataptr) \
|
---|
| 130 | async_send_fast(exch, method, arg1, arg2, arg3, arg4, dataptr)
|
---|
| 131 | #define async_send_5(exch, method, arg1, arg2, arg3, arg4, arg5, dataptr) \
|
---|
| 132 | async_send_slow(exch, method, arg1, arg2, arg3, arg4, arg5, dataptr)
|
---|
| 133 |
|
---|
| 134 | extern aid_t async_send_fast(async_exch_t *, sysarg_t, sysarg_t, sysarg_t,
|
---|
[11bb813] | 135 | sysarg_t, sysarg_t, ipc_call_t *);
|
---|
[79ae36dd] | 136 | extern aid_t async_send_slow(async_exch_t *, sysarg_t, sysarg_t, sysarg_t,
|
---|
| 137 | sysarg_t, sysarg_t, sysarg_t, ipc_call_t *);
|
---|
| 138 |
|
---|
[11bb813] | 139 | extern void async_wait_for(aid_t, sysarg_t *);
|
---|
| 140 | extern int async_wait_timeout(aid_t, sysarg_t *, suseconds_t);
|
---|
[440cff5] | 141 |
|
---|
[e2ab36f1] | 142 | extern fid_t async_new_connection(task_id_t, sysarg_t, ipc_callid_t,
|
---|
[9934f7d] | 143 | ipc_call_t *, async_client_conn_t, void *);
|
---|
[79ae36dd] | 144 |
|
---|
[11bb813] | 145 | extern void async_usleep(suseconds_t);
|
---|
[9db9b10] | 146 | extern void async_create_manager(void);
|
---|
| 147 | extern void async_destroy_manager(void);
|
---|
[01ff41c] | 148 |
|
---|
[46eec3b] | 149 | extern void async_set_client_data_constructor(async_client_data_ctor_t);
|
---|
| 150 | extern void async_set_client_data_destructor(async_client_data_dtor_t);
|
---|
[79ae36dd] | 151 | extern void *async_get_client_data(void);
|
---|
[e2ab36f1] | 152 | extern void *async_get_client_data_by_id(task_id_t);
|
---|
| 153 | extern void async_put_client_data_by_id(task_id_t);
|
---|
[23882034] | 154 |
|
---|
[11bb813] | 155 | extern void async_set_client_connection(async_client_conn_t);
|
---|
[9934f7d] | 156 | extern void async_set_interrupt_received(async_interrupt_handler_t);
|
---|
[0cc4313] | 157 |
|
---|
[64d2b10] | 158 | /*
|
---|
| 159 | * Wrappers for simple communication.
|
---|
| 160 | */
|
---|
| 161 |
|
---|
[79ae36dd] | 162 | extern void async_msg_0(async_exch_t *, sysarg_t);
|
---|
| 163 | extern void async_msg_1(async_exch_t *, sysarg_t, sysarg_t);
|
---|
| 164 | extern void async_msg_2(async_exch_t *, sysarg_t, sysarg_t, sysarg_t);
|
---|
| 165 | extern void async_msg_3(async_exch_t *, sysarg_t, sysarg_t, sysarg_t, sysarg_t);
|
---|
| 166 | extern void async_msg_4(async_exch_t *, sysarg_t, sysarg_t, sysarg_t, sysarg_t,
|
---|
[64d2b10] | 167 | sysarg_t);
|
---|
[79ae36dd] | 168 | extern void async_msg_5(async_exch_t *, sysarg_t, sysarg_t, sysarg_t, sysarg_t,
|
---|
| 169 | sysarg_t, sysarg_t);
|
---|
[64d2b10] | 170 |
|
---|
| 171 | /*
|
---|
| 172 | * Wrappers for answer routines.
|
---|
| 173 | */
|
---|
| 174 |
|
---|
| 175 | extern sysarg_t async_answer_0(ipc_callid_t, sysarg_t);
|
---|
| 176 | extern sysarg_t async_answer_1(ipc_callid_t, sysarg_t, sysarg_t);
|
---|
| 177 | extern sysarg_t async_answer_2(ipc_callid_t, sysarg_t, sysarg_t, sysarg_t);
|
---|
| 178 | extern sysarg_t async_answer_3(ipc_callid_t, sysarg_t, sysarg_t, sysarg_t,
|
---|
| 179 | sysarg_t);
|
---|
| 180 | extern sysarg_t async_answer_4(ipc_callid_t, sysarg_t, sysarg_t, sysarg_t,
|
---|
| 181 | sysarg_t, sysarg_t);
|
---|
| 182 | extern sysarg_t async_answer_5(ipc_callid_t, sysarg_t, sysarg_t, sysarg_t,
|
---|
| 183 | sysarg_t, sysarg_t, sysarg_t);
|
---|
| 184 |
|
---|
| 185 | /*
|
---|
| 186 | * Wrappers for forwarding routines.
|
---|
| 187 | */
|
---|
| 188 |
|
---|
[79ae36dd] | 189 | extern int async_forward_fast(ipc_callid_t, async_exch_t *, sysarg_t, sysarg_t,
|
---|
| 190 | sysarg_t, unsigned int);
|
---|
| 191 | extern int async_forward_slow(ipc_callid_t, async_exch_t *, sysarg_t, sysarg_t,
|
---|
| 192 | sysarg_t, sysarg_t, sysarg_t, sysarg_t, unsigned int);
|
---|
[0cc4313] | 193 |
|
---|
| 194 | /*
|
---|
| 195 | * User-friendly wrappers for async_req_fast() and async_req_slow(). The macros
|
---|
| 196 | * are in the form async_req_m_n(), where m is the number of payload arguments
|
---|
[6b21292] | 197 | * and n is the number of return arguments. The macros decide between the fast
|
---|
[0cc4313] | 198 | * and slow verion based on m.
|
---|
| 199 | */
|
---|
[64d2b10] | 200 |
|
---|
[79ae36dd] | 201 | #define async_req_0_0(exch, method) \
|
---|
| 202 | async_req_fast(exch, method, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL)
|
---|
| 203 | #define async_req_0_1(exch, method, r1) \
|
---|
| 204 | async_req_fast(exch, method, 0, 0, 0, 0, r1, NULL, NULL, NULL, NULL)
|
---|
| 205 | #define async_req_0_2(exch, method, r1, r2) \
|
---|
| 206 | async_req_fast(exch, method, 0, 0, 0, 0, r1, r2, NULL, NULL, NULL)
|
---|
| 207 | #define async_req_0_3(exch, method, r1, r2, r3) \
|
---|
| 208 | async_req_fast(exch, method, 0, 0, 0, 0, r1, r2, r3, NULL, NULL)
|
---|
| 209 | #define async_req_0_4(exch, method, r1, r2, r3, r4) \
|
---|
| 210 | async_req_fast(exch, method, 0, 0, 0, 0, r1, r2, r3, r4, NULL)
|
---|
| 211 | #define async_req_0_5(exch, method, r1, r2, r3, r4, r5) \
|
---|
| 212 | async_req_fast(exch, method, 0, 0, 0, 0, r1, r2, r3, r4, r5)
|
---|
| 213 |
|
---|
| 214 | #define async_req_1_0(exch, method, arg1) \
|
---|
| 215 | async_req_fast(exch, method, arg1, 0, 0, 0, NULL, NULL, NULL, NULL, \
|
---|
| 216 | NULL)
|
---|
| 217 | #define async_req_1_1(exch, method, arg1, rc1) \
|
---|
| 218 | async_req_fast(exch, method, arg1, 0, 0, 0, rc1, NULL, NULL, NULL, \
|
---|
| 219 | NULL)
|
---|
| 220 | #define async_req_1_2(exch, method, arg1, rc1, rc2) \
|
---|
| 221 | async_req_fast(exch, method, arg1, 0, 0, 0, rc1, rc2, NULL, NULL, \
|
---|
| 222 | NULL)
|
---|
| 223 | #define async_req_1_3(exch, method, arg1, rc1, rc2, rc3) \
|
---|
| 224 | async_req_fast(exch, method, arg1, 0, 0, 0, rc1, rc2, rc3, NULL, \
|
---|
[9db9b10] | 225 | NULL)
|
---|
[79ae36dd] | 226 | #define async_req_1_4(exch, method, arg1, rc1, rc2, rc3, rc4) \
|
---|
| 227 | async_req_fast(exch, method, arg1, 0, 0, 0, rc1, rc2, rc3, rc4, \
|
---|
[9db9b10] | 228 | NULL)
|
---|
[79ae36dd] | 229 | #define async_req_1_5(exch, method, arg1, rc1, rc2, rc3, rc4, rc5) \
|
---|
| 230 | async_req_fast(exch, method, arg1, 0, 0, 0, rc1, rc2, rc3, rc4, \
|
---|
| 231 | rc5)
|
---|
| 232 |
|
---|
| 233 | #define async_req_2_0(exch, method, arg1, arg2) \
|
---|
| 234 | async_req_fast(exch, method, arg1, arg2, 0, 0, NULL, NULL, NULL, \
|
---|
| 235 | NULL, NULL)
|
---|
| 236 | #define async_req_2_1(exch, method, arg1, arg2, rc1) \
|
---|
| 237 | async_req_fast(exch, method, arg1, arg2, 0, 0, rc1, NULL, NULL, \
|
---|
| 238 | NULL, NULL)
|
---|
| 239 | #define async_req_2_2(exch, method, arg1, arg2, rc1, rc2) \
|
---|
| 240 | async_req_fast(exch, method, arg1, arg2, 0, 0, rc1, rc2, NULL, NULL, \
|
---|
[9db9b10] | 241 | NULL)
|
---|
[79ae36dd] | 242 | #define async_req_2_3(exch, method, arg1, arg2, rc1, rc2, rc3) \
|
---|
| 243 | async_req_fast(exch, method, arg1, arg2, 0, 0, rc1, rc2, rc3, NULL, \
|
---|
[9db9b10] | 244 | NULL)
|
---|
[79ae36dd] | 245 | #define async_req_2_4(exch, method, arg1, arg2, rc1, rc2, rc3, rc4) \
|
---|
| 246 | async_req_fast(exch, method, arg1, arg2, 0, 0, rc1, rc2, rc3, rc4, \
|
---|
[9db9b10] | 247 | NULL)
|
---|
[79ae36dd] | 248 | #define async_req_2_5(exch, method, arg1, arg2, rc1, rc2, rc3, rc4, rc5) \
|
---|
| 249 | async_req_fast(exch, method, arg1, arg2, 0, 0, rc1, rc2, rc3, rc4, \
|
---|
| 250 | rc5)
|
---|
| 251 |
|
---|
| 252 | #define async_req_3_0(exch, method, arg1, arg2, arg3) \
|
---|
| 253 | async_req_fast(exch, method, arg1, arg2, arg3, 0, NULL, NULL, NULL, \
|
---|
[9db9b10] | 254 | NULL, NULL)
|
---|
[79ae36dd] | 255 | #define async_req_3_1(exch, method, arg1, arg2, arg3, rc1) \
|
---|
| 256 | async_req_fast(exch, method, arg1, arg2, arg3, 0, rc1, NULL, NULL, \
|
---|
[9db9b10] | 257 | NULL, NULL)
|
---|
[79ae36dd] | 258 | #define async_req_3_2(exch, method, arg1, arg2, arg3, rc1, rc2) \
|
---|
| 259 | async_req_fast(exch, method, arg1, arg2, arg3, 0, rc1, rc2, NULL, \
|
---|
[9db9b10] | 260 | NULL, NULL)
|
---|
[79ae36dd] | 261 | #define async_req_3_3(exch, method, arg1, arg2, arg3, rc1, rc2, rc3) \
|
---|
| 262 | async_req_fast(exch, method, arg1, arg2, arg3, 0, rc1, rc2, rc3, \
|
---|
[9db9b10] | 263 | NULL, NULL)
|
---|
[79ae36dd] | 264 | #define async_req_3_4(exch, method, arg1, arg2, arg3, rc1, rc2, rc3, rc4) \
|
---|
| 265 | async_req_fast(exch, method, arg1, arg2, arg3, 0, rc1, rc2, rc3, \
|
---|
| 266 | rc4, NULL)
|
---|
| 267 | #define async_req_3_5(exch, method, arg1, arg2, arg3, rc1, rc2, rc3, rc4, \
|
---|
| 268 | rc5) \
|
---|
| 269 | async_req_fast(exch, method, arg1, arg2, arg3, 0, rc1, rc2, rc3, \
|
---|
| 270 | rc4, rc5)
|
---|
| 271 |
|
---|
| 272 | #define async_req_4_0(exch, method, arg1, arg2, arg3, arg4) \
|
---|
| 273 | async_req_fast(exch, method, arg1, arg2, arg3, arg4, NULL, NULL, \
|
---|
[9db9b10] | 274 | NULL, NULL, NULL)
|
---|
[79ae36dd] | 275 | #define async_req_4_1(exch, method, arg1, arg2, arg3, arg4, rc1) \
|
---|
| 276 | async_req_fast(exch, method, arg1, arg2, arg3, arg4, rc1, NULL, \
|
---|
[9db9b10] | 277 | NULL, NULL, NULL)
|
---|
[79ae36dd] | 278 | #define async_req_4_2(exch, method, arg1, arg2, arg3, arg4, rc1, rc2) \
|
---|
| 279 | async_req_fast(exch, method, arg1, arg2, arg3, arg4, rc1, rc2, NULL, \
|
---|
| 280 | NULL, NULL)
|
---|
| 281 | #define async_req_4_3(exch, method, arg1, arg2, arg3, arg4, rc1, rc2, rc3) \
|
---|
| 282 | async_req_fast(exch, method, arg1, arg2, arg3, arg4, rc1, rc2, rc3, \
|
---|
| 283 | NULL, NULL)
|
---|
| 284 | #define async_req_4_4(exch, method, arg1, arg2, arg3, arg4, rc1, rc2, rc3, \
|
---|
[0cc4313] | 285 | rc4) \
|
---|
[79ae36dd] | 286 | async_req_fast(exch, method, arg1, arg2, arg3, arg4, rc1, rc2, rc3, \
|
---|
| 287 | rc4, NULL)
|
---|
| 288 | #define async_req_4_5(exch, method, arg1, arg2, arg3, arg4, rc1, rc2, rc3, \
|
---|
[0cc4313] | 289 | rc4, rc5) \
|
---|
[79ae36dd] | 290 | async_req_fast(exch, method, arg1, arg2, arg3, arg4, rc1, rc2, rc3, \
|
---|
| 291 | rc4, rc5)
|
---|
| 292 |
|
---|
| 293 | #define async_req_5_0(exch, method, arg1, arg2, arg3, arg4, arg5) \
|
---|
| 294 | async_req_slow(exch, method, arg1, arg2, arg3, arg4, arg5, NULL, \
|
---|
| 295 | NULL, NULL, NULL, NULL)
|
---|
| 296 | #define async_req_5_1(exch, method, arg1, arg2, arg3, arg4, arg5, rc1) \
|
---|
| 297 | async_req_slow(exch, method, arg1, arg2, arg3, arg4, arg5, rc1, \
|
---|
| 298 | NULL, NULL, NULL, NULL)
|
---|
| 299 | #define async_req_5_2(exch, method, arg1, arg2, arg3, arg4, arg5, rc1, rc2) \
|
---|
| 300 | async_req_slow(exch, method, arg1, arg2, arg3, arg4, arg5, rc1, rc2, \
|
---|
| 301 | NULL, NULL, NULL)
|
---|
| 302 | #define async_req_5_3(exch, method, arg1, arg2, arg3, arg4, arg5, rc1, rc2, \
|
---|
[0cc4313] | 303 | rc3) \
|
---|
[79ae36dd] | 304 | async_req_slow(exch, method, arg1, arg2, arg3, arg4, arg5, rc1, rc2, \
|
---|
| 305 | rc3, NULL, NULL)
|
---|
| 306 | #define async_req_5_4(exch, method, arg1, arg2, arg3, arg4, arg5, rc1, rc2, \
|
---|
[0cc4313] | 307 | rc3, rc4) \
|
---|
[79ae36dd] | 308 | async_req_slow(exch, method, arg1, arg2, arg3, arg4, arg5, rc1, rc2, \
|
---|
| 309 | rc3, rc4, NULL)
|
---|
| 310 | #define async_req_5_5(exch, method, arg1, arg2, arg3, arg4, arg5, rc1, rc2, \
|
---|
[0cc4313] | 311 | rc3, rc4, rc5) \
|
---|
[79ae36dd] | 312 | async_req_slow(exch, method, arg1, arg2, arg3, arg4, arg5, rc1, rc2, \
|
---|
| 313 | rc3, rc4, rc5)
|
---|
[fc42b28] | 314 |
|
---|
[79ae36dd] | 315 | extern sysarg_t async_req_fast(async_exch_t *, sysarg_t, sysarg_t, sysarg_t,
|
---|
[11bb813] | 316 | sysarg_t, sysarg_t, sysarg_t *, sysarg_t *, sysarg_t *, sysarg_t *,
|
---|
| 317 | sysarg_t *);
|
---|
[79ae36dd] | 318 | extern sysarg_t async_req_slow(async_exch_t *, sysarg_t, sysarg_t, sysarg_t,
|
---|
| 319 | sysarg_t, sysarg_t, sysarg_t, sysarg_t *, sysarg_t *, sysarg_t *,
|
---|
| 320 | sysarg_t *, sysarg_t *);
|
---|
[085bd54] | 321 |
|
---|
[79ae36dd] | 322 | extern async_sess_t *async_connect_me(exch_mgmt_t, async_exch_t *);
|
---|
| 323 | extern async_sess_t *async_connect_me_to(exch_mgmt_t, async_exch_t *, sysarg_t,
|
---|
| 324 | sysarg_t, sysarg_t);
|
---|
| 325 | extern async_sess_t *async_connect_me_to_blocking(exch_mgmt_t, async_exch_t *,
|
---|
| 326 | sysarg_t, sysarg_t, sysarg_t);
|
---|
| 327 | extern async_sess_t *async_connect_kbox(task_id_t);
|
---|
[fc42b28] | 328 |
|
---|
[79ae36dd] | 329 | extern int async_connect_to_me(async_exch_t *, sysarg_t, sysarg_t, sysarg_t,
|
---|
[9934f7d] | 330 | async_client_conn_t, void *);
|
---|
[79ae36dd] | 331 |
|
---|
| 332 | extern int async_hangup(async_sess_t *);
|
---|
[64d2b10] | 333 | extern void async_poke(void);
|
---|
[f74392f] | 334 |
|
---|
[79ae36dd] | 335 | extern async_exch_t *async_exchange_begin(async_sess_t *);
|
---|
| 336 | extern void async_exchange_end(async_exch_t *);
|
---|
| 337 |
|
---|
[0da4e41] | 338 | /*
|
---|
| 339 | * User-friendly wrappers for async_share_in_start().
|
---|
| 340 | */
|
---|
[64d2b10] | 341 |
|
---|
[79ae36dd] | 342 | #define async_share_in_start_0_0(exch, dst, size) \
|
---|
| 343 | async_share_in_start(exch, dst, size, 0, NULL)
|
---|
| 344 | #define async_share_in_start_0_1(exch, dst, size, flags) \
|
---|
| 345 | async_share_in_start(exch, dst, size, 0, flags)
|
---|
| 346 | #define async_share_in_start_1_0(exch, dst, size, arg) \
|
---|
| 347 | async_share_in_start(exch, dst, size, arg, NULL)
|
---|
| 348 | #define async_share_in_start_1_1(exch, dst, size, arg, flags) \
|
---|
| 349 | async_share_in_start(exch, dst, size, arg, flags)
|
---|
| 350 |
|
---|
| 351 | extern int async_share_in_start(async_exch_t *, void *, size_t, sysarg_t,
|
---|
| 352 | unsigned int *);
|
---|
[47b7006] | 353 | extern bool async_share_in_receive(ipc_callid_t *, size_t *);
|
---|
| 354 | extern int async_share_in_finalize(ipc_callid_t, void *, unsigned int);
|
---|
| 355 |
|
---|
[79ae36dd] | 356 | extern int async_share_out_start(async_exch_t *, void *, unsigned int);
|
---|
[47b7006] | 357 | extern bool async_share_out_receive(ipc_callid_t *, size_t *, unsigned int *);
|
---|
[0da4e41] | 358 | extern int async_share_out_finalize(ipc_callid_t, void *);
|
---|
[b4cbef1] | 359 |
|
---|
| 360 | /*
|
---|
| 361 | * User-friendly wrappers for async_data_read_forward_fast().
|
---|
| 362 | */
|
---|
[64d2b10] | 363 |
|
---|
[79ae36dd] | 364 | #define async_data_read_forward_0_0(exch, method, answer) \
|
---|
| 365 | async_data_read_forward_fast(exch, method, 0, 0, 0, 0, NULL)
|
---|
| 366 | #define async_data_read_forward_0_1(exch, method, answer) \
|
---|
| 367 | async_data_read_forward_fast(exch, method, 0, 0, 0, 0, answer)
|
---|
| 368 | #define async_data_read_forward_1_0(exch, method, arg1, answer) \
|
---|
| 369 | async_data_read_forward_fast(exch, method, arg1, 0, 0, 0, NULL)
|
---|
| 370 | #define async_data_read_forward_1_1(exch, method, arg1, answer) \
|
---|
| 371 | async_data_read_forward_fast(exch, method, arg1, 0, 0, 0, answer)
|
---|
| 372 | #define async_data_read_forward_2_0(exch, method, arg1, arg2, answer) \
|
---|
| 373 | async_data_read_forward_fast(exch, method, arg1, arg2, 0, 0, NULL)
|
---|
| 374 | #define async_data_read_forward_2_1(exch, method, arg1, arg2, answer) \
|
---|
| 375 | async_data_read_forward_fast(exch, method, arg1, arg2, 0, 0, answer)
|
---|
| 376 | #define async_data_read_forward_3_0(exch, method, arg1, arg2, arg3, answer) \
|
---|
| 377 | async_data_read_forward_fast(exch, method, arg1, arg2, arg3, 0, NULL)
|
---|
| 378 | #define async_data_read_forward_3_1(exch, method, arg1, arg2, arg3, answer) \
|
---|
| 379 | async_data_read_forward_fast(exch, method, arg1, arg2, arg3, 0, \
|
---|
| 380 | answer)
|
---|
| 381 | #define async_data_read_forward_4_0(exch, method, arg1, arg2, arg3, arg4, \
|
---|
| 382 | answer) \
|
---|
| 383 | async_data_read_forward_fast(exch, method, arg1, arg2, arg3, arg4, \
|
---|
[b4cbef1] | 384 | NULL)
|
---|
[79ae36dd] | 385 | #define async_data_read_forward_4_1(exch, method, arg1, arg2, arg3, arg4, \
|
---|
| 386 | answer) \
|
---|
| 387 | async_data_read_forward_fast(exch, method, arg1, arg2, arg3, arg4, \
|
---|
| 388 | answer)
|
---|
| 389 |
|
---|
| 390 | extern aid_t async_data_read(async_exch_t *, void *, size_t, ipc_call_t *);
|
---|
| 391 | extern int async_data_read_start(async_exch_t *, void *, size_t);
|
---|
[47b7006] | 392 | extern bool async_data_read_receive(ipc_callid_t *, size_t *);
|
---|
[0da4e41] | 393 | extern int async_data_read_finalize(ipc_callid_t, const void *, size_t);
|
---|
[eda925a] | 394 |
|
---|
[79ae36dd] | 395 | extern int async_data_read_forward_fast(async_exch_t *, sysarg_t, sysarg_t,
|
---|
| 396 | sysarg_t, sysarg_t, sysarg_t, ipc_call_t *);
|
---|
[b4cbef1] | 397 |
|
---|
| 398 | /*
|
---|
[eda925a] | 399 | * User-friendly wrappers for async_data_write_forward_fast().
|
---|
[b4cbef1] | 400 | */
|
---|
[64d2b10] | 401 |
|
---|
[79ae36dd] | 402 | #define async_data_write_forward_0_0(exch, method, answer) \
|
---|
| 403 | async_data_write_forward_fast(exch, method, 0, 0, 0, 0, NULL)
|
---|
| 404 | #define async_data_write_forward_0_1(exch, method, answer) \
|
---|
| 405 | async_data_write_forward_fast(exch, method, 0, 0, 0, 0, answer)
|
---|
| 406 | #define async_data_write_forward_1_0(exch, method, arg1, answer) \
|
---|
| 407 | async_data_write_forward_fast(exch, method, arg1, 0, 0, 0, NULL)
|
---|
| 408 | #define async_data_write_forward_1_1(exch, method, arg1, answer) \
|
---|
| 409 | async_data_write_forward_fast(exch, method, arg1, 0, 0, 0, answer)
|
---|
| 410 | #define async_data_write_forward_2_0(exch, method, arg1, arg2, answer) \
|
---|
| 411 | async_data_write_forward_fast(exch, method, arg1, arg2, 0, 0, NULL)
|
---|
| 412 | #define async_data_write_forward_2_1(exch, method, arg1, arg2, answer) \
|
---|
| 413 | async_data_write_forward_fast(exch, method, arg1, arg2, 0, 0, answer)
|
---|
| 414 | #define async_data_write_forward_3_0(exch, method, arg1, arg2, arg3, answer) \
|
---|
| 415 | async_data_write_forward_fast(exch, method, arg1, arg2, arg3, 0, \
|
---|
| 416 | NULL)
|
---|
| 417 | #define async_data_write_forward_3_1(exch, method, arg1, arg2, arg3, answer) \
|
---|
| 418 | async_data_write_forward_fast(exch, method, arg1, arg2, arg3, 0, \
|
---|
| 419 | answer)
|
---|
| 420 | #define async_data_write_forward_4_0(exch, method, arg1, arg2, arg3, arg4, \
|
---|
| 421 | answer) \
|
---|
| 422 | async_data_write_forward_fast(exch, method, arg1, arg2, arg3, arg4, \
|
---|
[b4cbef1] | 423 | NULL)
|
---|
[79ae36dd] | 424 | #define async_data_write_forward_4_1(exch, method, arg1, arg2, arg3, arg4, \
|
---|
| 425 | answer) \
|
---|
| 426 | async_data_write_forward_fast(exch, method, arg1, arg2, arg3, arg4, \
|
---|
| 427 | answer)
|
---|
| 428 |
|
---|
| 429 | extern int async_data_write_start(async_exch_t *, const void *, size_t);
|
---|
[47b7006] | 430 | extern bool async_data_write_receive(ipc_callid_t *, size_t *);
|
---|
[0da4e41] | 431 | extern int async_data_write_finalize(ipc_callid_t, void *, size_t);
|
---|
[eda925a] | 432 |
|
---|
| 433 | extern int async_data_write_accept(void **, const bool, const size_t,
|
---|
| 434 | const size_t, const size_t, size_t *);
|
---|
[47b7006] | 435 | extern void async_data_write_void(sysarg_t);
|
---|
[eda925a] | 436 |
|
---|
[79ae36dd] | 437 | extern int async_data_write_forward_fast(async_exch_t *, sysarg_t, sysarg_t,
|
---|
| 438 | sysarg_t, sysarg_t, sysarg_t, ipc_call_t *);
|
---|
| 439 |
|
---|
| 440 | extern int async_exchange_clone(async_exch_t *, async_exch_t *);
|
---|
| 441 | extern async_sess_t *async_clone_receive(exch_mgmt_t);
|
---|
| 442 | extern async_sess_t *async_callback_receive(exch_mgmt_t);
|
---|
[8869f7b] | 443 | extern async_sess_t *async_callback_receive_start(exch_mgmt_t, ipc_call_t *);
|
---|
[8aa42e3] | 444 |
|
---|
[2c4aa39] | 445 | extern int async_state_change_start(async_exch_t *, sysarg_t, sysarg_t,
|
---|
| 446 | sysarg_t, async_exch_t *);
|
---|
| 447 | extern bool async_state_change_receive(ipc_callid_t *, sysarg_t *, sysarg_t *,
|
---|
| 448 | sysarg_t *);
|
---|
| 449 | extern int async_state_change_finalize(ipc_callid_t, async_exch_t *);
|
---|
| 450 |
|
---|
[630c3a9] | 451 | #endif
|
---|
[b2951e2] | 452 |
|
---|
[fadd381] | 453 | /** @}
|
---|
[b2951e2] | 454 | */
|
---|