Changeset 2a7ba5e in mainline for uspace/lib/c/generic/ipc.c
- Timestamp:
- 2016-05-24T21:03:32Z (9 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 609f8d9c
- Parents:
- 0a981e3 (diff), c170438 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/ipc.c
r0a981e3 r2a7ba5e 96 96 } 97 97 98 /** Prolog for ipc_call_async_*() functions.98 /** Prologue for ipc_call_async_*() functions. 99 99 * 100 100 * @param private Argument for the answer/error callback. … … 122 122 } 123 123 124 /** Epilog for ipc_call_async_*() functions.124 /** Epilogue for ipc_call_async_*() functions. 125 125 * 126 126 * @param callid Value returned by the SYS_IPC_CALL_ASYNC_* syscall. 127 127 * @param phoneid Phone handle through which the call was made. 128 128 * @param call Structure returned by ipc_prepare_async(). 129 * @param can_preempt If true, the current fibril can be preempted130 * in this call.131 *132 129 */ 133 130 static inline void ipc_finish_async(ipc_callid_t callid, int phoneid, 134 async_call_t *call , bool can_preempt)131 async_call_t *call) 135 132 { 136 133 if (!call) { … … 159 156 list_append(&call->list, &queued_calls); 160 157 161 if (can_preempt) { 162 call->fid = fibril_get_id(); 163 fibril_switch(FIBRIL_TO_MANAGER); 164 /* Async futex unlocked by previous call */ 165 } else { 166 call->fid = 0; 167 futex_up(&async_futex); 168 } 158 call->fid = fibril_get_id(); 159 fibril_switch(FIBRIL_TO_MANAGER); 160 /* Async futex unlocked by previous call */ 169 161 170 162 return; … … 197 189 * @param private Argument to be passed to the answer/error callback. 198 190 * @param callback Answer or error callback. 199 * @param can_preempt If true, the current fibril will be preempted in200 * case the kernel temporarily refuses to accept more201 * asynchronous calls.202 *203 191 */ 204 192 void ipc_call_async_fast(int phoneid, sysarg_t imethod, sysarg_t arg1, 205 193 sysarg_t arg2, sysarg_t arg3, sysarg_t arg4, void *private, 206 ipc_async_callback_t callback , bool can_preempt)194 ipc_async_callback_t callback) 207 195 { 208 196 async_call_t *call = NULL; … … 246 234 } 247 235 248 ipc_finish_async(callid, phoneid, call , can_preempt);236 ipc_finish_async(callid, phoneid, call); 249 237 } 250 238 … … 266 254 * @param private Argument to be passed to the answer/error callback. 267 255 * @param callback Answer or error callback. 268 * @param can_preempt If true, the current fibril will be preempted in269 * case the kernel temporarily refuses to accept more270 * asynchronous calls.271 *272 256 */ 273 257 void ipc_call_async_slow(int phoneid, sysarg_t imethod, sysarg_t arg1, 274 258 sysarg_t arg2, sysarg_t arg3, sysarg_t arg4, sysarg_t arg5, void *private, 275 ipc_async_callback_t callback , bool can_preempt)259 ipc_async_callback_t callback) 276 260 { 277 261 async_call_t *call = ipc_prepare_async(private, callback); … … 295 279 ipc_call_async_internal(phoneid, &call->u.msg.data); 296 280 297 ipc_finish_async(callid, phoneid, call , can_preempt);281 ipc_finish_async(callid, phoneid, call); 298 282 } 299 283 … … 375 359 futex_up(&async_futex); 376 360 377 if (call->fid)378 361 assert(call->fid); 362 fibril_add_ready(call->fid); 379 363 380 364 if (callid == (ipc_callid_t) IPC_CALLRET_FATAL) {
Note:
See TracChangeset
for help on using the changeset viewer.