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