Changeset 2c0e5d2 in mainline for kernel/generic/src/ipc/ipcrsc.c
- Timestamp:
- 2009-05-19T21:47:00Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 27fd651
- Parents:
- 0c2eee0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/ipc/ipcrsc.c
r0c2eee0 r2c0e5d2 161 161 } 162 162 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. 164 166 * 165 167 * @return New phone handle or -1 if the phone handle limit is 166 168 * exceeded. 167 169 */ 168 int phone_alloc( void)170 int phone_alloc(task_t *t) 169 171 { 170 172 int i; 171 173 172 spinlock_lock(& TASK->lock);174 spinlock_lock(&t->lock); 173 175 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; 180 182 break; 181 183 } 182 184 } 183 spinlock_unlock(& TASK->lock);185 spinlock_unlock(&t->lock); 184 186 185 187 if (i == IPC_MAX_PHONES)
Note:
See TracChangeset
for help on using the changeset viewer.