Changeset 503ffce in mainline


Ignore:
Timestamp:
2017-11-23T23:52:59Z (6 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f571ca49
Parents:
b1f36e3
Message:

Return IPC_CALLID_* in call data instead of callid

Callid will be replaced by capability handles soon so the API needs
to be cleanup up and any flags passed together with callid must be
passed using some other way.

Files:
6 edited

Legend:

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

    rb1f36e3 r503ffce  
    106106        /** Phone which made or last masqueraded this call. */
    107107        phone_t *phone;
     108        /** Flags */
     109        unsigned flags;
    108110        /** User-defined label */
    109111        sysarg_t label;
  • kernel/generic/src/ipc/sysipc.c

    rb1f36e3 r503ffce  
    728728 *
    729729 * @return Hash of the call.
    730  *         If IPC_CALLID_NOTIFICATION bit is set in the hash, the
    731  *         call is a notification. IPC_CALLID_ANSWERED denotes an
    732  *         answer.
    733  *
    734730 */
    735731sysarg_t sys_ipc_wait_for_call(ipc_data_t *calldata, uint32_t usec,
     
    758754                call->data.phone = (void *) call->priv;
    759755               
     756                call->data.flags = IPC_CALLID_NOTIFICATION;
     757
    760758                STRUCT_TO_USPACE(calldata, &call->data);
    761                
    762759                kobject_put(call->kobject);
    763760               
    764                 return ((sysarg_t) call) | IPC_CALLID_NOTIFICATION;
     761                return (sysarg_t) call;
    765762        }
    766763       
     
    772769                        goto restart;
    773770                }
     771
     772                call->data.flags = IPC_CALLID_ANSWERED;
    774773               
    775774                STRUCT_TO_USPACE(calldata, &call->data);
    776775                kobject_put(call->kobject);
    777776               
    778                 return ((sysarg_t) call) | IPC_CALLID_ANSWERED;
     777                return (sysarg_t) call;
    779778        }
    780779       
  • uspace/app/trace/ipcp.c

    rb1f36e3 r503ffce  
    323323        pending_call_t *pcall;
    324324       
    325         if ((hash & IPC_CALLID_ANSWERED) == 0 && hash != IPCP_CALLID_SYNC) {
     325        if ((call->flags & IPC_CALLID_ANSWERED) == 0 &&
     326            hash != IPCP_CALLID_SYNC) {
    326327                /* Not a response */
    327328                if ((display_mask & DM_IPC) != 0) {
     
    331332        }
    332333       
    333         hash = hash & ~IPC_CALLID_ANSWERED;
    334        
    335334        item = hash_table_find(&pending_calls, &hash);
    336335        if (item == NULL)
  • uspace/lib/c/generic/async.c

    rb1f36e3 r503ffce  
    13411341       
    13421342        /* Kernel notification */
    1343         if ((callid & IPC_CALLID_NOTIFICATION)) {
     1343        if (call->flags & IPC_CALLID_NOTIFICATION) {
    13441344                fibril_t *fibril = (fibril_t *) __tcb_get()->fibril_data;
    13451345                unsigned oldsw = fibril->switches;
     
    14951495                }
    14961496               
    1497                 if (callid & IPC_CALLID_ANSWERED)
     1497                if (call.flags & IPC_CALLID_ANSWERED)
    14981498                        continue;
    14991499               
  • uspace/lib/c/generic/ipc.c

    rb1f36e3 r503ffce  
    259259 * @param flags Flags passed to SYS_IPC_WAIT (blocking, nonblocking).
    260260 *
    261  * @return Hash of the call. Note that certain bits have special
    262  *         meaning: IPC_CALLID_ANSWERED is set in an answer
    263  *         and IPC_CALLID_NOTIFICATION is used for notifications.
    264  *
     261 * @return Hash of the call.
    265262 */
    266263ipc_callid_t ipc_wait_cycle(ipc_call_t *call, sysarg_t usec,
     
    271268       
    272269        /* Handle received answers */
    273         if (callid & IPC_CALLID_ANSWERED)
     270        if (callid && (call->flags & IPC_CALLID_ANSWERED))
    274271                handle_answer(callid, call);
    275272       
     
    301298        do {
    302299                callid = ipc_wait_cycle(call, usec, SYNCH_FLAGS_NONE);
    303         } while (callid & IPC_CALLID_ANSWERED);
     300        } while (callid && (call->flags & IPC_CALLID_ANSWERED));
    304301       
    305302        return callid;
     
    322319                callid = ipc_wait_cycle(call, SYNCH_NO_TIMEOUT,
    323320                    SYNCH_FLAGS_NON_BLOCKING);
    324         } while (callid & IPC_CALLID_ANSWERED);
     321        } while (callid && (call->flags & IPC_CALLID_ANSWERED));
    325322       
    326323        return callid;
  • uspace/lib/c/include/ipc/common.h

    rb1f36e3 r503ffce  
    4949        task_id_t in_task_id;
    5050        sysarg_t in_phone_hash;
     51        unsigned flags;
    5152        struct async_call *label;
    5253} ipc_call_t;
Note: See TracChangeset for help on using the changeset viewer.