Changeset bd5a663 in mainline
- Timestamp:
- 2006-05-17T14:03:44Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 59477e3
- Parents:
- bdb9ea8
- Location:
- generic
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
generic/include/ipc/ipc.h
rbdb9ea8 rbd5a663 45 45 #define IPC_CALL_CONN_ME_TO (1<<4) /* Identify connect_me_to */ 46 46 #define IPC_CALL_NOTIF (1<<5) /* Interrupt notification */ 47 48 /* Flags for ipc_wait_for_call */49 #define IPC_WAIT_NONBLOCKING 150 47 51 48 /* Flags of callid (the addresses are aligned at least to 4, … … 201 198 202 199 extern void ipc_init(void); 203 extern call_t * ipc_wait_for_call(answerbox_t *box, int flags);200 extern call_t * ipc_wait_for_call(answerbox_t *box, __u32 usec, int nonblocking); 204 201 extern void ipc_answer(answerbox_t *box, call_t *request); 205 202 extern int ipc_call(phone_t *phone, call_t *call); … … 217 214 extern void ipc_backsend_err(phone_t *phone, call_t *call, __native err); 218 215 219 220 216 extern answerbox_t *ipc_phone_0; 221 217 -
generic/include/ipc/sysipc.h
rbdb9ea8 rbd5a663 32 32 #include <ipc/ipc.h> 33 33 #include <ipc/irq.h> 34 #include <arch/types.h> 34 35 35 36 __native sys_ipc_call_sync_fast(__native phoneid, __native method, … … 43 44 __native arg1, __native arg2); 44 45 __native sys_ipc_answer(__native callid, ipc_data_t *data); 45 __native sys_ipc_wait_for_call(ipc_data_t *calldata, __ native flags);46 __native sys_ipc_wait_for_call(ipc_data_t *calldata, __u32 usec, int nonblocking); 46 47 __native sys_ipc_forward_fast(__native callid, __native phoneid, 47 48 __native method, __native arg1); -
generic/src/ipc/ipc.c
rbdb9ea8 rbd5a663 34 34 #include <synch/spinlock.h> 35 35 #include <synch/waitq.h> 36 #include <synch/synch.h> 36 37 #include <ipc/ipc.h> 37 38 #include <errno.h> … … 142 143 143 144 ipc_call(phone, request); 144 ipc_wait_for_call(&sync_box, 0);145 ipc_wait_for_call(&sync_box, SYNCH_NO_TIMEOUT, SYNCH_BLOCKING); 145 146 } 146 147 … … 302 303 /** Wait for phone call 303 304 * 305 * @param box Answerbox expecting the call. 306 * @param usec Timeout in microseconds. See documentation for waitq_sleep_timeout() for 307 * decription of its special meaning. 308 * @param nonblocking Blocking vs. non-blocking operation mode switch. See documentation 309 * for waitq_sleep_timeout() for description of its special meaning. 304 310 * @return Recived message address 305 311 * - to distinguish between call and answer, look at call->flags 306 312 */ 307 call_t * ipc_wait_for_call(answerbox_t *box, int flags)313 call_t * ipc_wait_for_call(answerbox_t *box, __u32 usec, int nonblocking) 308 314 { 309 315 call_t *request; 310 316 ipl_t ipl; 311 312 restart: 313 if (flags & IPC_WAIT_NONBLOCKING) { 314 if (waitq_sleep_timeout(&box->wq,0,1) == ESYNCH_WOULD_BLOCK) 315 return NULL; 316 } else 317 waitq_sleep(&box->wq); 317 int rc; 318 319 restart: 320 rc = waitq_sleep_timeout(&box->wq, usec, nonblocking); 321 if (SYNCH_FAILED(rc)) 322 return NULL; 318 323 319 324 spinlock_lock(&box->lock); … … 408 413 /* Wait for all async answers to arrive */ 409 414 while (atomic_get(&task->active_calls)) { 410 call = ipc_wait_for_call(&task->answerbox, 0);415 call = ipc_wait_for_call(&task->answerbox, SYNCH_NO_TIMEOUT, SYNCH_BLOCKING); 411 416 ASSERT((call->flags & IPC_CALL_ANSWERED) || (call->flags & IPC_CALL_NOTIF)); 412 417 ASSERT(! (call->flags & IPC_CALL_STATIC_ALLOC)); -
generic/src/ipc/sysipc.c
rbdb9ea8 rbd5a663 469 469 * 470 470 * @param calldata Pointer to buffer where the call/answer data is stored 471 * @param flags 471 * @param usec Timeout. See waitq_sleep_timeout() for explanation. 472 * @param nonblocking See waitq_sleep_timeout() for explanation. 473 * 472 474 * @return Callid, if callid & 1, then the call is answer 473 475 */ 474 __native sys_ipc_wait_for_call(ipc_data_t *calldata, __ native flags)476 __native sys_ipc_wait_for_call(ipc_data_t *calldata, __u32 usec, int nonblocking) 475 477 { 476 478 call_t *call; 477 479 478 480 restart: 479 call = ipc_wait_for_call(&TASK->answerbox, flags);481 call = ipc_wait_for_call(&TASK->answerbox, usec, nonblocking); 480 482 if (!call) 481 483 return 0;
Note:
See TracChangeset
for help on using the changeset viewer.