Changeset 79872cd in mainline


Ignore:
Timestamp:
2008-08-27T21:01:22Z (16 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
69145dae
Parents:
ddb0df5
Message:

Synchronous IPC must be interruptible.

Location:
kernel/generic
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/errno.h

    rddb0df5 r79872cd  
    5757#define EBUSY           -14     /* Resource is busy */
    5858#define EOVERFLOW       -15     /* The result does not fit its size. */
     59#define EINTR           -16     /* Operation was interrupted. */
    5960
    6061#endif
  • kernel/generic/include/ipc/ipc.h

    rddb0df5 r79872cd  
    294294extern void ipc_answer(answerbox_t *, call_t *);
    295295extern int ipc_call(phone_t *, call_t *);
    296 extern void ipc_call_sync(phone_t *, call_t *);
     296extern int ipc_call_sync(phone_t *, call_t *);
    297297extern void ipc_phone_init(phone_t *);
    298298extern void ipc_phone_connect(phone_t *, answerbox_t *);
  • kernel/generic/src/ipc/ipc.c

    rddb0df5 r79872cd  
    172172 * @param phone         Destination kernel phone structure.
    173173 * @param request       Call structure with request.
    174  */
    175 void ipc_call_sync(phone_t *phone, call_t *request)
     174 *
     175 * @return              EOK on success or EINTR if the sleep was interrupted.
     176 */
     177int ipc_call_sync(phone_t *phone, call_t *request)
    176178{
    177179        answerbox_t sync_box;
     
    183185
    184186        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;
    186191}
    187192
  • kernel/generic/src/ipc/sysipc.c

    rddb0df5 r79872cd  
    443443
    444444        if (!(res = request_preprocess(&call))) {
    445                 ipc_call_sync(phone, &call);
     445                rc = ipc_call_sync(phone, &call);
     446                if (rc != EOK)
     447                        return rc;
    446448                process_answer(&call);
    447449        } else {
     
    481483
    482484        if (!(res = request_preprocess(&call))) {
    483                 ipc_call_sync(phone, &call);
     485                rc = ipc_call_sync(phone, &call);
     486                if (rc != EOK)
     487                        return rc;
    484488                process_answer(&call);
    485489        } else
Note: See TracChangeset for help on using the changeset viewer.