Changeset 984a9ba in mainline for uspace/drv/intctl/obio/obio.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/obio/obio.c

    r76f566d r984a9ba  
    6969/** Handle one connection to obio.
    7070 *
    71  * @param iid           Hash of the request that opened the connection.
    72  * @param icall         Call data of the request that opened the connection.
    73  * @param arg           Local argument.
     71 * @param icall Call data of the request that opened the connection.
     72 * @param arg   Local argument.
     73 *
    7474 */
    75 static void obio_connection(cap_call_handle_t icall_handle, ipc_call_t *icall, void *arg)
     75static void obio_connection(ipc_call_t *icall, void *arg)
    7676{
    77         cap_call_handle_t chandle;
    7877        ipc_call_t call;
    7978        obio_t *obio;
     
    8281         * Answer the first IPC_M_CONNECT_ME_TO call.
    8382         */
    84         async_answer_0(icall_handle, EOK);
     83        async_answer_0(icall, EOK);
    8584
    86         obio = (obio_t *)ddf_dev_data_get(ddf_fun_get_dev((ddf_fun_t *)arg));
     85        obio = (obio_t *) ddf_dev_data_get(ddf_fun_get_dev((ddf_fun_t *) arg));
    8786
    8887        while (true) {
    8988                int inr;
    9089
    91                 chandle = async_get_call(&call);
     90                async_get_call(&call);
     91
    9292                switch (IPC_GET_IMETHOD(call)) {
    9393                case IRC_ENABLE_INTERRUPT:
     
    9595                        pio_set_64(&obio->regs[OBIO_IMR(inr & INO_MASK)],
    9696                            1UL << 31, 0);
    97                         async_answer_0(chandle, EOK);
     97                        async_answer_0(&call, EOK);
    9898                        break;
    9999                case IRC_DISABLE_INTERRUPT:
    100100                        /* XXX TODO */
    101                         async_answer_0(chandle, EOK);
     101                        async_answer_0(&call, EOK);
    102102                        break;
    103103                case IRC_CLEAR_INTERRUPT:
    104104                        inr = IPC_GET_ARG1(call);
    105105                        pio_write_64(&obio->regs[OBIO_CIR(inr & INO_MASK)], 0);
    106                         async_answer_0(chandle, EOK);
     106                        async_answer_0(&call, EOK);
    107107                        break;
    108108                default:
    109                         async_answer_0(chandle, EINVAL);
     109                        async_answer_0(&call, EINVAL);
    110110                        break;
    111111                }
Note: See TracChangeset for help on using the changeset viewer.