Changeset 716185d in mainline


Ignore:
Timestamp:
2012-10-03T20:37:07Z (12 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
466e95f7
Parents:
190976f
Message:

Call request_process() callback for incoming calls during IPC cleanup.

Location:
kernel/generic
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/ipc/sysipc_ops.h

    r190976f r716185d  
    7070 * the call is request_forget().
    7171 *
    72  * The request_process() callback will be skipped if the callee terminates
    73  * before picking up the request. In this case, the terminating task will
    74  * cleanup its incoming calls list and so the next callback invoked on the call
    75  * will usually be answer_preprocess(). If, in the meantime, the caller
    76  * terminates too, it may happen that the call will be forgotten instead of
    77  * answered, in which case the kernel will invoke the request_forget() and
    78  * answer_cleanup() callbacks instead. The order in which they are invoked is
    79  * not defined.
    80  *
    8172 * The comments for each callback type describe the specifics of each callback
    8273 * such as the context in which it is invoked and various constraints.
     
    112103         * Caller alive:        no guarantee
    113104         * Races with:          request_forget()
    114          * Invoked on:          calls that are explicitly received by the callee
     105         * Invoked on:          all calls delivered to the callee
    115106         */     
    116107        int (* request_process)(call_t *, answerbox_t *);
     
    144135         * Caller alive:        guaranteed
    145136         * Races with:          N/A
    146          * Invoked on:          answered calls explicitly received by the caller
     137         * Invoked on:          all answered calls
    147138         */
    148139        int (* answer_process)(call_t *);
  • kernel/generic/src/ipc/ipc.c

    r190976f r716185d  
    513513                irq_spinlock_unlock(&box->lock, true);
    514514
     515                if (lst == &box->calls) {
     516                        sysipc_ops_t *ops;
     517
     518                        ops = sysipc_ops_get(call->request_method);
     519                        if (ops->request_process)
     520                                (void) ops->request_process(call, box);
     521                }
     522
    515523                ipc_data_t old = call->data;
    516524                IPC_SET_RETVAL(call->data, EHANGUP);
     
    753761       
    754762        /* Answer all messages in 'calls' and 'dispatched_calls' queues */
     763        ipc_cleanup_call_list(&TASK->answerbox, &TASK->answerbox.calls);
    755764        ipc_cleanup_call_list(&TASK->answerbox,
    756765            &TASK->answerbox.dispatched_calls);
    757         ipc_cleanup_call_list(&TASK->answerbox, &TASK->answerbox.calls);
    758766
    759767        ipc_forget_all_active_calls();
  • kernel/generic/src/ipc/kbox.c

    r190976f r716185d  
    9696       
    9797        /* Answer all messages in 'calls' and 'dispatched_calls' queues. */
     98        ipc_cleanup_call_list(&TASK->kb.box, &TASK->kb.box.calls);
    9899        ipc_cleanup_call_list(&TASK->kb.box, &TASK->kb.box.dispatched_calls);
    99         ipc_cleanup_call_list(&TASK->kb.box, &TASK->kb.box.calls);
    100100}
    101101
  • kernel/generic/src/ipc/ops/concttome.c

    r190976f r716185d  
    3939#include <abi/errno.h>
    4040#include <arch.h>
    41 
    42 static int request_preprocess(call_t *call, phone_t *phone)
    43 {
    44         /* Start with the assumption that there is no allocated phoneid. */
    45         IPC_SET_ARG5(call->data, -1);
    46         return EOK;
    47 }
    4841
    4942static int request_process(call_t *call, answerbox_t *box)
     
    9184
    9285sysipc_ops_t ipc_m_connect_to_me_ops = {
    93         .request_preprocess = request_preprocess,
     86        .request_preprocess = null_request_preprocess,
    9487        .request_forget = null_request_forget,
    9588        .request_process = request_process,
Note: See TracChangeset for help on using the changeset viewer.