Changeset 984a9ba in mainline for uspace/drv/intctl/icp-ic/icp-ic.c


Ignore:
Timestamp:
2018-07-05T09:34:09Z (6 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/intctl/icp-ic/icp-ic.c

    r76f566d r984a9ba  
    6565/** Client connection handler.
    6666 *
    67  * @param iid   Hash of the request that opened the connection.
    6867 * @param icall Call data of the request that opened the connection.
    69  * @param arg   Local argument.
     68 * @param arg   Local argument.
     69 *
    7070 */
    71 static void icpic_connection(cap_call_handle_t icall_handle, ipc_call_t *icall, void *arg)
     71static void icpic_connection(ipc_call_t *icall, void *arg)
    7272{
    73         cap_call_handle_t chandle;
    7473        ipc_call_t call;
    7574        icpic_t *icpic;
     
    7877         * Answer the first IPC_M_CONNECT_ME_TO call.
    7978         */
    80         async_answer_0(icall_handle, EOK);
     79        async_answer_0(icall, EOK);
    8180
    82         icpic = (icpic_t *)ddf_dev_data_get(ddf_fun_get_dev((ddf_fun_t *)arg));
     81        icpic = (icpic_t *) ddf_dev_data_get(ddf_fun_get_dev((ddf_fun_t *) arg));
    8382
    8483        while (true) {
    85                 chandle = async_get_call(&call);
     84                async_get_call(&call);
    8685
    8786                if (!IPC_GET_IMETHOD(call)) {
    8887                        /* The other side has hung up. */
    89                         async_answer_0(chandle, EOK);
     88                        async_answer_0(&call, EOK);
    9089                        return;
    9190                }
     
    9392                switch (IPC_GET_IMETHOD(call)) {
    9493                case IRC_ENABLE_INTERRUPT:
    95                         async_answer_0(chandle,
     94                        async_answer_0(&call,
    9695                            icpic_enable_irq(icpic, IPC_GET_ARG1(call)));
    9796                        break;
    9897                case IRC_DISABLE_INTERRUPT:
    9998                        /* XXX TODO */
    100                         async_answer_0(chandle, EOK);
     99                        async_answer_0(&call, EOK);
    101100                        break;
    102101                case IRC_CLEAR_INTERRUPT:
    103102                        /* Noop */
    104                         async_answer_0(chandle, EOK);
     103                        async_answer_0(&call, EOK);
    105104                        break;
    106105                default:
    107                         async_answer_0(chandle, EINVAL);
     106                        async_answer_0(&call, EINVAL);
    108107                        break;
    109108                }
Note: See TracChangeset for help on using the changeset viewer.