Changes in uspace/lib/c/generic/ipc.c [c170438:52d2603] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/ipc.c
rc170438 r52d2603 96 96 } 97 97 98 /** Prolog uefor ipc_call_async_*() functions.98 /** Prolog for ipc_call_async_*() functions. 99 99 * 100 100 * @param private Argument for the answer/error callback. … … 122 122 } 123 123 124 /** Epilog uefor ipc_call_async_*() functions.124 /** Epilog 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 preempted 130 * in this call. 131 * 129 132 */ 130 133 static inline void ipc_finish_async(ipc_callid_t callid, int phoneid, 131 async_call_t *call )134 async_call_t *call, bool can_preempt) 132 135 { 133 136 if (!call) { … … 156 159 list_append(&call->list, &queued_calls); 157 160 158 call->fid = fibril_get_id(); 159 fibril_switch(FIBRIL_TO_MANAGER); 160 /* Async futex unlocked by previous call */ 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 } 161 169 162 170 return; … … 189 197 * @param private Argument to be passed to the answer/error callback. 190 198 * @param callback Answer or error callback. 199 * @param can_preempt If true, the current fibril will be preempted in 200 * case the kernel temporarily refuses to accept more 201 * asynchronous calls. 202 * 191 203 */ 192 204 void ipc_call_async_fast(int phoneid, sysarg_t imethod, sysarg_t arg1, 193 205 sysarg_t arg2, sysarg_t arg3, sysarg_t arg4, void *private, 194 ipc_async_callback_t callback )206 ipc_async_callback_t callback, bool can_preempt) 195 207 { 196 208 async_call_t *call = NULL; … … 234 246 } 235 247 236 ipc_finish_async(callid, phoneid, call );248 ipc_finish_async(callid, phoneid, call, can_preempt); 237 249 } 238 250 … … 254 266 * @param private Argument to be passed to the answer/error callback. 255 267 * @param callback Answer or error callback. 268 * @param can_preempt If true, the current fibril will be preempted in 269 * case the kernel temporarily refuses to accept more 270 * asynchronous calls. 271 * 256 272 */ 257 273 void ipc_call_async_slow(int phoneid, sysarg_t imethod, sysarg_t arg1, 258 274 sysarg_t arg2, sysarg_t arg3, sysarg_t arg4, sysarg_t arg5, void *private, 259 ipc_async_callback_t callback )275 ipc_async_callback_t callback, bool can_preempt) 260 276 { 261 277 async_call_t *call = ipc_prepare_async(private, callback); … … 279 295 ipc_call_async_internal(phoneid, &call->u.msg.data); 280 296 281 ipc_finish_async(callid, phoneid, call );297 ipc_finish_async(callid, phoneid, call, can_preempt); 282 298 } 283 299 … … 359 375 futex_up(&async_futex); 360 376 361 assert(call->fid);362 fibril_add_ready(call->fid);377 if (call->fid) 378 fibril_add_ready(call->fid); 363 379 364 380 if (callid == (ipc_callid_t) IPC_CALLRET_FATAL) {
Note:
See TracChangeset
for help on using the changeset viewer.