Changeset fbcfd458 in mainline
- Timestamp:
- 2006-03-18T23:02:08Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b4b45210
- Parents:
- ba81cab
- Location:
- generic
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
generic/include/ipc/ipc.h
rba81cab rfbcfd458 38 38 39 39 /* Flags for calls */ 40 #define IPC_CALL_ANSWERED 0x1 /**< This is answer to a call */ 41 #define IPC_CALL_STATIC_ALLOC 0x2 /**< This call will not be freed on error */ 42 #define IPC_CALL_DISPATCHED 0x4 /**< Call is in dispatch queue */ 40 #define IPC_CALL_ANSWERED (1<<0) /**< This is answer to a call */ 41 #define IPC_CALL_STATIC_ALLOC (1<<1) /**< This call will not be freed on error */ 42 #define IPC_CALL_DISPATCHED (1<<2) /**< Call is in dispatch queue */ 43 #define IPC_CALL_DISCARD_ANSWER (1<<3) /**< Answer will not be passed to 44 * userspace, will be discarded */ 43 45 44 46 /* Flags for ipc_wait_for_call */ 45 47 #define IPC_WAIT_NONBLOCKING 1 46 48 47 /* Flags of callid */ 48 #define IPC_CALLID_ANSWERED 1 49 /* Flags of callid (the addresses are aligned at least to 4, 50 * that is why we can use bottom 2 bits of the call address 51 */ 52 #define IPC_CALLID_ANSWERED 1 /**< Type of this msg is 'answer' */ 53 #define IPC_CALLID_NOTIFICATION 2 /**< Type of this msg is 'notification' */ 49 54 50 55 /* Return values from IPC_ASYNC */ … … 54 59 55 60 /* Macros for manipulating calling data */ 56 #define IPC_SET_RETVAL(data, retval) ((data) [0] = (retval))57 #define IPC_SET_METHOD(data, val) ((data) [0] = (val))58 #define IPC_SET_ARG1(data, val) ((data) [1] = (val))59 #define IPC_SET_ARG2(data, val) ((data) [2] = (val))60 #define IPC_SET_ARG3(data, val) ((data) [3] = (val))61 62 #define IPC_GET_METHOD(data) ((data) [0])63 #define IPC_GET_RETVAL(data) ((data) [0])64 65 #define IPC_GET_ARG1(data) ((data) [1])66 #define IPC_GET_ARG2(data) ((data) [2])67 #define IPC_GET_ARG3(data) ((data) [3])61 #define IPC_SET_RETVAL(data, retval) ((data).args[0] = (retval)) 62 #define IPC_SET_METHOD(data, val) ((data).args[0] = (val)) 63 #define IPC_SET_ARG1(data, val) ((data).args[1] = (val)) 64 #define IPC_SET_ARG2(data, val) ((data).args[2] = (val)) 65 #define IPC_SET_ARG3(data, val) ((data).args[3] = (val)) 66 67 #define IPC_GET_METHOD(data) ((data).args[0]) 68 #define IPC_GET_RETVAL(data) ((data).args[0]) 69 70 #define IPC_GET_ARG1(data) ((data).args[1]) 71 #define IPC_GET_ARG2(data) ((data).args[2]) 72 #define IPC_GET_ARG3(data) ((data).args[3]) 68 73 69 74 /* Well known phone descriptors */ … … 90 95 * - the caller obtains taskid of the called thread 91 96 */ 92 #define IPC_M_CONNECT TOME 197 #define IPC_M_CONNECT_TO_ME 1 93 98 /** Protocol for CONNECT - ME - TO 94 99 * … … 109 114 * 110 115 */ 111 #define IPC_M_CONNECTMETO 2 112 /* Control messages that the server sends to the processes 113 * about their connections. 114 */ 116 #define IPC_M_CONNECT_ME_TO 2 117 /** This message is sent to answerbox when the phone 118 * is hung up 119 */ 120 #define IPC_M_PHONE_HUNGUP 3 115 121 116 122 … … 129 135 #define IPC_MAX_PHONES 16 130 136 131 typedef struct answerbox answerbox_t; 132 typedef __native ipc_data_t[IPC_CALL_LEN]; 133 137 typedef struct answerbox_s answerbox_t; 138 typedef struct phone_s phone_t; 134 139 typedef struct { 135 link_t list; 136 answerbox_t *callerbox; 137 int flags; 138 task_t *sender; 139 ipc_data_t data; 140 } call_t; 141 142 struct answerbox { 140 __native args[IPC_CALL_LEN]; 141 phone_t *phone; 142 }ipc_data_t; 143 144 struct answerbox_s { 143 145 SPINLOCK_DECLARE(lock); 144 146 … … 154 156 }; 155 157 156 typedef struct{158 struct phone_s { 157 159 SPINLOCK_DECLARE(lock); 158 160 link_t list; 159 161 answerbox_t *callee; 160 162 int busy; 161 } phone_t; 163 atomic_t active_calls; 164 }; 165 166 typedef struct { 167 link_t list; 168 169 int flags; 170 171 /* Identification of the caller */ 172 task_t *sender; 173 /* The caller box is different from sender->answerbox 174 * for synchronous calls 175 */ 176 answerbox_t *callerbox; 177 178 ipc_data_t data; 179 }call_t; 162 180 163 181 extern void ipc_init(void); … … 166 184 extern void ipc_call(phone_t *phone, call_t *request); 167 185 extern void ipc_call_sync(phone_t *phone, call_t *request); 168 extern void ipc_phone_destroy(phone_t *phone);169 186 extern void ipc_phone_init(phone_t *phone); 170 187 extern void ipc_phone_connect(phone_t *phone, answerbox_t *box); … … 178 195 extern answerbox_t *ipc_phone_0; 179 196 extern void ipc_cleanup(task_t *task); 197 extern int ipc_phone_hangup(phone_t *phone); 180 198 181 199 #endif -
generic/include/ipc/ipcrsc.h
rba81cab rfbcfd458 32 32 call_t * get_call(__native callid); 33 33 int phone_alloc(void); 34 void phone_connect(int phoneid, answerbox_t *box); 34 35 void phone_dealloc(int phoneid); 35 void phone_connect(int phoneid, answerbox_t *box);36 37 36 38 37 #endif -
generic/include/ipc/sysipc.h
rba81cab rfbcfd458 31 31 32 32 __native sys_ipc_call_sync_fast(__native phoneid, __native method, 33 __native arg1, __native*data);34 __native sys_ipc_call_sync(__native phoneid, __native*question,35 __native*reply);33 __native arg1, ipc_data_t *data); 34 __native sys_ipc_call_sync(__native phoneid, ipc_data_t *question, 35 ipc_data_t *reply); 36 36 __native sys_ipc_call_async_fast(__native phoneid, __native method, 37 37 __native arg1, __native arg2); 38 __native sys_ipc_call_async(__native phoneid, __native*data);38 __native sys_ipc_call_async(__native phoneid, ipc_data_t *data); 39 39 __native sys_ipc_answer_fast(__native callid, __native retval, 40 40 __native arg1, __native arg2); 41 __native sys_ipc_answer(__native callid, __native*data);41 __native sys_ipc_answer(__native callid, ipc_data_t *data); 42 42 __native sys_ipc_connect_to_me(__native phoneid, __native arg1, 43 43 __native arg2, task_id_t *taskid); … … 48 48 __native sys_ipc_forward_fast(__native callid, __native phoneid, 49 49 __native method, __native arg1); 50 __native sys_ipc_hangup(int phoneid); 50 51 51 52 -
generic/include/syscall/syscall.h
rba81cab rfbcfd458 46 46 SYS_IPC_CONNECT_TO_ME, 47 47 SYS_IPC_CONNECT_ME_TO, 48 SYS_IPC_HANGUP, 48 49 SYSCALL_END 49 50 } syscall_t; -
generic/src/ipc/ipc.c
rba81cab rfbcfd458 124 124 } 125 125 126 /** Disconnect phone from answerbox127 *128 * It is allowed to call disconnect on already disconnected phone\129 */130 void ipc_phone_destroy(phone_t *phone)131 {132 answerbox_t *box = phone->callee;133 134 ASSERT(box);135 136 spinlock_lock(&phone->lock);137 spinlock_lock(&box->lock);138 139 if (phone->callee) {140 list_remove(&phone->list);141 phone->callee = NULL;142 }143 144 spinlock_unlock(&box->lock);145 spinlock_unlock(&phone->lock);146 }147 148 126 /** Helper function to facilitate synchronous calls */ 149 127 void ipc_call_sync(phone_t *phone, call_t *request) … … 191 169 } 192 170 171 /* Unsafe unchecking ipc_call */ 172 static void _ipc_call(phone_t *phone, answerbox_t *box, call_t *call) 173 { 174 atomic_inc(&phone->active_calls); 175 call->data.phone = phone; 176 177 spinlock_lock(&box->lock); 178 list_append(&call->list, &box->calls); 179 spinlock_unlock(&box->lock); 180 waitq_wakeup(&box->wq, 0); 181 } 182 193 183 /** Send a asynchronous request using phone to answerbox 194 184 * … … 201 191 202 192 spinlock_lock(&phone->lock); 193 203 194 box = phone->callee; 204 195 if (!box) { 205 196 /* Trying to send over disconnected phone */ 197 spinlock_unlock(&phone->lock); 198 199 call->data.phone = phone; 206 200 IPC_SET_RETVAL(call->data, ENOENT); 207 201 _ipc_answer_free_call(call); 208 202 return; 209 203 } 210 211 spinlock_lock(&box->lock); 212 list_append(&call->list, &box->calls); 213 spinlock_unlock(&box->lock); 214 waitq_wakeup(&box->wq, 0); 204 _ipc_call(phone, box, call); 215 205 216 206 spinlock_unlock(&phone->lock); 207 } 208 209 /** Disconnect phone from answerbox 210 * 211 * It is allowed to call disconnect on already disconnected phone 212 * 213 * @return 0 - phone disconnected, -1 - the phone was already disconnected 214 */ 215 int ipc_phone_hangup(phone_t *phone) 216 { 217 answerbox_t *box; 218 call_t *call; 219 220 spinlock_lock(&phone->lock); 221 box = phone->callee; 222 if (!box) { 223 spinlock_unlock(&phone->lock); 224 return -1; 225 } 226 227 spinlock_lock(&box->lock); 228 list_remove(&phone->list); 229 phone->callee = NULL; 230 spinlock_unlock(&box->lock); 231 232 call = ipc_call_alloc(); 233 IPC_SET_METHOD(call->data, IPC_M_PHONE_HUNGUP); 234 call->flags |= IPC_CALL_DISCARD_ANSWER; 235 _ipc_call(phone, box, call); 236 237 phone->busy = 0; 238 239 spinlock_unlock(&phone->lock); 240 241 return 0; 217 242 } 218 243 … … 226 251 { 227 252 spinlock_lock(&oldbox->lock); 253 atomic_dec(&call->data.phone->active_calls); 228 254 list_remove(&call->list); 229 255 spinlock_unlock(&oldbox->lock); … … 242 268 call_t *request; 243 269 244 spinlock_lock(&box->lock); 245 while (1) { 246 if (!list_empty(&box->answers)) { 247 /* Handle asynchronous answers */ 248 request = list_get_instance(box->answers.next, call_t, list); 249 list_remove(&request->list); 250 } else if (!list_empty(&box->calls)) { 251 /* Handle requests */ 252 request = list_get_instance(box->calls.next, call_t, list); 253 list_remove(&request->list); 254 /* Append request to dispatch queue */ 255 list_append(&request->list, &box->dispatched_calls); 256 request->flags |= IPC_CALL_DISPATCHED; 257 } else { 258 if (!(flags & IPC_WAIT_NONBLOCKING)) { 259 /* Wait for event to appear */ 260 spinlock_unlock(&box->lock); 261 waitq_sleep(&box->wq); 262 spinlock_lock(&box->lock); 263 continue; 264 } 265 request = NULL; 266 } 267 break; 270 restart: 271 if (flags & IPC_WAIT_NONBLOCKING) { 272 if (waitq_sleep_timeout(&box->wq,0,1) == ESYNCH_WOULD_BLOCK) 273 return NULL; 274 } else 275 waitq_sleep(&box->wq); 276 277 spinlock_lock(&box->lock); 278 if (!list_empty(&box->answers)) { 279 /* Handle asynchronous answers */ 280 request = list_get_instance(box->answers.next, call_t, list); 281 list_remove(&request->list); 282 printf("%d %P\n", IPC_GET_METHOD(request->data), 283 request->data.phone); 284 atomic_dec(&request->data.phone->active_calls); 285 } else if (!list_empty(&box->calls)) { 286 /* Handle requests */ 287 request = list_get_instance(box->calls.next, call_t, list); 288 list_remove(&request->list); 289 /* Append request to dispatch queue */ 290 list_append(&request->list, &box->dispatched_calls); 291 request->flags |= IPC_CALL_DISPATCHED; 292 } else { 293 printf("WARNING: Spurious IPC wakeup.\n"); 294 spinlock_unlock(&box->lock); 295 goto restart; 268 296 } 269 297 spinlock_unlock(&box->lock); -
generic/src/ipc/ipcrsc.c
rba81cab rfbcfd458 37 37 * - find phone in slot and send a message using phone 38 38 * - answer message to phone 39 * - hangup phone (the caller has hung up) 40 * - hangup phone (the answerbox is exiting) 39 41 * 40 42 * Locking strategy … … 51 53 * and proper reply will be generated. 52 54 * 53 * - There may be objection that a race may occur when the syscall finds54 * an appropriate call and before executing ipc_send, the phone call might55 * be disconnected and connected elsewhere. As there is no easy solution,56 * the application will be notified by an 'PHONE_DISCONNECTED' message57 * and the phone will not be allocated before the application notifies58 * the kernel subsystem that it does not have any pending calls regarding59 * this phone call.60 *61 55 * Locking order 62 56 * 63 * There are 2 possibilities64 57 * - first phone, then answerbox 65 58 * + Easy locking on calls … … 68 61 * The only possibility is try_lock with restart of list traversal. 69 62 * 70 * - first answerbox, then phone(s) 71 * + Easy phone disconnect 72 * - Multiple checks needed when sending message 63 * Destroying is less frequent, this approach is taken. 73 64 * 74 * Because the answerbox destroyal is much less frequent operation, 75 * the first method is chosen. 65 * Phone hangup 66 * 67 * *** The caller hangs up (sys_ipc_hangup) *** 68 * - The phone is disconnected (no more messages can be sent over this phone), 69 * all in-progress messages are correctly handled. The anwerbox receives 70 * IPC_M_PHONE_HUNGUP call from the phone that hung up. When all async 71 * calls are answered, the phone is deallocated. 72 * 73 * *** The answerbox hangs up (ipc_answer(ESLAM)) 74 * - The phone is disconnected. IPC_M_ANSWERBOX_HUNGUP notification 75 * is sent to source task, the calling process is expected to 76 * send an sys_ipc_hangup after cleaning up it's internal structures. 76 77 * 77 78 * Cleanup strategy 78 79 * 79 * 1) Disconnect all phones. 80 * 1) Disconnect all our phones ('sys_ipc_hangup') 81 * 82 * 2) Disconnect all phones connected to answerbox. 80 83 * * Send message 'PHONE_DISCONNECTED' to the target application 81 84 * - Once all phones are disconnected, no further calls can arrive 82 85 * 83 * 2) Answer all messages in 'calls' and 'dispatched_calls' queues with86 * 3) Answer all messages in 'calls' and 'dispatched_calls' queues with 84 87 * appropriate error code. 85 88 * 86 * 3) Wait for all async answers to arrive 87 * Alternatively - we might try to invalidate all messages by setting some 88 * flag, that would dispose of the message once it is answered. This 89 * would need to link all calls in one big list, which we don't currently 90 * do. 91 * 89 * 4) Wait for all async answers to arrive 92 90 * 93 91 */ … … 119 117 120 118 for (i=0; i < IPC_MAX_PHONES; i++) { 121 if (!TASK->phones[i].busy ) {119 if (!TASK->phones[i].busy && !atomic_get(&TASK->phones[i].active_calls)) { 122 120 TASK->phones[i].busy = 1; 123 121 break; … … 131 129 } 132 130 133 /** Disconnect phone */ 131 /** Disconnect phone a free the slot 132 * 133 * All already sent messages will be correctly processed 134 */ 134 135 void phone_dealloc(int phoneid) 135 136 { … … 137 138 138 139 ASSERT(TASK->phones[phoneid].busy); 139 140 if (TASK->phones[phoneid].callee) 141 ipc_phone_destroy(&TASK->phones[phoneid]); 140 ASSERT(! TASK->phones[phoneid].callee); 142 141 143 142 TASK->phones[phoneid].busy = 0; -
generic/src/ipc/sysipc.c
rba81cab rfbcfd458 43 43 #include <proc/thread.h> 44 44 45 /* TODO: multi-threaded connect-to-me can cause race condition46 * on phone, add counter + thread_kill??47 *48 */49 50 45 #define GET_CHECK_PHONE(phone,phoneid,err) { \ 51 46 if (phoneid > IPC_MAX_PHONES) { err; } \ … … 53 48 } 54 49 50 #define STRUCT_TO_USPACE(dst,src) copy_to_uspace(dst,src,sizeof(*src)) 55 51 56 52 /** Return true if the method is a system method */ … … 69 65 static inline int is_forwardable(__native method) 70 66 { 67 if (method == IPC_M_PHONE_HUNGUP) 68 return 0; /* This message is meant only for the receiver */ 71 69 return 1; 72 70 } … … 82 80 static inline int answer_will_preprocess(call_t *call) 83 81 { 84 if (IPC_GET_METHOD(call->data) == IPC_M_CONNECT TOME)82 if (IPC_GET_METHOD(call->data) == IPC_M_CONNECT_TO_ME) 85 83 return 1; 86 if (IPC_GET_METHOD(call->data) == IPC_M_CONNECT METO)84 if (IPC_GET_METHOD(call->data) == IPC_M_CONNECT_ME_TO) 87 85 return 1; 88 86 return 0; … … 94 92 int phoneid; 95 93 96 if (IPC_GET_METHOD(*olddata) == IPC_M_CONNECT TOME) {94 if (IPC_GET_METHOD(*olddata) == IPC_M_CONNECT_TO_ME) { 97 95 phoneid = IPC_GET_ARG3(*olddata); 98 96 if (IPC_GET_RETVAL(answer->data)) { … … 103 101 phone_connect(phoneid,&answer->sender->answerbox); 104 102 } 105 } else if (IPC_GET_METHOD(*olddata) == IPC_M_CONNECT METO) {103 } else if (IPC_GET_METHOD(*olddata) == IPC_M_CONNECT_ME_TO) { 106 104 /* If the users accepted call, connect */ 107 105 if (!IPC_GET_RETVAL(answer->data)) { … … 131 129 int phoneid; 132 130 133 if (IPC_GET_METHOD(call->data) == IPC_M_CONNECT TOME) {131 if (IPC_GET_METHOD(call->data) == IPC_M_CONNECT_TO_ME) { 134 132 phoneid = phone_alloc(); 135 133 if (phoneid < 0) { /* Failed to allocate phone */ … … 149 147 */ 150 148 __native sys_ipc_call_sync_fast(__native phoneid, __native method, 151 __native arg1, __native*data)149 __native arg1, ipc_data_t *data) 152 150 { 153 151 call_t call; … … 165 163 ipc_call_sync(phone, &call); 166 164 167 copy_to_uspace(data, &call.data, sizeof(call.data));165 STRUCT_TO_USPACE(&data->args, &call.data.args); 168 166 169 167 return 0; … … 171 169 172 170 /** Synchronous IPC call allowing to send whole message */ 173 __native sys_ipc_call_sync(__native phoneid, __native*question,174 __native*reply)171 __native sys_ipc_call_sync(__native phoneid, ipc_data_t *question, 172 ipc_data_t *reply) 175 173 { 176 174 call_t call; … … 178 176 179 177 ipc_call_static_init(&call); 180 copy_from_uspace(&call.data , question, sizeof(call.data));178 copy_from_uspace(&call.data.args, &question->args, sizeof(call.data.args)); 181 179 182 180 if (is_system_method(IPC_GET_METHOD(call.data))) … … 187 185 ipc_call_sync(phone, &call); 188 186 189 copy_to_uspace(reply, &call.data, sizeof(call.data));187 STRUCT_TO_USPACE(&reply->args, &call.data.args); 190 188 191 189 return 0; … … 238 236 * @return The same as sys_ipc_call_async 239 237 */ 240 __native sys_ipc_call_async(__native phoneid, __native*data)238 __native sys_ipc_call_async(__native phoneid, ipc_data_t *data) 241 239 { 242 240 call_t *call; … … 249 247 250 248 call = ipc_call_alloc(); 251 copy_from_uspace(&call->data , data, sizeof(call->data));249 copy_from_uspace(&call->data.args, &data->args, sizeof(call->data.args)); 252 250 253 251 if (is_system_method(IPC_GET_METHOD(call->data))) { … … 335 333 336 334 /** Send IPC answer */ 337 inline __native sys_ipc_answer(__native callid, __native*data)335 __native sys_ipc_answer(__native callid, ipc_data_t *data) 338 336 { 339 337 call_t *call; … … 349 347 preprocess = 1; 350 348 } 351 copy_from_uspace(&call->data, data, sizeof(call->data)); 349 copy_from_uspace(&call->data.args, &data->args, 350 sizeof(call->data.args)); 352 351 353 352 if (preprocess) … … 370 369 371 370 ipc_call_static_init(&call); 372 IPC_SET_METHOD(call.data, IPC_M_CONNECT TOME);371 IPC_SET_METHOD(call.data, IPC_M_CONNECT_TO_ME); 373 372 IPC_SET_ARG1(call.data, arg1); 374 373 IPC_SET_ARG2(call.data, arg2); … … 379 378 380 379 if (!IPC_GET_RETVAL(call.data) && taskid) 381 copy_to_uspace(taskid, 382 &phone->callee->task->taskid, 383 sizeof(TASK->taskid)); 380 STRUCT_TO_USPACE(taskid, &phone->callee->task->taskid); 384 381 385 382 return IPC_GET_RETVAL(call.data); … … 404 401 405 402 ipc_call_static_init(&call); 406 IPC_SET_METHOD(call.data, IPC_M_CONNECT METO);403 IPC_SET_METHOD(call.data, IPC_M_CONNECT_ME_TO); 407 404 IPC_SET_ARG1(call.data, arg1); 408 405 IPC_SET_ARG2(call.data, arg2); … … 419 416 } 420 417 418 /** Hang up the phone 419 * 420 * 421 * 422 */ 423 __native sys_ipc_hangup(int phoneid) 424 { 425 phone_t *phone; 426 427 GET_CHECK_PHONE(phone, phoneid, return ENOENT); 428 429 if (ipc_phone_hangup(phone)) 430 return -1; 431 432 return 0; 433 } 434 421 435 /** Wait for incoming ipc call or answer 422 436 * 423 * Generic function - can serve either as inkernel or userspace call 424 * - inside kernel does probably unnecessary copying of data (TODO) 425 * 426 * @param result 427 * @param taskid 437 * @param calldata Pointer to buffer where the call/answer data is stored 438 * @param taskid On 'CONNECT_ME_TO' call it is filled with 'taskid' of 439 * the caller. 428 440 * @param flags 429 441 * @return Callid, if callid & 1, then the call is answer 430 442 */ 431 inline __native sys_ipc_wait_for_call(ipc_data_t *calldata, 432 task_id_t *taskid, 433 __native flags) 443 __native sys_ipc_wait_for_call(ipc_data_t *calldata, task_id_t *taskid, 444 __native flags) 434 445 435 446 { … … 443 454 goto restart; 444 455 445 copy_to_uspace(calldata, &call->data, sizeof(call->data)); 456 ASSERT(! (call->flags & IPC_CALL_STATIC_ALLOC)); 457 446 458 atomic_dec(&TASK->active_calls); 447 ASSERT(! (call->flags & IPC_CALL_STATIC_ALLOC)); 459 460 if (call->flags & IPC_CALL_DISCARD_ANSWER) { 461 ipc_call_free(call); 462 goto restart; 463 } 464 465 STRUCT_TO_USPACE(&calldata->args, &call->data.args); 448 466 ipc_call_free(call); 449 467 450 468 return ((__native)call) | IPC_CALLID_ANSWERED; 451 469 } 470 452 471 if (process_request(&TASK->answerbox, call)) 453 472 goto restart; 454 copy_to_uspace(calldata, &call->data, sizeof(call->data)); 455 copy_to_uspace(taskid, (void *)&TASK->taskid, sizeof(TASK->taskid)); 473 474 /* Include phone address('id') of the caller in the request */ 475 STRUCT_TO_USPACE(calldata, &call->data); 476 if (IPC_GET_METHOD(call->data) == IPC_M_CONNECT_ME_TO) 477 STRUCT_TO_USPACE(taskid, &TASK->taskid); 456 478 return (__native)call; 457 479 } 458 -
generic/src/proc/scheduler.c
rba81cab rfbcfd458 353 353 switch (THREAD->state) { 354 354 case Running: 355 THREAD->state = Ready;356 355 spinlock_unlock(&THREAD->lock); 357 356 thread_ready(THREAD); -
generic/src/proc/task.c
rba81cab rfbcfd458 160 160 t = list_get_instance(cur, task_t, tasks_link); 161 161 spinlock_lock(&t->lock); 162 printf("%s: address=%P, taskid=%Q ,as=%P, ActiveCalls: %d",162 printf("%s: address=%P, taskid=%Q\n\tas=%P, ActiveCalls: %d", 163 163 t->name, t, t->taskid, t->as, atomic_get(&t->active_calls)); 164 164 for (i=0; i < IPC_MAX_PHONES; i++) { -
generic/src/proc/thread.c
rba81cab rfbcfd458 184 184 spinlock_lock(&t->lock); 185 185 186 ASSERT(! (t->state == Ready)); 187 186 188 i = (t->priority < RQ_COUNT -1) ? ++t->priority : t->priority; 187 189 … … 416 418 for (cur=threads_head.next; cur!=&threads_head; cur=cur->next) { 417 419 t = list_get_instance(cur, thread_t, threads_link); 418 printf("%s: address=%P, tid=%d, state=%s ,task=%P, code=%P, stack=%P, cpu=",420 printf("%s: address=%P, tid=%d, state=%s\n\ttask=%P, code=%P, stack=%P, cpu=", 419 421 t->name, t, t->tid, thread_states[t->state], t->task, t->thread_code, t->kstack); 420 422 if (t->cpu) -
generic/src/syscall/syscall.c
rba81cab rfbcfd458 78 78 sys_ipc_wait_for_call, 79 79 sys_ipc_connect_to_me, 80 sys_ipc_connect_me_to 80 sys_ipc_connect_me_to, 81 sys_ipc_hangup 81 82 };
Note:
See TracChangeset
for help on using the changeset viewer.