Changeset d900699 in mainline for uspace/lib/c/generic/async.c


Ignore:
Timestamp:
2011-06-17T16:48:53Z (13 years ago)
Author:
Petr Koupy <petr.koupy@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f3a605be
Parents:
df8110d3 (diff), 98caf49 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/async.c

    rdf8110d3 rd900699  
    166166        /** Call data of the opening call. */
    167167        ipc_call_t call;
     168        /** Local argument or NULL if none. */
     169        void *carg;
    168170       
    169171        /** Identification of the closing call. */
     
    171173       
    172174        /** Fibril function that will be used to handle the connection. */
    173         void (*cfibril)(ipc_callid_t, ipc_call_t *);
     175        async_client_conn_t cfibril;
    174176} connection_t;
    175177
     
    211213 * This function is defined as a weak symbol - to be redefined in user code.
    212214 *
    213  * @param callid Hash of the incoming call.
    214  * @param call   Data of the incoming call.
    215  *
    216  */
    217 static void default_client_connection(ipc_callid_t callid, ipc_call_t *call)
     215 * @param callid        Hash of the incoming call.
     216 * @param call          Data of the incoming call.
     217 * @param arg           Local argument
     218 *
     219 */
     220static void default_client_connection(ipc_callid_t callid, ipc_call_t *call,
     221    void *arg)
    218222{
    219223        ipc_answer_0(callid, ENOENT);
     
    224228 * This function is defined as a weak symbol - to be redefined in user code.
    225229 *
    226  * @param callid Hash of the incoming call.
    227  * @param call   Data of the incoming call.
     230 * @param callid        Hash of the incoming call.
     231 * @param call          Data of the incoming call.
     232 * @param arg           Local argument.
    228233 *
    229234 */
     
    233238
    234239static async_client_conn_t client_connection = default_client_connection;
    235 static async_client_conn_t interrupt_received = default_interrupt_received;
     240static async_interrupt_handler_t interrupt_received = default_interrupt_received;
    236241
    237242/** Setter for client_connection function pointer.
     
    250255 *             notification fibril.
    251256 */
    252 void async_set_interrupt_received(async_client_conn_t intr)
     257void async_set_interrupt_received(async_interrupt_handler_t intr)
    253258{
    254259        interrupt_received = intr;
     
    633638         */
    634639        fibril_connection->cfibril(fibril_connection->callid,
    635             &fibril_connection->call);
     640            &fibril_connection->call, fibril_connection->carg);
    636641       
    637642        /*
     
    704709 * @param cfibril       Fibril function that should be called upon opening the
    705710 *                      connection.
     711 * @param carg          Extra argument to pass to the connection fibril
    706712 *
    707713 * @return New fibril id or NULL on failure.
     
    710716fid_t async_new_connection(sysarg_t in_task_hash, sysarg_t in_phone_hash,
    711717    ipc_callid_t callid, ipc_call_t *call,
    712     async_client_conn_t cfibril)
     718    async_client_conn_t cfibril, void *carg)
    713719{
    714720        connection_t *conn = malloc(sizeof(*conn));
     
    725731        conn->callid = callid;
    726732        conn->close_callid = 0;
     733        conn->carg = carg;
    727734       
    728735        if (call)
     
    779786                /* Open new connection with fibril, etc. */
    780787                async_new_connection(call->in_task_hash, IPC_GET_ARG5(*call),
    781                     callid, call, client_connection);
     788                    callid, call, client_connection, NULL);
    782789                return;
    783790        }
     
    14141421 */
    14151422int async_connect_to_me(async_exch_t *exch, sysarg_t arg1, sysarg_t arg2,
    1416     sysarg_t arg3, async_client_conn_t client_receiver)
     1423    sysarg_t arg3, async_client_conn_t client_receiver, void *carg)
    14171424{
    14181425        if (exch == NULL)
     
    14281435        if (client_receiver != NULL)
    14291436                async_new_connection(task_hash, phone_hash, 0, NULL,
    1430                     client_receiver);
     1437                    client_receiver, carg);
    14311438       
    14321439        return EOK;
     
    18081815        async_sess_t *sess = exch->sess;
    18091816       
     1817        atomic_dec(&sess->refcnt);
     1818       
    18101819        if (sess->mgmt == EXCHANGE_SERIALIZE)
    18111820                fibril_mutex_unlock(&sess->mutex);
Note: See TracChangeset for help on using the changeset viewer.