Changeset 7c7aae16 in mainline for generic/src/ipc/ipcrsc.c


Ignore:
Timestamp:
2006-03-19T19:42:00Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ad64a2d
Parents:
9f22213
Message:

Reduced unnecessary IPC system calls.
Allow everything to be sync & async, everything is handled using messages.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • generic/src/ipc/ipcrsc.c

    r9f22213 r7c7aae16  
    6363 * Destroying is less frequent, this approach is taken.
    6464 *
     65 * Phone call
     66 *
     67 * *** Connect_me_to ***
     68 * The caller sends IPC_M_CONNECT_ME_TO to an answerbox. The server
     69 * receives 'phoneid' of the connecting phone as an ARG3. If it answers
     70 * with RETVAL=0, the phonecall is accepted, otherwise it is refused.
     71 *
     72 * *** Connect_to_me ***
     73 * The caller sends IPC_M_CONNECT_TO_ME, with special
     74 * The server receives an automatically
     75 * opened phoneid. If it accepts (RETVAL=0), it can use the phoneid
     76 * immediately.
     77 * Possible race condition can arise, when the client receives messages
     78 * from new connection before getting response for connect_to_me message.
     79 * Userspace should implement handshake protocol that would control it.
     80 *
    6581 * Phone hangup
    6682 *
     
    101117 *    appropriate error code (EHANGUP, EFORWARD).
    102118 *
    103  * 4) Wait for all async answers to arrive.
     119 * 4) Wait for all async answers to arrive and dispose of them.
    104120 *
    105121 */
     
    143159}
    144160
    145 /** Disconnect phone a free the slot
     161static void phone_deallocp(phone_t *phone)
     162{
     163        ASSERT(phone->busy == IPC_BUSY_CONNECTING);
     164        ASSERT(! phone->callee);
     165       
     166        /* atomic operation */
     167        phone->busy = IPC_BUSY_FREE;
     168}
     169
     170/** Free slot from a disconnected phone
    146171 *
    147172 * All already sent messages will be correctly processed
     
    149174void phone_dealloc(int phoneid)
    150175{
    151         spinlock_lock(&TASK->lock);
    152 
    153         ASSERT(TASK->phones[phoneid].busy == IPC_BUSY_CONNECTING);
    154         ASSERT(! TASK->phones[phoneid].callee);
    155 
    156         TASK->phones[phoneid].busy = IPC_BUSY_FREE;
    157         spinlock_unlock(&TASK->lock);
     176        phone_deallocp(&TASK->phones[phoneid]);
    158177}
    159178
Note: See TracChangeset for help on using the changeset viewer.