Changeset 2c0e5d2 in mainline for kernel/generic/src/ipc/ipcrsc.c


Ignore:
Timestamp:
2009-05-19T21:47:00Z (15 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
27fd651
Parents:
0c2eee0
Message:

Add IPC_M_CONNECTION_CLONE and IPC_M_CONNECT_ME.

File:
1 edited

Legend:

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

    r0c2eee0 r2c0e5d2  
    161161}
    162162
    163 /** Allocate new phone slot in the current TASK structure.
     163/** Allocate new phone slot in the specified task.
     164 *
     165 * @param t             Task for which to allocate a new phone.
    164166 *
    165167 * @return              New phone handle or -1 if the phone handle limit is
    166168 *                      exceeded.
    167169 */
    168 int phone_alloc(void)
     170int phone_alloc(task_t *t)
    169171{
    170172        int i;
    171173
    172         spinlock_lock(&TASK->lock);
     174        spinlock_lock(&t->lock);
    173175        for (i = 0; i < IPC_MAX_PHONES; i++) {
    174                 if (TASK->phones[i].state == IPC_PHONE_HUNGUP &&
    175                     atomic_get(&TASK->phones[i].active_calls) == 0)
    176                         TASK->phones[i].state = IPC_PHONE_FREE;
    177 
    178                 if (TASK->phones[i].state == IPC_PHONE_FREE) {
    179                         TASK->phones[i].state = IPC_PHONE_CONNECTING;
     176                if (t->phones[i].state == IPC_PHONE_HUNGUP &&
     177                    atomic_get(&t->phones[i].active_calls) == 0)
     178                        t->phones[i].state = IPC_PHONE_FREE;
     179
     180                if (t->phones[i].state == IPC_PHONE_FREE) {
     181                        t->phones[i].state = IPC_PHONE_CONNECTING;
    180182                        break;
    181183                }
    182184        }
    183         spinlock_unlock(&TASK->lock);
     185        spinlock_unlock(&t->lock);
    184186
    185187        if (i == IPC_MAX_PHONES)
Note: See TracChangeset for help on using the changeset viewer.