[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 |
|
---|
[fadd381] | 35 | #ifndef LIBC_ASYNC_H_
|
---|
| 36 | #define LIBC_ASYNC_H_
|
---|
[630c3a9] | 37 |
|
---|
| 38 | #include <ipc/ipc.h>
|
---|
[c1c0184] | 39 | #include <async_sess.h>
|
---|
[bc1f1c2] | 40 | #include <fibril.h>
|
---|
[f25b73d6] | 41 | #include <sys/time.h>
|
---|
[fc42b28] | 42 | #include <atomic.h>
|
---|
[0cc4313] | 43 | #include <bool.h>
|
---|
[630c3a9] | 44 |
|
---|
[01ff41c] | 45 | typedef ipc_callid_t aid_t;
|
---|
[46eec3b] | 46 |
|
---|
| 47 | typedef void *(*async_client_data_ctor_t)(void);
|
---|
| 48 | typedef void (*async_client_data_dtor_t)(void *);
|
---|
| 49 |
|
---|
[11bb813] | 50 | typedef void (*async_client_conn_t)(ipc_callid_t, ipc_call_t *);
|
---|
[9db9b10] | 51 |
|
---|
| 52 | extern atomic_t async_futex;
|
---|
[01ff41c] | 53 |
|
---|
[8619f25] | 54 | extern atomic_t threads_in_ipc_wait;
|
---|
| 55 |
|
---|
[db24058] | 56 | extern int __async_init(void);
|
---|
[11bb813] | 57 | extern ipc_callid_t async_get_call_timeout(ipc_call_t *, suseconds_t);
|
---|
[9db9b10] | 58 |
|
---|
[49d072e] | 59 | static inline ipc_callid_t async_get_call(ipc_call_t *data)
|
---|
| 60 | {
|
---|
| 61 | return async_get_call_timeout(data, 0);
|
---|
| 62 | }
|
---|
[440cff5] | 63 |
|
---|
[db24058] | 64 | static inline void async_manager(void)
|
---|
| 65 | {
|
---|
| 66 | fibril_switch(FIBRIL_TO_MANAGER);
|
---|
| 67 | }
|
---|
| 68 |
|
---|
[0cc4313] | 69 | /*
|
---|
| 70 | * User-friendly wrappers for async_send_fast() and async_send_slow(). The
|
---|
| 71 | * macros are in the form async_send_m(), where m denotes the number of payload
|
---|
| 72 | * arguments. Each macros chooses between the fast and the slow version based
|
---|
| 73 | * on m.
|
---|
[440cff5] | 74 | */
|
---|
| 75 |
|
---|
[0cc4313] | 76 | #define async_send_0(phoneid, method, dataptr) \
|
---|
[9db9b10] | 77 | async_send_fast((phoneid), (method), 0, 0, 0, 0, (dataptr))
|
---|
[0cc4313] | 78 | #define async_send_1(phoneid, method, arg1, dataptr) \
|
---|
[9db9b10] | 79 | async_send_fast((phoneid), (method), (arg1), 0, 0, 0, (dataptr))
|
---|
[0cc4313] | 80 | #define async_send_2(phoneid, method, arg1, arg2, dataptr) \
|
---|
[9db9b10] | 81 | async_send_fast((phoneid), (method), (arg1), (arg2), 0, 0, (dataptr))
|
---|
[0cc4313] | 82 | #define async_send_3(phoneid, method, arg1, arg2, arg3, dataptr) \
|
---|
[9db9b10] | 83 | async_send_fast((phoneid), (method), (arg1), (arg2), (arg3), 0, (dataptr))
|
---|
[0cc4313] | 84 | #define async_send_4(phoneid, method, arg1, arg2, arg3, arg4, dataptr) \
|
---|
[9db9b10] | 85 | async_send_fast((phoneid), (method), (arg1), (arg2), (arg3), (arg4), \
|
---|
| 86 | (dataptr))
|
---|
[0cc4313] | 87 | #define async_send_5(phoneid, method, arg1, arg2, arg3, arg4, arg5, dataptr) \
|
---|
[9db9b10] | 88 | async_send_slow((phoneid), (method), (arg1), (arg2), (arg3), (arg4), \
|
---|
| 89 | (arg5), (dataptr))
|
---|
[19b28b0] | 90 |
|
---|
[11bb813] | 91 | extern aid_t async_send_fast(int, sysarg_t, sysarg_t, sysarg_t, sysarg_t,
|
---|
| 92 | sysarg_t, ipc_call_t *);
|
---|
| 93 | extern aid_t async_send_slow(int, sysarg_t, sysarg_t, sysarg_t, sysarg_t,
|
---|
| 94 | sysarg_t, sysarg_t, ipc_call_t *);
|
---|
| 95 | extern void async_wait_for(aid_t, sysarg_t *);
|
---|
| 96 | extern int async_wait_timeout(aid_t, sysarg_t *, suseconds_t);
|
---|
[440cff5] | 97 |
|
---|
[3c22f70] | 98 | extern fid_t async_new_connection(sysarg_t, sysarg_t, ipc_callid_t,
|
---|
| 99 | ipc_call_t *, void (*)(ipc_callid_t, ipc_call_t *));
|
---|
[11bb813] | 100 | extern void async_usleep(suseconds_t);
|
---|
[9db9b10] | 101 | extern void async_create_manager(void);
|
---|
| 102 | extern void async_destroy_manager(void);
|
---|
[01ff41c] | 103 |
|
---|
[46eec3b] | 104 | extern void async_set_client_data_constructor(async_client_data_ctor_t);
|
---|
| 105 | extern void async_set_client_data_destructor(async_client_data_dtor_t);
|
---|
| 106 |
|
---|
[11bb813] | 107 | extern void async_set_client_connection(async_client_conn_t);
|
---|
| 108 | extern void async_set_interrupt_received(async_client_conn_t);
|
---|
[0cc4313] | 109 |
|
---|
| 110 | /* Wrappers for simple communication */
|
---|
| 111 | #define async_msg_0(phone, method) \
|
---|
[9db9b10] | 112 | ipc_call_async_0((phone), (method), NULL, NULL, true)
|
---|
[0cc4313] | 113 | #define async_msg_1(phone, method, arg1) \
|
---|
[9db9b10] | 114 | ipc_call_async_1((phone), (method), (arg1), NULL, NULL, \
|
---|
| 115 | true)
|
---|
[0cc4313] | 116 | #define async_msg_2(phone, method, arg1, arg2) \
|
---|
[9db9b10] | 117 | ipc_call_async_2((phone), (method), (arg1), (arg2), NULL, NULL, \
|
---|
| 118 | true)
|
---|
[0cc4313] | 119 | #define async_msg_3(phone, method, arg1, arg2, arg3) \
|
---|
[9db9b10] | 120 | ipc_call_async_3((phone), (method), (arg1), (arg2), (arg3), NULL, NULL, \
|
---|
| 121 | true)
|
---|
[0cc4313] | 122 | #define async_msg_4(phone, method, arg1, arg2, arg3, arg4) \
|
---|
[9db9b10] | 123 | ipc_call_async_4((phone), (method), (arg1), (arg2), (arg3), (arg4), NULL, \
|
---|
| 124 | NULL, true)
|
---|
[0cc4313] | 125 | #define async_msg_5(phone, method, arg1, arg2, arg3, arg4, arg5) \
|
---|
[9db9b10] | 126 | ipc_call_async_5((phone), (method), (arg1), (arg2), (arg3), (arg4), \
|
---|
| 127 | (arg5), NULL, NULL, true)
|
---|
[0cc4313] | 128 |
|
---|
| 129 | /*
|
---|
| 130 | * User-friendly wrappers for async_req_fast() and async_req_slow(). The macros
|
---|
| 131 | * are in the form async_req_m_n(), where m is the number of payload arguments
|
---|
[6b21292] | 132 | * and n is the number of return arguments. The macros decide between the fast
|
---|
[0cc4313] | 133 | * and slow verion based on m.
|
---|
| 134 | */
|
---|
| 135 | #define async_req_0_0(phoneid, method) \
|
---|
[9db9b10] | 136 | async_req_fast((phoneid), (method), 0, 0, 0, 0, NULL, NULL, NULL, NULL, \
|
---|
| 137 | NULL)
|
---|
[0cc4313] | 138 | #define async_req_0_1(phoneid, method, r1) \
|
---|
[9db9b10] | 139 | async_req_fast((phoneid), (method), 0, 0, 0, 0, (r1), NULL, NULL, NULL, \
|
---|
| 140 | NULL)
|
---|
[0cc4313] | 141 | #define async_req_0_2(phoneid, method, r1, r2) \
|
---|
[9db9b10] | 142 | async_req_fast((phoneid), (method), 0, 0, 0, 0, (r1), (r2), NULL, NULL, \
|
---|
| 143 | NULL)
|
---|
[0cc4313] | 144 | #define async_req_0_3(phoneid, method, r1, r2, r3) \
|
---|
[9db9b10] | 145 | async_req_fast((phoneid), (method), 0, 0, 0, 0, (r1), (r2), (r3), NULL, \
|
---|
| 146 | NULL)
|
---|
[0cc4313] | 147 | #define async_req_0_4(phoneid, method, r1, r2, r3, r4) \
|
---|
[9db9b10] | 148 | async_req_fast((phoneid), (method), 0, 0, 0, 0, (r1), (r2), (r3), (r4), \
|
---|
| 149 | NULL)
|
---|
[0cc4313] | 150 | #define async_req_0_5(phoneid, method, r1, r2, r3, r4, r5) \
|
---|
[9db9b10] | 151 | async_req_fast((phoneid), (method), 0, 0, 0, 0, (r1), (r2), (r3), (r4), \
|
---|
| 152 | (r5))
|
---|
[0cc4313] | 153 | #define async_req_1_0(phoneid, method, arg1) \
|
---|
[9db9b10] | 154 | async_req_fast((phoneid), (method), (arg1), 0, 0, 0, NULL, NULL, NULL, \
|
---|
| 155 | NULL, NULL)
|
---|
[0cc4313] | 156 | #define async_req_1_1(phoneid, method, arg1, rc1) \
|
---|
[9db9b10] | 157 | async_req_fast((phoneid), (method), (arg1), 0, 0, 0, (rc1), NULL, NULL, \
|
---|
| 158 | NULL, NULL)
|
---|
[0cc4313] | 159 | #define async_req_1_2(phoneid, method, arg1, rc1, rc2) \
|
---|
[9db9b10] | 160 | async_req_fast((phoneid), (method), (arg1), 0, 0, 0, (rc1), (rc2), NULL, \
|
---|
| 161 | NULL, NULL)
|
---|
[0cc4313] | 162 | #define async_req_1_3(phoneid, method, arg1, rc1, rc2, rc3) \
|
---|
[9db9b10] | 163 | async_req_fast((phoneid), (method), (arg1), 0, 0, 0, (rc1), (rc2), (rc3), \
|
---|
| 164 | NULL, NULL)
|
---|
[0cc4313] | 165 | #define async_req_1_4(phoneid, method, arg1, rc1, rc2, rc3, rc4) \
|
---|
[9db9b10] | 166 | async_req_fast((phoneid), (method), (arg1), 0, 0, 0, (rc1), (rc2), (rc3), \
|
---|
| 167 | (rc4), NULL)
|
---|
[0cc4313] | 168 | #define async_req_1_5(phoneid, method, arg1, rc1, rc2, rc3, rc4, rc5) \
|
---|
[9db9b10] | 169 | async_req_fast((phoneid), (method), (arg1), 0, 0, 0, (rc1), (rc2), (rc3), \
|
---|
| 170 | (rc4), (rc5))
|
---|
[0cc4313] | 171 | #define async_req_2_0(phoneid, method, arg1, arg2) \
|
---|
[9db9b10] | 172 | async_req_fast((phoneid), (method), (arg1), (arg2), 0, 0, NULL, NULL, \
|
---|
| 173 | NULL, NULL, NULL)
|
---|
[0cc4313] | 174 | #define async_req_2_1(phoneid, method, arg1, arg2, rc1) \
|
---|
[9db9b10] | 175 | async_req_fast((phoneid), (method), (arg1), (arg2), 0, 0, (rc1), NULL, \
|
---|
| 176 | NULL, NULL, NULL)
|
---|
[0cc4313] | 177 | #define async_req_2_2(phoneid, method, arg1, arg2, rc1, rc2) \
|
---|
[9db9b10] | 178 | async_req_fast((phoneid), (method), (arg1), (arg2), 0, 0, (rc1), (rc2), \
|
---|
| 179 | NULL, NULL, NULL)
|
---|
[0cc4313] | 180 | #define async_req_2_3(phoneid, method, arg1, arg2, rc1, rc2, rc3) \
|
---|
[9db9b10] | 181 | async_req_fast((phoneid), (method), (arg1), (arg2), 0, 0, (rc1), (rc2), \
|
---|
| 182 | (rc3), NULL, NULL)
|
---|
[0cc4313] | 183 | #define async_req_2_4(phoneid, method, arg1, arg2, rc1, rc2, rc3, rc4) \
|
---|
[9db9b10] | 184 | async_req_fast((phoneid), (method), (arg1), (arg2), 0, 0, (rc1), (rc2), \
|
---|
| 185 | (rc3), (rc4), NULL)
|
---|
[0cc4313] | 186 | #define async_req_2_5(phoneid, method, arg1, arg2, rc1, rc2, rc3, rc4, rc5) \
|
---|
[9db9b10] | 187 | async_req_fast((phoneid), (method), (arg1), (arg2), 0, 0, (rc1), (rc2), \
|
---|
| 188 | (rc3), (rc4), (rc5))
|
---|
[0cc4313] | 189 | #define async_req_3_0(phoneid, method, arg1, arg2, arg3) \
|
---|
[9db9b10] | 190 | async_req_fast((phoneid), (method), (arg1), (arg2), (arg3), 0, NULL, NULL, \
|
---|
| 191 | NULL, NULL, NULL)
|
---|
[0cc4313] | 192 | #define async_req_3_1(phoneid, method, arg1, arg2, arg3, rc1) \
|
---|
[9db9b10] | 193 | async_req_fast((phoneid), (method), (arg1), (arg2), (arg3), 0, (rc1), \
|
---|
| 194 | NULL, NULL, NULL, NULL)
|
---|
[0cc4313] | 195 | #define async_req_3_2(phoneid, method, arg1, arg2, arg3, rc1, rc2) \
|
---|
[9db9b10] | 196 | async_req_fast((phoneid), (method), (arg1), (arg2), (arg3), 0, (rc1), \
|
---|
| 197 | (rc2), NULL, NULL, NULL)
|
---|
[0cc4313] | 198 | #define async_req_3_3(phoneid, method, arg1, arg2, arg3, rc1, rc2, rc3) \
|
---|
[9db9b10] | 199 | async_req_fast((phoneid), (method), (arg1), (arg2), (arg3), 0, (rc1), \
|
---|
| 200 | (rc2), (rc3), NULL, NULL)
|
---|
[0cc4313] | 201 | #define async_req_3_4(phoneid, method, arg1, arg2, arg3, rc1, rc2, rc3, rc4) \
|
---|
[9db9b10] | 202 | async_req_fast((phoneid), (method), (arg1), (arg2), (arg3), 0, (rc1), \
|
---|
| 203 | (rc2), (rc3), (rc4), NULL)
|
---|
[0cc4313] | 204 | #define async_req_3_5(phoneid, method, arg1, arg2, arg3, rc1, rc2, rc3, rc4, \
|
---|
| 205 | rc5) \
|
---|
| 206 | async_req_fast((phoneid), (method), (arg1), (arg2), (arg3), 0, (rc1), \
|
---|
| 207 | (rc2), (rc3), (rc4), (rc5))
|
---|
| 208 | #define async_req_4_0(phoneid, method, arg1, arg2, arg3, arg4) \
|
---|
[9db9b10] | 209 | async_req_fast((phoneid), (method), (arg1), (arg2), (arg3), (arg4), NULL, \
|
---|
| 210 | NULL, NULL, NULL, NULL)
|
---|
[0cc4313] | 211 | #define async_req_4_1(phoneid, method, arg1, arg2, arg3, arg4, rc1) \
|
---|
[9db9b10] | 212 | async_req_fast((phoneid), (method), (arg1), (arg2), (arg3), (arg4), (rc1), \
|
---|
| 213 | NULL, NULL, NULL, NULL)
|
---|
[0cc4313] | 214 | #define async_req_4_2(phoneid, method, arg1, arg2, arg3, arg4, rc1, rc2) \
|
---|
[9db9b10] | 215 | async_req_fast((phoneid), (method), (arg1), (arg2), (arg3), (arg4), (rc1), \
|
---|
| 216 | (rc2), NULL, NULL, NULL)
|
---|
[0cc4313] | 217 | #define async_req_4_3(phoneid, method, arg1, arg2, arg3, arg4, rc1, rc2, rc3) \
|
---|
[9db9b10] | 218 | async_req_fast((phoneid), (method), (arg1), (arg2), (arg3), (arg4), (rc1), \
|
---|
| 219 | (rc2), (rc3), NULL, NULL)
|
---|
[0cc4313] | 220 | #define async_req_4_4(phoneid, method, arg1, arg2, arg3, arg4, rc1, rc2, rc3, \
|
---|
| 221 | rc4) \
|
---|
| 222 | async_req_fast((phoneid), (method), (arg1), (arg2), (arg3), (arg4), \
|
---|
| 223 | (rc1), (rc2), (rc3), (rc4), NULL)
|
---|
| 224 | #define async_req_4_5(phoneid, method, arg1, arg2, arg3, arg4, rc1, rc2, rc3, \
|
---|
| 225 | rc4, rc5) \
|
---|
| 226 | async_req_fast((phoneid), (method), (arg1), (arg2), (arg3), (arg4), \
|
---|
| 227 | (rc1), (rc2), (rc3), (rc4), (rc5))
|
---|
| 228 | #define async_req_5_0(phoneid, method, arg1, arg2, arg3, arg4, arg5) \
|
---|
[9db9b10] | 229 | async_req_slow((phoneid), (method), (arg1), (arg2), (arg3), (arg4), \
|
---|
| 230 | (arg5), NULL, NULL, NULL, NULL, NULL)
|
---|
[0cc4313] | 231 | #define async_req_5_1(phoneid, method, arg1, arg2, arg3, arg4, arg5, rc1) \
|
---|
[9db9b10] | 232 | async_req_slow((phoneid), (method), (arg1), (arg2), (arg3), (arg4), \
|
---|
| 233 | (arg5), (rc1), NULL, NULL, NULL, NULL)
|
---|
[0cc4313] | 234 | #define async_req_5_2(phoneid, method, arg1, arg2, arg3, arg4, arg5, rc1, rc2) \
|
---|
[9db9b10] | 235 | async_req_slow((phoneid), (method), (arg1), (arg2), (arg3), (arg4), \
|
---|
| 236 | (arg5), (rc1), (rc2), NULL, NULL, NULL)
|
---|
[0cc4313] | 237 | #define async_req_5_3(phoneid, method, arg1, arg2, arg3, arg4, arg5, rc1, rc2, \
|
---|
| 238 | rc3) \
|
---|
| 239 | async_req_slow((phoneid), (method), (arg1), (arg2), (arg3), (arg4), \
|
---|
| 240 | (arg5), (rc1), (rc2), (rc3), NULL, NULL)
|
---|
| 241 | #define async_req_5_4(phoneid, method, arg1, arg2, arg3, arg4, arg5, rc1, rc2, \
|
---|
| 242 | rc3, rc4) \
|
---|
| 243 | async_req_slow((phoneid), (method), (arg1), (arg2), (arg3), (arg4), \
|
---|
| 244 | (arg5), (rc1), (rc2), (rc3), (rc4), NULL)
|
---|
| 245 | #define async_req_5_5(phoneid, method, arg1, arg2, arg3, arg4, arg5, rc1, rc2, \
|
---|
| 246 | rc3, rc4, rc5) \
|
---|
| 247 | async_req_slow((phoneid), (method), (arg1), (arg2), (arg3), (arg4), \
|
---|
| 248 | (arg5), (rc1), (rc2), (rc3), (rc4), (rc5))
|
---|
[fc42b28] | 249 |
|
---|
[11bb813] | 250 | extern sysarg_t async_req_fast(int, sysarg_t, sysarg_t, sysarg_t, sysarg_t,
|
---|
| 251 | sysarg_t, sysarg_t *, sysarg_t *, sysarg_t *, sysarg_t *, sysarg_t *);
|
---|
| 252 | extern sysarg_t async_req_slow(int, sysarg_t, sysarg_t, sysarg_t, sysarg_t,
|
---|
| 253 | sysarg_t, sysarg_t, sysarg_t *, sysarg_t *, sysarg_t *, sysarg_t *,
|
---|
| 254 | sysarg_t *);
|
---|
[085bd54] | 255 |
|
---|
| 256 | static inline void async_serialize_start(void)
|
---|
| 257 | {
|
---|
[bc1f1c2] | 258 | fibril_inc_sercount();
|
---|
[085bd54] | 259 | }
|
---|
[3dbe2d1f] | 260 |
|
---|
[085bd54] | 261 | static inline void async_serialize_end(void)
|
---|
| 262 | {
|
---|
[bc1f1c2] | 263 | fibril_dec_sercount();
|
---|
[085bd54] | 264 | }
|
---|
[fc42b28] | 265 |
|
---|
[96b02eb9] | 266 | extern int async_connect_me_to(int, sysarg_t, sysarg_t, sysarg_t);
|
---|
| 267 | extern int async_connect_me_to_blocking(int, sysarg_t, sysarg_t, sysarg_t);
|
---|
[f74392f] | 268 |
|
---|
[0da4e41] | 269 | /*
|
---|
| 270 | * User-friendly wrappers for async_share_in_start().
|
---|
| 271 | */
|
---|
| 272 | #define async_share_in_start_0_0(phoneid, dst, size) \
|
---|
| 273 | async_share_in_start((phoneid), (dst), (size), 0, NULL)
|
---|
| 274 | #define async_share_in_start_0_1(phoneid, dst, size, flags) \
|
---|
| 275 | async_share_in_start((phoneid), (dst), (size), 0, (flags))
|
---|
| 276 | #define async_share_in_start_1_0(phoneid, dst, size, arg) \
|
---|
| 277 | async_share_in_start((phoneid), (dst), (size), (arg), NULL)
|
---|
| 278 | #define async_share_in_start_1_1(phoneid, dst, size, arg, flags) \
|
---|
| 279 | async_share_in_start((phoneid), (dst), (size), (arg), (flags))
|
---|
| 280 |
|
---|
[96b02eb9] | 281 | extern int async_share_in_start(int, void *, size_t, sysarg_t, int *);
|
---|
[0da4e41] | 282 | extern int async_share_in_receive(ipc_callid_t *, size_t *);
|
---|
| 283 | extern int async_share_in_finalize(ipc_callid_t, void *, int );
|
---|
| 284 | extern int async_share_out_start(int, void *, int);
|
---|
| 285 | extern int async_share_out_receive(ipc_callid_t *, size_t *, int *);
|
---|
| 286 | extern int async_share_out_finalize(ipc_callid_t, void *);
|
---|
[b4cbef1] | 287 |
|
---|
| 288 | /*
|
---|
| 289 | * User-friendly wrappers for async_data_read_forward_fast().
|
---|
| 290 | */
|
---|
| 291 | #define async_data_read_forward_0_0(phoneid, method, answer) \
|
---|
| 292 | async_data_read_forward_fast((phoneid), (method), 0, 0, 0, 0, NULL)
|
---|
| 293 | #define async_data_read_forward_0_1(phoneid, method, answer) \
|
---|
| 294 | async_data_read_forward_fast((phoneid), (method), 0, 0, 0, 0, (answer))
|
---|
| 295 | #define async_data_read_forward_1_0(phoneid, method, arg1, answer) \
|
---|
| 296 | async_data_read_forward_fast((phoneid), (method), (arg1), 0, 0, 0, NULL)
|
---|
| 297 | #define async_data_read_forward_1_1(phoneid, method, arg1, answer) \
|
---|
| 298 | async_data_read_forward_fast((phoneid), (method), (arg1), 0, 0, 0, (answer))
|
---|
| 299 | #define async_data_read_forward_2_0(phoneid, method, arg1, arg2, answer) \
|
---|
| 300 | async_data_read_forward_fast((phoneid), (method), (arg1), (arg2), 0, 0, NULL)
|
---|
| 301 | #define async_data_read_forward_2_1(phoneid, method, arg1, arg2, answer) \
|
---|
| 302 | async_data_read_forward_fast((phoneid), (method), (arg1), (arg2), 0, 0, \
|
---|
| 303 | (answer))
|
---|
| 304 | #define async_data_read_forward_3_0(phoneid, method, arg1, arg2, arg3, answer) \
|
---|
| 305 | async_data_read_forward_fast((phoneid), (method), (arg1), (arg2), (arg3), 0, \
|
---|
| 306 | NULL)
|
---|
| 307 | #define async_data_read_forward_3_1(phoneid, method, arg1, arg2, arg3, answer) \
|
---|
| 308 | async_data_read_forward_fast((phoneid), (method), (arg1), (arg2), (arg3), 0, \
|
---|
| 309 | (answer))
|
---|
| 310 | #define async_data_read_forward_4_0(phoneid, method, arg1, arg2, arg3, arg4, answer) \
|
---|
| 311 | async_data_read_forward_fast((phoneid), (method), (arg1), (arg2), (arg3), \
|
---|
| 312 | (arg4), NULL)
|
---|
| 313 | #define async_data_read_forward_4_1(phoneid, method, arg1, arg2, arg3, arg4, answer) \
|
---|
| 314 | async_data_read_forward_fast((phoneid), (method), (arg1), (arg2), (arg3), \
|
---|
| 315 | (arg4), (answer))
|
---|
| 316 |
|
---|
[0da4e41] | 317 | extern int async_data_read_start(int, void *, size_t);
|
---|
| 318 | extern int async_data_read_receive(ipc_callid_t *, size_t *);
|
---|
| 319 | extern int async_data_read_finalize(ipc_callid_t, const void *, size_t);
|
---|
[eda925a] | 320 |
|
---|
[96b02eb9] | 321 | extern int async_data_read_forward_fast(int, sysarg_t, sysarg_t, sysarg_t,
|
---|
| 322 | sysarg_t, sysarg_t, ipc_call_t *);
|
---|
[b4cbef1] | 323 |
|
---|
| 324 | /*
|
---|
[eda925a] | 325 | * User-friendly wrappers for async_data_write_forward_fast().
|
---|
[b4cbef1] | 326 | */
|
---|
[eda925a] | 327 | #define async_data_write_forward_0_0(phoneid, method, answer) \
|
---|
| 328 | async_data_write_forward_fast((phoneid), (method), 0, 0, 0, 0, NULL)
|
---|
| 329 | #define async_data_write_forward_0_1(phoneid, method, answer) \
|
---|
| 330 | async_data_write_forward_fast((phoneid), (method), 0, 0, 0, 0, (answer))
|
---|
| 331 | #define async_data_write_forward_1_0(phoneid, method, arg1, answer) \
|
---|
| 332 | async_data_write_forward_fast((phoneid), (method), (arg1), 0, 0, 0, NULL)
|
---|
| 333 | #define async_data_write_forward_1_1(phoneid, method, arg1, answer) \
|
---|
| 334 | async_data_write_forward_fast((phoneid), (method), (arg1), 0, 0, 0, \
|
---|
[b4cbef1] | 335 | (answer))
|
---|
[eda925a] | 336 | #define async_data_write_forward_2_0(phoneid, method, arg1, arg2, answer) \
|
---|
| 337 | async_data_write_forward_fast((phoneid), (method), (arg1), (arg2), 0, 0, \
|
---|
[b4cbef1] | 338 | NULL)
|
---|
[eda925a] | 339 | #define async_data_write_forward_2_1(phoneid, method, arg1, arg2, answer) \
|
---|
| 340 | async_data_write_forward_fast((phoneid), (method), (arg1), (arg2), 0, 0, \
|
---|
[b4cbef1] | 341 | (answer))
|
---|
[eda925a] | 342 | #define async_data_write_forward_3_0(phoneid, method, arg1, arg2, arg3, answer) \
|
---|
| 343 | async_data_write_forward_fast((phoneid), (method), (arg1), (arg2), (arg3), \
|
---|
| 344 | 0, NULL)
|
---|
| 345 | #define async_data_write_forward_3_1(phoneid, method, arg1, arg2, arg3, answer) \
|
---|
| 346 | async_data_write_forward_fast((phoneid), (method), (arg1), (arg2), (arg3), \
|
---|
| 347 | 0, (answer))
|
---|
| 348 | #define async_data_write_forward_4_0(phoneid, method, arg1, arg2, arg3, arg4, answer) \
|
---|
| 349 | async_data_write_forward_fast((phoneid), (method), (arg1), (arg2), (arg3), \
|
---|
[b4cbef1] | 350 | (arg4), NULL)
|
---|
[eda925a] | 351 | #define async_data_write_forward_4_1(phoneid, method, arg1, arg2, arg3, arg4, answer) \
|
---|
| 352 | async_data_write_forward_fast((phoneid), (method), (arg1), (arg2), (arg3), \
|
---|
[b4cbef1] | 353 | (arg4), (answer))
|
---|
| 354 |
|
---|
[0da4e41] | 355 | extern int async_data_write_start(int, const void *, size_t);
|
---|
| 356 | extern int async_data_write_receive(ipc_callid_t *, size_t *);
|
---|
| 357 | extern int async_data_write_finalize(ipc_callid_t, void *, size_t);
|
---|
[eda925a] | 358 |
|
---|
| 359 | extern int async_data_write_accept(void **, const bool, const size_t,
|
---|
| 360 | const size_t, const size_t, size_t *);
|
---|
| 361 | extern void async_data_write_void(const int);
|
---|
| 362 |
|
---|
[96b02eb9] | 363 | extern int async_data_write_forward_fast(int, sysarg_t, sysarg_t, sysarg_t,
|
---|
| 364 | sysarg_t, sysarg_t, ipc_call_t *);
|
---|
[8aa42e3] | 365 |
|
---|
[630c3a9] | 366 | #endif
|
---|
[b2951e2] | 367 |
|
---|
[fadd381] | 368 | /** @}
|
---|
[b2951e2] | 369 | */
|
---|