Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset a1026da in mainline


Ignore:
Timestamp:
2017-12-22T22:43:25Z (4 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master
Children:
1569a9b
Parents:
f04b5b3
git-author:
Jakub Jermar <jakub@…> (2017-12-22 21:47:09)
git-committer:
Jakub Jermar <jakub@…> (2017-12-22 22:43:25)
Message:

Introduce IPC_CALL_AUTO_REPLY call flag

Calls that never make it to userspace due to error are answered by the
kernel and decorated with the newly introduced IPC_CALL_AUTO_REPLY. This
gives the sender a way to reliably figure out that the recipient is
still waiting for the call.

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • abi/include/abi/ipc/ipc.h

    rf04b5b3 ra1026da  
    6060#define IPC_CALL_NOTIF           (1 << 3)
    6161
     62/** The call was automatically answered by the kernel due to error */
     63#define IPC_CALL_AUTO_REPLY      (1 << 4)
     64
    6265/**
    6366 * Maximum buffer size allowed for IPC_M_DATA_WRITE and
  • kernel/generic/src/ipc/sysipc.c

    rf04b5b3 ra1026da  
    761761
    762762        if (!call) {
    763                 ipc_data_t data = {0};
     763                ipc_data_t data = {};
    764764                data.cap_handle = CAP_NIL;
    765765                STRUCT_TO_USPACE(calldata, &data);
     
    767767        }
    768768       
     769        call->data.flags = call->flags;
    769770        if (call->flags & IPC_CALL_NOTIF) {
    770771                /* Set in_phone_hash to the interrupt counter */
    771772                call->data.phone = (void *) call->priv;
    772773               
    773                 call->data.flags = IPC_CALL_NOTIF;
    774774                call->data.cap_handle = CAP_NIL;
    775775
     
    788788                }
    789789
    790                 call->data.flags = IPC_CALL_ANSWERED;
    791790                call->data.cap_handle = CAP_NIL;
    792791               
     
    826825        /*
    827826         * The callee will not receive this call and no one else has a chance to
    828          * answer it. Reply with the EPARTY error code.
     827         * answer it. Set the IPC_CALL_AUTO_REPLY flag and return the EPARTY
     828         * error code.
    829829         */
    830830        ipc_data_t saved_data;
     
    839839        IPC_SET_RETVAL(call->data, EPARTY);
    840840        (void) answer_preprocess(call, saved ? &saved_data : NULL);
     841        call->flags |= IPC_CALL_AUTO_REPLY;
    841842        ipc_answer(&TASK->answerbox, call);
    842843
  • uspace/lib/c/generic/async.c

    rf04b5b3 ra1026da  
    14961496
    14971497                if (call.cap_handle == CAP_NIL) {
    1498                         if (call.flags == 0) {
    1499                                 /* This neither a notification nor an answer. */
     1498                        if ((call.flags &
     1499                            (IPC_CALL_NOTIF | IPC_CALL_ANSWERED)) == 0) {
     1500                                /* Neither a notification nor an answer. */
    15001501                                handle_expired_timeouts();
    15011502                                continue;
Note: See TracChangeset for help on using the changeset viewer.