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

    r76f566d r984a9ba  
    8989/** Handle one connection to i8259.
    9090 *
    91  * @param iid   Hash of the request that opened the connection.
    9291 * @param icall Call data of the request that opened the connection.
    93  * @param arg   Local argument.
    94  */
    95 static void i8259_connection(cap_call_handle_t icall_handle, ipc_call_t *icall, void *arg)
    96 {
    97         cap_call_handle_t chandle;
     92 * @param arg   Local argument.
     93 *
     94 */
     95static void i8259_connection(ipc_call_t *icall, void *arg)
     96{
    9897        ipc_call_t call;
    9998        i8259_t *i8259 = NULL /* XXX */;
     
    102101         * Answer the first IPC_M_CONNECT_ME_TO call.
    103102         */
    104         async_answer_0(icall_handle, EOK);
    105 
    106         i8259 = (i8259_t *)ddf_dev_data_get(ddf_fun_get_dev((ddf_fun_t *)arg));
     103        async_answer_0(icall, EOK);
     104
     105        i8259 = (i8259_t *) ddf_dev_data_get(ddf_fun_get_dev((ddf_fun_t *) arg));
    107106
    108107        while (true) {
    109                 chandle = async_get_call(&call);
     108                async_get_call(&call);
    110109
    111110                if (!IPC_GET_IMETHOD(call)) {
    112111                        /* The other side has hung up. */
    113                         async_answer_0(chandle, EOK);
     112                        async_answer_0(&call, EOK);
    114113                        return;
    115114                }
     
    117116                switch (IPC_GET_IMETHOD(call)) {
    118117                case IRC_ENABLE_INTERRUPT:
    119                         async_answer_0(chandle, pic_enable_irq(i8259,
     118                        async_answer_0(&call, pic_enable_irq(i8259,
    120119                            IPC_GET_ARG1(call)));
    121120                        break;
    122121                case IRC_DISABLE_INTERRUPT:
    123122                        /* XXX TODO */
    124                         async_answer_0(chandle, EOK);
     123                        async_answer_0(&call, EOK);
    125124                        break;
    126125                case IRC_CLEAR_INTERRUPT:
    127126                        /* Noop */
    128                         async_answer_0(chandle, EOK);
     127                        async_answer_0(&call, EOK);
    129128                        break;
    130129                default:
    131                         async_answer_0(chandle, EINVAL);
     130                        async_answer_0(&call, EINVAL);
    132131                        break;
    133132                }
Note: See TracChangeset for help on using the changeset viewer.