Changeset 984a9ba in mainline for uspace/srv/hid/input


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.

Location:
uspace/srv/hid/input
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hid/input/ctl/kbdev.c

    r76f566d r984a9ba  
    5454static void kbdev_ctl_set_ind(kbd_dev_t *, unsigned int);
    5555
    56 static void kbdev_callback_conn(cap_call_handle_t, ipc_call_t *, void *arg);
     56static void kbdev_callback_conn(ipc_call_t *, void *arg);
    5757
    5858kbd_ctl_ops_t kbdev_ctl = {
     
    147147}
    148148
    149 static void kbdev_callback_conn(cap_call_handle_t icall_handle, ipc_call_t *icall, void *arg)
     149static void kbdev_callback_conn(ipc_call_t *icall, void *arg)
    150150{
    151151        kbdev_t *kbdev;
     
    158158        while (true) {
    159159                ipc_call_t call;
    160                 cap_call_handle_t chandle;
     160                async_get_call(&call);
    161161
    162                 chandle = async_get_call(&call);
    163162                if (!IPC_GET_IMETHOD(call)) {
    164163                        kbdev_destroy(kbdev);
     
    179178                }
    180179
    181                 async_answer_0(chandle, retval);
     180                async_answer_0(&call, retval);
    182181        }
    183182}
  • uspace/srv/hid/input/input.c

    r76f566d r984a9ba  
    320320
    321321/** New client connection */
    322 static void client_connection(cap_call_handle_t icall_handle, ipc_call_t *icall, void *arg)
     322static void client_connection(ipc_call_t *icall, void *arg)
    323323{
    324324        client_t *client = (client_t *) async_get_client_data();
    325325        if (client == NULL) {
    326                 async_answer_0(icall_handle, ENOMEM);
     326                async_answer_0(icall, ENOMEM);
    327327                return;
    328328        }
    329329
    330         async_answer_0(icall_handle, EOK);
     330        async_answer_0(icall, EOK);
    331331
    332332        while (true) {
    333333                ipc_call_t call;
    334                 cap_call_handle_t chandle = async_get_call(&call);
     334                async_get_call(&call);
    335335
    336336                if (!IPC_GET_IMETHOD(call)) {
     
    340340                        }
    341341
    342                         async_answer_0(chandle, EOK);
     342                        async_answer_0(&call, EOK);
    343343                        return;
    344344                }
     
    349349                        if (client->sess == NULL) {
    350350                                client->sess = sess;
    351                                 async_answer_0(chandle, EOK);
     351                                async_answer_0(&call, EOK);
    352352                        } else
    353                                 async_answer_0(chandle, ELIMIT);
     353                                async_answer_0(&call, ELIMIT);
    354354                } else {
    355355                        switch (IPC_GET_IMETHOD(call)) {
     
    357357                                active_client = client;
    358358                                client_arbitration();
    359                                 async_answer_0(chandle, EOK);
     359                                async_answer_0(&call, EOK);
    360360                                break;
    361361                        default:
    362                                 async_answer_0(chandle, EINVAL);
     362                                async_answer_0(&call, EINVAL);
    363363                        }
    364364                }
  • uspace/srv/hid/input/proto/mousedev.c

    r76f566d r984a9ba  
    7070}
    7171
    72 static void mousedev_callback_conn(cap_call_handle_t icall_handle, ipc_call_t *icall,
    73     void *arg)
     72static void mousedev_callback_conn(ipc_call_t *icall, void *arg)
    7473{
    7574        /* Mousedev device structure */
     
    7877        while (true) {
    7978                ipc_call_t call;
    80                 cap_call_handle_t chandle = async_get_call(&call);
     79                async_get_call(&call);
    8180
    8281                if (!IPC_GET_IMETHOD(call)) {
     
    110109                }
    111110
    112                 async_answer_0(chandle, retval);
     111                async_answer_0(&call, retval);
    113112        }
    114113}
Note: See TracChangeset for help on using the changeset viewer.