[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 |
|
---|
[23882034] | 107 | extern void *async_client_data_get(void);
|
---|
| 108 |
|
---|
[11bb813] | 109 | extern void async_set_client_connection(async_client_conn_t);
|
---|
| 110 | extern void async_set_interrupt_received(async_client_conn_t);
|
---|
[0cc4313] | 111 |
|
---|
| 112 | /* Wrappers for simple communication */
|
---|
| 113 | #define async_msg_0(phone, method) \
|
---|
[9db9b10] | 114 | ipc_call_async_0((phone), (method), NULL, NULL, true)
|
---|
[0cc4313] | 115 | #define async_msg_1(phone, method, arg1) \
|
---|
[9db9b10] | 116 | ipc_call_async_1((phone), (method), (arg1), NULL, NULL, \
|
---|
| 117 | true)
|
---|
[0cc4313] | 118 | #define async_msg_2(phone, method, arg1, arg2) \
|
---|
[9db9b10] | 119 | ipc_call_async_2((phone), (method), (arg1), (arg2), NULL, NULL, \
|
---|
| 120 | true)
|
---|
[0cc4313] | 121 | #define async_msg_3(phone, method, arg1, arg2, arg3) \
|
---|
[9db9b10] | 122 | ipc_call_async_3((phone), (method), (arg1), (arg2), (arg3), NULL, NULL, \
|
---|
| 123 | true)
|
---|
[0cc4313] | 124 | #define async_msg_4(phone, method, arg1, arg2, arg3, arg4) \
|
---|
[9db9b10] | 125 | ipc_call_async_4((phone), (method), (arg1), (arg2), (arg3), (arg4), NULL, \
|
---|
| 126 | NULL, true)
|
---|
[0cc4313] | 127 | #define async_msg_5(phone, method, arg1, arg2, arg3, arg4, arg5) \
|
---|
[9db9b10] | 128 | ipc_call_async_5((phone), (method), (arg1), (arg2), (arg3), (arg4), \
|
---|
| 129 | (arg5), NULL, NULL, true)
|
---|
[0cc4313] | 130 |
|
---|
| 131 | /*
|
---|
| 132 | * User-friendly wrappers for async_req_fast() and async_req_slow(). The macros
|
---|
| 133 | * are in the form async_req_m_n(), where m is the number of payload arguments
|
---|
[6b21292] | 134 | * and n is the number of return arguments. The macros decide between the fast
|
---|
[0cc4313] | 135 | * and slow verion based on m.
|
---|
| 136 | */
|
---|
| 137 | #define async_req_0_0(phoneid, method) \
|
---|
[9db9b10] | 138 | async_req_fast((phoneid), (method), 0, 0, 0, 0, NULL, NULL, NULL, NULL, \
|
---|
| 139 | NULL)
|
---|
[0cc4313] | 140 | #define async_req_0_1(phoneid, method, r1) \
|
---|
[9db9b10] | 141 | async_req_fast((phoneid), (method), 0, 0, 0, 0, (r1), NULL, NULL, NULL, \
|
---|
| 142 | NULL)
|
---|
[0cc4313] | 143 | #define async_req_0_2(phoneid, method, r1, r2) \
|
---|
[9db9b10] | 144 | async_req_fast((phoneid), (method), 0, 0, 0, 0, (r1), (r2), NULL, NULL, \
|
---|
| 145 | NULL)
|
---|
[0cc4313] | 146 | #define async_req_0_3(phoneid, method, r1, r2, r3) \
|
---|
[9db9b10] | 147 | async_req_fast((phoneid), (method), 0, 0, 0, 0, (r1), (r2), (r3), NULL, \
|
---|
| 148 | NULL)
|
---|
[0cc4313] | 149 | #define async_req_0_4(phoneid, method, r1, r2, r3, r4) \
|
---|
[9db9b10] | 150 | async_req_fast((phoneid), (method), 0, 0, 0, 0, (r1), (r2), (r3), (r4), \
|
---|
| 151 | NULL)
|
---|
[0cc4313] | 152 | #define async_req_0_5(phoneid, method, r1, r2, r3, r4, r5) \
|
---|
[9db9b10] | 153 | async_req_fast((phoneid), (method), 0, 0, 0, 0, (r1), (r2), (r3), (r4), \
|
---|
| 154 | (r5))
|
---|
[0cc4313] | 155 | #define async_req_1_0(phoneid, method, arg1) \
|
---|
[9db9b10] | 156 | async_req_fast((phoneid), (method), (arg1), 0, 0, 0, NULL, NULL, NULL, \
|
---|
| 157 | NULL, NULL)
|
---|
[0cc4313] | 158 | #define async_req_1_1(phoneid, method, arg1, rc1) \
|
---|
[9db9b10] | 159 | async_req_fast((phoneid), (method), (arg1), 0, 0, 0, (rc1), NULL, NULL, \
|
---|
| 160 | NULL, NULL)
|
---|
[0cc4313] | 161 | #define async_req_1_2(phoneid, method, arg1, rc1, rc2) \
|
---|
[9db9b10] | 162 | async_req_fast((phoneid), (method), (arg1), 0, 0, 0, (rc1), (rc2), NULL, \
|
---|
| 163 | NULL, NULL)
|
---|
[0cc4313] | 164 | #define async_req_1_3(phoneid, method, arg1, rc1, rc2, rc3) \
|
---|
[9db9b10] | 165 | async_req_fast((phoneid), (method), (arg1), 0, 0, 0, (rc1), (rc2), (rc3), \
|
---|
| 166 | NULL, NULL)
|
---|
[0cc4313] | 167 | #define async_req_1_4(phoneid, method, arg1, rc1, rc2, rc3, rc4) \
|
---|
[9db9b10] | 168 | async_req_fast((phoneid), (method), (arg1), 0, 0, 0, (rc1), (rc2), (rc3), \
|
---|
| 169 | (rc4), NULL)
|
---|
[0cc4313] | 170 | #define async_req_1_5(phoneid, method, arg1, rc1, rc2, rc3, rc4, rc5) \
|
---|
[9db9b10] | 171 | async_req_fast((phoneid), (method), (arg1), 0, 0, 0, (rc1), (rc2), (rc3), \
|
---|
| 172 | (rc4), (rc5))
|
---|
[0cc4313] | 173 | #define async_req_2_0(phoneid, method, arg1, arg2) \
|
---|
[9db9b10] | 174 | async_req_fast((phoneid), (method), (arg1), (arg2), 0, 0, NULL, NULL, \
|
---|
| 175 | NULL, NULL, NULL)
|
---|
[0cc4313] | 176 | #define async_req_2_1(phoneid, method, arg1, arg2, rc1) \
|
---|
[9db9b10] | 177 | async_req_fast((phoneid), (method), (arg1), (arg2), 0, 0, (rc1), NULL, \
|
---|
| 178 | NULL, NULL, NULL)
|
---|
[0cc4313] | 179 | #define async_req_2_2(phoneid, method, arg1, arg2, rc1, rc2) \
|
---|
[9db9b10] | 180 | async_req_fast((phoneid), (method), (arg1), (arg2), 0, 0, (rc1), (rc2), \
|
---|
| 181 | NULL, NULL, NULL)
|
---|
[0cc4313] | 182 | #define async_req_2_3(phoneid, method, arg1, arg2, rc1, rc2, rc3) \
|
---|
[9db9b10] | 183 | async_req_fast((phoneid), (method), (arg1), (arg2), 0, 0, (rc1), (rc2), \
|
---|
| 184 | (rc3), NULL, NULL)
|
---|
[0cc4313] | 185 | #define async_req_2_4(phoneid, method, arg1, arg2, rc1, rc2, rc3, rc4) \
|
---|
[9db9b10] | 186 | async_req_fast((phoneid), (method), (arg1), (arg2), 0, 0, (rc1), (rc2), \
|
---|
| 187 | (rc3), (rc4), NULL)
|
---|
[0cc4313] | 188 | #define async_req_2_5(phoneid, method, arg1, arg2, rc1, rc2, rc3, rc4, rc5) \
|
---|
[9db9b10] | 189 | async_req_fast((phoneid), (method), (arg1), (arg2), 0, 0, (rc1), (rc2), \
|
---|
| 190 | (rc3), (rc4), (rc5))
|
---|
[0cc4313] | 191 | #define async_req_3_0(phoneid, method, arg1, arg2, arg3) \
|
---|
[9db9b10] | 192 | async_req_fast((phoneid), (method), (arg1), (arg2), (arg3), 0, NULL, NULL, \
|
---|
| 193 | NULL, NULL, NULL)
|
---|
[0cc4313] | 194 | #define async_req_3_1(phoneid, method, arg1, arg2, arg3, rc1) \
|
---|
[9db9b10] | 195 | async_req_fast((phoneid), (method), (arg1), (arg2), (arg3), 0, (rc1), \
|
---|
| 196 | NULL, NULL, NULL, NULL)
|
---|
[0cc4313] | 197 | #define async_req_3_2(phoneid, method, arg1, arg2, arg3, rc1, rc2) \
|
---|
[9db9b10] | 198 | async_req_fast((phoneid), (method), (arg1), (arg2), (arg3), 0, (rc1), \
|
---|
| 199 | (rc2), NULL, NULL, NULL)
|
---|
[0cc4313] | 200 | #define async_req_3_3(phoneid, method, arg1, arg2, arg3, rc1, rc2, rc3) \
|
---|
[9db9b10] | 201 | async_req_fast((phoneid), (method), (arg1), (arg2), (arg3), 0, (rc1), \
|
---|
| 202 | (rc2), (rc3), NULL, NULL)
|
---|
[0cc4313] | 203 | #define async_req_3_4(phoneid, method, arg1, arg2, arg3, rc1, rc2, rc3, rc4) \
|
---|
[9db9b10] | 204 | async_req_fast((phoneid), (method), (arg1), (arg2), (arg3), 0, (rc1), \
|
---|
| 205 | (rc2), (rc3), (rc4), NULL)
|
---|
[0cc4313] | 206 | #define async_req_3_5(phoneid, method, arg1, arg2, arg3, rc1, rc2, rc3, rc4, \
|
---|
| 207 | rc5) \
|
---|
| 208 | async_req_fast((phoneid), (method), (arg1), (arg2), (arg3), 0, (rc1), \
|
---|
| 209 | (rc2), (rc3), (rc4), (rc5))
|
---|
| 210 | #define async_req_4_0(phoneid, method, arg1, arg2, arg3, arg4) \
|
---|
[9db9b10] | 211 | async_req_fast((phoneid), (method), (arg1), (arg2), (arg3), (arg4), NULL, \
|
---|
| 212 | NULL, NULL, NULL, NULL)
|
---|
[0cc4313] | 213 | #define async_req_4_1(phoneid, method, arg1, arg2, arg3, arg4, rc1) \
|
---|
[9db9b10] | 214 | async_req_fast((phoneid), (method), (arg1), (arg2), (arg3), (arg4), (rc1), \
|
---|
| 215 | NULL, NULL, NULL, NULL)
|
---|
[0cc4313] | 216 | #define async_req_4_2(phoneid, method, arg1, arg2, arg3, arg4, rc1, rc2) \
|
---|
[9db9b10] | 217 | async_req_fast((phoneid), (method), (arg1), (arg2), (arg3), (arg4), (rc1), \
|
---|
| 218 | (rc2), NULL, NULL, NULL)
|
---|
[0cc4313] | 219 | #define async_req_4_3(phoneid, method, arg1, arg2, arg3, arg4, rc1, rc2, rc3) \
|
---|
[9db9b10] | 220 | async_req_fast((phoneid), (method), (arg1), (arg2), (arg3), (arg4), (rc1), \
|
---|
| 221 | (rc2), (rc3), NULL, NULL)
|
---|
[0cc4313] | 222 | #define async_req_4_4(phoneid, method, arg1, arg2, arg3, arg4, rc1, rc2, rc3, \
|
---|
| 223 | rc4) \
|
---|
| 224 | async_req_fast((phoneid), (method), (arg1), (arg2), (arg3), (arg4), \
|
---|
| 225 | (rc1), (rc2), (rc3), (rc4), NULL)
|
---|
| 226 | #define async_req_4_5(phoneid, method, arg1, arg2, arg3, arg4, rc1, rc2, rc3, \
|
---|
| 227 | rc4, rc5) \
|
---|
| 228 | async_req_fast((phoneid), (method), (arg1), (arg2), (arg3), (arg4), \
|
---|
| 229 | (rc1), (rc2), (rc3), (rc4), (rc5))
|
---|
| 230 | #define async_req_5_0(phoneid, method, arg1, arg2, arg3, arg4, arg5) \
|
---|
[9db9b10] | 231 | async_req_slow((phoneid), (method), (arg1), (arg2), (arg3), (arg4), \
|
---|
| 232 | (arg5), NULL, NULL, NULL, NULL, NULL)
|
---|
[0cc4313] | 233 | #define async_req_5_1(phoneid, method, arg1, arg2, arg3, arg4, arg5, rc1) \
|
---|
[9db9b10] | 234 | async_req_slow((phoneid), (method), (arg1), (arg2), (arg3), (arg4), \
|
---|
| 235 | (arg5), (rc1), NULL, NULL, NULL, NULL)
|
---|
[0cc4313] | 236 | #define async_req_5_2(phoneid, method, arg1, arg2, arg3, arg4, arg5, rc1, rc2) \
|
---|
[9db9b10] | 237 | async_req_slow((phoneid), (method), (arg1), (arg2), (arg3), (arg4), \
|
---|
| 238 | (arg5), (rc1), (rc2), NULL, NULL, NULL)
|
---|
[0cc4313] | 239 | #define async_req_5_3(phoneid, method, arg1, arg2, arg3, arg4, arg5, rc1, rc2, \
|
---|
| 240 | rc3) \
|
---|
| 241 | async_req_slow((phoneid), (method), (arg1), (arg2), (arg3), (arg4), \
|
---|
| 242 | (arg5), (rc1), (rc2), (rc3), NULL, NULL)
|
---|
| 243 | #define async_req_5_4(phoneid, method, arg1, arg2, arg3, arg4, arg5, rc1, rc2, \
|
---|
| 244 | rc3, rc4) \
|
---|
| 245 | async_req_slow((phoneid), (method), (arg1), (arg2), (arg3), (arg4), \
|
---|
| 246 | (arg5), (rc1), (rc2), (rc3), (rc4), NULL)
|
---|
| 247 | #define async_req_5_5(phoneid, method, arg1, arg2, arg3, arg4, arg5, rc1, rc2, \
|
---|
| 248 | rc3, rc4, rc5) \
|
---|
| 249 | async_req_slow((phoneid), (method), (arg1), (arg2), (arg3), (arg4), \
|
---|
| 250 | (arg5), (rc1), (rc2), (rc3), (rc4), (rc5))
|
---|
[fc42b28] | 251 |
|
---|
[11bb813] | 252 | extern sysarg_t async_req_fast(int, sysarg_t, sysarg_t, sysarg_t, sysarg_t,
|
---|
| 253 | sysarg_t, sysarg_t *, sysarg_t *, sysarg_t *, sysarg_t *, sysarg_t *);
|
---|
| 254 | extern sysarg_t async_req_slow(int, sysarg_t, sysarg_t, sysarg_t, sysarg_t,
|
---|
| 255 | sysarg_t, sysarg_t, sysarg_t *, sysarg_t *, sysarg_t *, sysarg_t *,
|
---|
| 256 | sysarg_t *);
|
---|
[085bd54] | 257 |
|
---|
| 258 | static inline void async_serialize_start(void)
|
---|
| 259 | {
|
---|
[bc1f1c2] | 260 | fibril_inc_sercount();
|
---|
[085bd54] | 261 | }
|
---|
[3dbe2d1f] | 262 |
|
---|
[085bd54] | 263 | static inline void async_serialize_end(void)
|
---|
| 264 | {
|
---|
[bc1f1c2] | 265 | fibril_dec_sercount();
|
---|
[085bd54] | 266 | }
|
---|
[fc42b28] | 267 |
|
---|
[96b02eb9] | 268 | extern int async_connect_me_to(int, sysarg_t, sysarg_t, sysarg_t);
|
---|
| 269 | extern int async_connect_me_to_blocking(int, sysarg_t, sysarg_t, sysarg_t);
|
---|
[f74392f] | 270 |
|
---|
[0da4e41] | 271 | /*
|
---|
| 272 | * User-friendly wrappers for async_share_in_start().
|
---|
| 273 | */
|
---|
| 274 | #define async_share_in_start_0_0(phoneid, dst, size) \
|
---|
| 275 | async_share_in_start((phoneid), (dst), (size), 0, NULL)
|
---|
| 276 | #define async_share_in_start_0_1(phoneid, dst, size, flags) \
|
---|
| 277 | async_share_in_start((phoneid), (dst), (size), 0, (flags))
|
---|
| 278 | #define async_share_in_start_1_0(phoneid, dst, size, arg) \
|
---|
| 279 | async_share_in_start((phoneid), (dst), (size), (arg), NULL)
|
---|
| 280 | #define async_share_in_start_1_1(phoneid, dst, size, arg, flags) \
|
---|
| 281 | async_share_in_start((phoneid), (dst), (size), (arg), (flags))
|
---|
| 282 |
|
---|
[96b02eb9] | 283 | extern int async_share_in_start(int, void *, size_t, sysarg_t, int *);
|
---|
[0da4e41] | 284 | extern int async_share_in_receive(ipc_callid_t *, size_t *);
|
---|
| 285 | extern int async_share_in_finalize(ipc_callid_t, void *, int );
|
---|
| 286 | extern int async_share_out_start(int, void *, int);
|
---|
| 287 | extern int async_share_out_receive(ipc_callid_t *, size_t *, int *);
|
---|
| 288 | extern int async_share_out_finalize(ipc_callid_t, void *);
|
---|
[b4cbef1] | 289 |
|
---|
| 290 | /*
|
---|
| 291 | * User-friendly wrappers for async_data_read_forward_fast().
|
---|
| 292 | */
|
---|
| 293 | #define async_data_read_forward_0_0(phoneid, method, answer) \
|
---|
| 294 | async_data_read_forward_fast((phoneid), (method), 0, 0, 0, 0, NULL)
|
---|
| 295 | #define async_data_read_forward_0_1(phoneid, method, answer) \
|
---|
| 296 | async_data_read_forward_fast((phoneid), (method), 0, 0, 0, 0, (answer))
|
---|
| 297 | #define async_data_read_forward_1_0(phoneid, method, arg1, answer) \
|
---|
| 298 | async_data_read_forward_fast((phoneid), (method), (arg1), 0, 0, 0, NULL)
|
---|
| 299 | #define async_data_read_forward_1_1(phoneid, method, arg1, answer) \
|
---|
| 300 | async_data_read_forward_fast((phoneid), (method), (arg1), 0, 0, 0, (answer))
|
---|
| 301 | #define async_data_read_forward_2_0(phoneid, method, arg1, arg2, answer) \
|
---|
| 302 | async_data_read_forward_fast((phoneid), (method), (arg1), (arg2), 0, 0, NULL)
|
---|
| 303 | #define async_data_read_forward_2_1(phoneid, method, arg1, arg2, answer) \
|
---|
| 304 | async_data_read_forward_fast((phoneid), (method), (arg1), (arg2), 0, 0, \
|
---|
| 305 | (answer))
|
---|
| 306 | #define async_data_read_forward_3_0(phoneid, method, arg1, arg2, arg3, answer) \
|
---|
| 307 | async_data_read_forward_fast((phoneid), (method), (arg1), (arg2), (arg3), 0, \
|
---|
| 308 | NULL)
|
---|
| 309 | #define async_data_read_forward_3_1(phoneid, method, arg1, arg2, arg3, answer) \
|
---|
| 310 | async_data_read_forward_fast((phoneid), (method), (arg1), (arg2), (arg3), 0, \
|
---|
| 311 | (answer))
|
---|
| 312 | #define async_data_read_forward_4_0(phoneid, method, arg1, arg2, arg3, arg4, answer) \
|
---|
| 313 | async_data_read_forward_fast((phoneid), (method), (arg1), (arg2), (arg3), \
|
---|
| 314 | (arg4), NULL)
|
---|
| 315 | #define async_data_read_forward_4_1(phoneid, method, arg1, arg2, arg3, arg4, answer) \
|
---|
| 316 | async_data_read_forward_fast((phoneid), (method), (arg1), (arg2), (arg3), \
|
---|
| 317 | (arg4), (answer))
|
---|
| 318 |
|
---|
[0da4e41] | 319 | extern int async_data_read_start(int, void *, size_t);
|
---|
| 320 | extern int async_data_read_receive(ipc_callid_t *, size_t *);
|
---|
| 321 | extern int async_data_read_finalize(ipc_callid_t, const void *, size_t);
|
---|
[eda925a] | 322 |
|
---|
[96b02eb9] | 323 | extern int async_data_read_forward_fast(int, sysarg_t, sysarg_t, sysarg_t,
|
---|
| 324 | sysarg_t, sysarg_t, ipc_call_t *);
|
---|
[b4cbef1] | 325 |
|
---|
| 326 | /*
|
---|
[eda925a] | 327 | * User-friendly wrappers for async_data_write_forward_fast().
|
---|
[b4cbef1] | 328 | */
|
---|
[eda925a] | 329 | #define async_data_write_forward_0_0(phoneid, method, answer) \
|
---|
| 330 | async_data_write_forward_fast((phoneid), (method), 0, 0, 0, 0, NULL)
|
---|
| 331 | #define async_data_write_forward_0_1(phoneid, method, answer) \
|
---|
| 332 | async_data_write_forward_fast((phoneid), (method), 0, 0, 0, 0, (answer))
|
---|
| 333 | #define async_data_write_forward_1_0(phoneid, method, arg1, answer) \
|
---|
| 334 | async_data_write_forward_fast((phoneid), (method), (arg1), 0, 0, 0, NULL)
|
---|
| 335 | #define async_data_write_forward_1_1(phoneid, method, arg1, answer) \
|
---|
| 336 | async_data_write_forward_fast((phoneid), (method), (arg1), 0, 0, 0, \
|
---|
[b4cbef1] | 337 | (answer))
|
---|
[eda925a] | 338 | #define async_data_write_forward_2_0(phoneid, method, arg1, arg2, answer) \
|
---|
| 339 | async_data_write_forward_fast((phoneid), (method), (arg1), (arg2), 0, 0, \
|
---|
[b4cbef1] | 340 | NULL)
|
---|
[eda925a] | 341 | #define async_data_write_forward_2_1(phoneid, method, arg1, arg2, answer) \
|
---|
| 342 | async_data_write_forward_fast((phoneid), (method), (arg1), (arg2), 0, 0, \
|
---|
[b4cbef1] | 343 | (answer))
|
---|
[eda925a] | 344 | #define async_data_write_forward_3_0(phoneid, method, arg1, arg2, arg3, answer) \
|
---|
| 345 | async_data_write_forward_fast((phoneid), (method), (arg1), (arg2), (arg3), \
|
---|
| 346 | 0, NULL)
|
---|
| 347 | #define async_data_write_forward_3_1(phoneid, method, arg1, arg2, arg3, answer) \
|
---|
| 348 | async_data_write_forward_fast((phoneid), (method), (arg1), (arg2), (arg3), \
|
---|
| 349 | 0, (answer))
|
---|
| 350 | #define async_data_write_forward_4_0(phoneid, method, arg1, arg2, arg3, arg4, answer) \
|
---|
| 351 | async_data_write_forward_fast((phoneid), (method), (arg1), (arg2), (arg3), \
|
---|
[b4cbef1] | 352 | (arg4), NULL)
|
---|
[eda925a] | 353 | #define async_data_write_forward_4_1(phoneid, method, arg1, arg2, arg3, arg4, answer) \
|
---|
| 354 | async_data_write_forward_fast((phoneid), (method), (arg1), (arg2), (arg3), \
|
---|
[b4cbef1] | 355 | (arg4), (answer))
|
---|
| 356 |
|
---|
[0da4e41] | 357 | extern int async_data_write_start(int, const void *, size_t);
|
---|
| 358 | extern int async_data_write_receive(ipc_callid_t *, size_t *);
|
---|
| 359 | extern int async_data_write_finalize(ipc_callid_t, void *, size_t);
|
---|
[eda925a] | 360 |
|
---|
| 361 | extern int async_data_write_accept(void **, const bool, const size_t,
|
---|
| 362 | const size_t, const size_t, size_t *);
|
---|
| 363 | extern void async_data_write_void(const int);
|
---|
| 364 |
|
---|
[96b02eb9] | 365 | extern int async_data_write_forward_fast(int, sysarg_t, sysarg_t, sysarg_t,
|
---|
| 366 | sysarg_t, sysarg_t, ipc_call_t *);
|
---|
[8aa42e3] | 367 |
|
---|
[630c3a9] | 368 | #endif
|
---|
[b2951e2] | 369 |
|
---|
[fadd381] | 370 | /** @}
|
---|
[b2951e2] | 371 | */
|
---|