Rev 3363 | Rev 3394 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 3363 | Rev 3370 | ||
|---|---|---|---|
| Line 169... | Line 169... | ||
| 169 | 169 | ||
| 170 | /** Helper function to facilitate synchronous calls. |
170 | /** Helper function to facilitate synchronous calls. |
| 171 | * |
171 | * |
| 172 | * @param phone Destination kernel phone structure. |
172 | * @param phone Destination kernel phone structure. |
| 173 | * @param request Call structure with request. |
173 | * @param request Call structure with request. |
| - | 174 | * |
|
| - | 175 | * @return EOK on success or EINTR if the sleep was interrupted. |
|
| 174 | */ |
176 | */ |
| 175 | void ipc_call_sync(phone_t *phone, call_t *request) |
177 | int ipc_call_sync(phone_t *phone, call_t *request) |
| 176 | { |
178 | { |
| 177 | answerbox_t sync_box; |
179 | answerbox_t sync_box; |
| 178 | 180 | ||
| 179 | ipc_answerbox_init(&sync_box, TASK); |
181 | ipc_answerbox_init(&sync_box, TASK); |
| 180 | 182 | ||
| 181 | /* We will receive data in a special box. */ |
183 | /* We will receive data in a special box. */ |
| 182 | request->callerbox = &sync_box; |
184 | request->callerbox = &sync_box; |
| 183 | 185 | ||
| 184 | ipc_call(phone, request); |
186 | ipc_call(phone, request); |
| 185 | ipc_wait_for_call(&sync_box, SYNCH_NO_TIMEOUT, SYNCH_FLAGS_NONE); |
187 | if (!ipc_wait_for_call(&sync_box, SYNCH_NO_TIMEOUT, |
| - | 188 | SYNCH_FLAGS_INTERRUPTIBLE)) |
|
| - | 189 | return EINTR; |
|
| - | 190 | return EOK; |
|
| 186 | } |
191 | } |
| 187 | 192 | ||
| 188 | /** Answer a message which was not dispatched and is not listed in any queue. |
193 | /** Answer a message which was not dispatched and is not listed in any queue. |
| 189 | * |
194 | * |
| 190 | * @param call Call structure to be answered. |
195 | * @param call Call structure to be answered. |