Ignore:
Timestamp:
2018-07-05T09:34:09Z (7 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
63d46341
Parents:
76f566d
Message:

do not expose the call capability handler from the async framework

Keep the call capability handler encapsulated within the async framework
and do not expose it explicitly via its API. Use the pointer to
ipc_call_t as the sole object identifying an IPC call in the code that
uses the async framework.

This plugs a major leak in the abstraction and also simplifies both the
async framework (slightly) and all IPC servers.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/adb/cuda_adb/cuda_adb.c

    r76f566d r984a9ba  
    5555#define NAME  "cuda_adb"
    5656
    57 static void cuda_dev_connection(cap_call_handle_t, ipc_call_t *, void *);
     57static void cuda_dev_connection(ipc_call_t *, void *);
    5858static errno_t cuda_init(cuda_t *);
    5959static void cuda_irq_handler(ipc_call_t *, void *);
     
    198198
    199199/** Device connection handler */
    200 static void cuda_dev_connection(cap_call_handle_t icall_handle,
    201     ipc_call_t *icall, void *arg)
     200static void cuda_dev_connection(ipc_call_t *icall, void *arg)
    202201{
    203202        adb_dev_t *dev = (adb_dev_t *) ddf_fun_data_get((ddf_fun_t *) arg);
    204         cap_call_handle_t chandle;
    205203        ipc_call_t call;
    206204        sysarg_t method;
    207205
    208206        /* Answer the IPC_M_CONNECT_ME_TO call. */
    209         async_answer_0(icall_handle, EOK);
     207        async_answer_0(icall, EOK);
    210208
    211209        while (true) {
    212                 chandle = async_get_call(&call);
     210                async_get_call(&call);
    213211                method = IPC_GET_IMETHOD(call);
    214212
    215213                if (!method) {
    216214                        /* The other side has hung up. */
    217                         async_answer_0(chandle, EOK);
     215                        async_answer_0(&call, EOK);
    218216                        return;
    219217                }
     
    223221                if (sess != NULL) {
    224222                        dev->client_sess = sess;
    225                         async_answer_0(chandle, EOK);
     223                        async_answer_0(&call, EOK);
    226224                } else {
    227                         async_answer_0(chandle, EINVAL);
     225                        async_answer_0(&call, EINVAL);
    228226                }
    229227        }
Note: See TracChangeset for help on using the changeset viewer.