Ignore:
Timestamp:
2012-08-24T22:27:44Z (12 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
20282ef3
Parents:
13dbaa8c
Message:

Add two new sysipc_ops_t members:

  • request_forget()
  • answer_cleanup()

Call these members to perform cleanup at appropriate times.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/ipc/ops/clnestab.c

    r13dbaa8c rb1e6269  
    4545}
    4646
     47static void answer_cleanup(call_t *answer, ipc_data_t *olddata)
     48{
     49        phone_t *phone = (phone_t *) IPC_GET_ARG5(*olddata);
     50
     51        mutex_lock(&phone->lock);
     52        if (phone->state == IPC_PHONE_CONNECTED) {
     53                irq_spinlock_lock(&phone->callee->lock, true);
     54                list_remove(&phone->link);
     55                phone->state = IPC_PHONE_SLAMMED;
     56                irq_spinlock_unlock(&phone->callee->lock, true);
     57        }
     58        mutex_unlock(&phone->lock);
     59}
     60
    4761static int answer_preprocess(call_t *answer, ipc_data_t *olddata)
    4862{
    49         phone_t *phone = (phone_t *) IPC_GET_ARG5(*olddata);
    5063
    5164        if (IPC_GET_RETVAL(answer->data) != EOK) {
     
    5568                 * connection without sending IPC_M_HUNGUP back.
    5669                 */
    57                 mutex_lock(&phone->lock);
    58                 if (phone->state == IPC_PHONE_CONNECTED) {
    59                         irq_spinlock_lock(&phone->callee->lock, true);
    60                         list_remove(&phone->link);
    61                         phone->state = IPC_PHONE_SLAMMED;
    62                         irq_spinlock_unlock(&phone->callee->lock, true);
    63                 }
    64                 mutex_unlock(&phone->lock);
     70                answer_cleanup(answer, olddata);
    6571        }
    6672       
     
    7076sysipc_ops_t ipc_m_clone_establish_ops = {
    7177        .request_preprocess = request_preprocess,
     78        .request_forget = null_request_forget,
    7279        .request_process = null_request_process,
     80        .answer_cleanup = answer_cleanup,
    7381        .answer_preprocess = answer_preprocess,
    7482        .answer_process = null_answer_process,
Note: See TracChangeset for help on using the changeset viewer.