Changeset 8b243f2 in mainline for kernel/generic/src/ipc/ipcrsc.c
- Timestamp:
- 2007-06-17T19:34:36Z (18 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- bd72c3e9
- Parents:
- 4680ef5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/ipc/ipcrsc.c
r4680ef5 r8b243f2 133 133 #include <debug.h> 134 134 135 /** Find call_t * in call table according to callid 136 * 137 * TODO: Some speedup (hash table?) 138 * @return NULL on not found, otherwise pointer to call structure 139 */ 140 call_t * get_call(unative_t callid) 135 /** Find call_t * in call table according to callid. 136 * 137 * @todo Some speedup (hash table?) 138 * 139 * @param callid Userspace hash of the call. Currently it is the call 140 * structure kernel address. 141 * 142 * @return NULL on not found, otherwise pointer to the call 143 * structure. 144 */ 145 call_t *get_call(unative_t callid) 141 146 { 142 147 link_t *lst; … … 145 150 spinlock_lock(&TASK->answerbox.lock); 146 151 for (lst = TASK->answerbox.dispatched_calls.next; 147 152 lst != &TASK->answerbox.dispatched_calls; lst = lst->next) { 148 153 call = list_get_instance(lst, call_t, link); 149 if ((unative_t) call == callid) {154 if ((unative_t) call == callid) { 150 155 result = call; 151 156 break; … … 156 161 } 157 162 158 /** Allocate new phone slot in current TASK structure */ 163 /** Allocate new phone slot in the current TASK structure. 164 * 165 * @return New phone handle or -1 if the phone handle limit is 166 * exceeded. 167 */ 159 168 int phone_alloc(void) 160 169 { … … 163 172 spinlock_lock(&TASK->lock); 164 173 165 for (i =0; i < IPC_MAX_PHONES; i++) {166 if (TASK->phones[i].state == IPC_PHONE_HUNGUP && \174 for (i = 0; i < IPC_MAX_PHONES; i++) { 175 if (TASK->phones[i].state == IPC_PHONE_HUNGUP && 167 176 atomic_get(&TASK->phones[i].active_calls) == 0) 168 177 TASK->phones[i].state = IPC_PHONE_FREE; … … 180 189 } 181 190 191 /** Mark a phone structure free. 192 * 193 * @param phone Phone structure to be marked free. 194 */ 182 195 static void phone_deallocp(phone_t *phone) 183 196 { … … 188 201 } 189 202 190 /** Free slot from a disconnected phone 191 * 192 * All already sent messages will be correctly processed 203 /** Free slot from a disconnected phone. 204 * 205 * All already sent messages will be correctly processed. 206 * 207 * @param phoneid Phone handle of the phone to be freed. 193 208 */ 194 209 void phone_dealloc(int phoneid) … … 197 212 } 198 213 199 /** Connect phone to a given answerbox 200 * 201 * @param phoneid The slot that will be connected 214 /** Connect phone to a given answerbox. 215 * 216 * @param phoneid Phone handle to be connected. 217 * @param box Answerbox to which to connect the phone handle. 202 218 * 203 219 * The procedure _enforces_ that the user first marks the phone
Note:
See TracChangeset
for help on using the changeset viewer.