Changeset 35f2bb1 in mainline for uspace/lib/c/generic/ipc.c


Ignore:
Timestamp:
2017-11-23T21:15:13Z (6 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
40e5d66
Parents:
d51a0d6
Message:

Remove support for queuing of unsent calls

Support for temporary IPC failures was removed before 0.7.1 so this code
is no longer needed and can be removed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/ipc.c

    rd51a0d6 r35f2bb1  
    5050
    5151/**
    52  * Structures of this type are used for keeping track
    53  * of sent asynchronous calls and queing unsent calls.
     52 * Structures of this type are used for keeping track of sent asynchronous calls.
    5453 */
    5554typedef struct {
     
    7271
    7372LIST_INITIALIZE(dispatched_calls);
    74 
    75 /** List of asynchronous calls that were not accepted by kernel.
    76  *
    77  * Protected by async_futex, because if the call is not accepted
    78  * by the kernel, the async framework is used automatically.
    79  *
    80  */
    81 LIST_INITIALIZE(queued_calls);
    8273
    8374static futex_t ipc_futex = FUTEX_INITIALIZER;
     
    294285       
    295286        return __SYSCALL2(SYS_IPC_ANSWER_SLOW, callid, (sysarg_t) &data);
    296 }
    297 
    298 /** Try to dispatch queued calls from the async queue.
    299  *
    300  */
    301 static void dispatch_queued_calls(void)
    302 {
    303         /** @todo
    304          * Integrate intelligently ipc_futex so that it is locked during
    305          * ipc_call_async_*() until it is added to dispatched_calls.
    306          */
    307        
    308         futex_down(&async_futex);
    309        
    310         while (!list_empty(&queued_calls)) {
    311                 async_call_t *call =
    312                     list_get_instance(list_first(&queued_calls), async_call_t, list);
    313                 ipc_callid_t callid =
    314                     ipc_call_async_internal(call->u.msg.phoneid, &call->u.msg.data);
    315                
    316                 list_remove(&call->list);
    317                
    318                 futex_up(&async_futex);
    319                
    320                 assert(call->fid);
    321                 fibril_add_ready(call->fid);
    322                
    323                 if (callid == (ipc_callid_t) IPC_CALLRET_FATAL) {
    324                         if (call->callback)
    325                                 call->callback(call->private, ENOENT, NULL);
    326                        
    327                         free(call);
    328                 } else {
    329                         call->u.callid = callid;
    330                        
    331                         futex_lock(&ipc_futex);
    332                         list_append(&call->list, &dispatched_calls);
    333                         futex_unlock(&ipc_futex);
    334                 }
    335                
    336                 futex_down(&async_futex);
    337         }
    338        
    339         futex_up(&async_futex);
    340287}
    341288
     
    400347       
    401348        /* Handle received answers */
    402         if (callid & IPC_CALLID_ANSWERED) {
     349        if (callid & IPC_CALLID_ANSWERED)
    403350                handle_answer(callid, call);
    404                 dispatch_queued_calls();
    405         }
    406351       
    407352        return callid;
Note: See TracChangeset for help on using the changeset viewer.