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