Changeset 984a9ba in mainline for uspace/srv/taskmon/taskmon.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/srv/taskmon/taskmon.c

    r76f566d r984a9ba  
    4949static bool write_core_files;
    5050
    51 static void corecfg_client_conn(cap_call_handle_t, ipc_call_t *, void *);
     51static void corecfg_client_conn(ipc_call_t *, void *);
    5252
    5353static void fault_event(ipc_call_t *call, void *arg)
     
    9494}
    9595
    96 static void corecfg_get_enable_srv(cap_call_handle_t icall_handle, ipc_call_t *icall)
     96static void corecfg_get_enable_srv(ipc_call_t *icall)
    9797{
    98         async_answer_1(icall_handle, EOK, write_core_files);
     98        async_answer_1(icall, EOK, write_core_files);
    9999}
    100100
    101 static void corecfg_set_enable_srv(cap_call_handle_t icall_handle, ipc_call_t *icall)
     101static void corecfg_set_enable_srv(ipc_call_t *icall)
    102102{
    103103        write_core_files = IPC_GET_ARG1(*icall);
    104         async_answer_0(icall_handle, EOK);
     104        async_answer_0(icall, EOK);
    105105}
    106106
    107 static void corecfg_client_conn(cap_call_handle_t icall_handle, ipc_call_t *icall, void *arg)
     107static void corecfg_client_conn(ipc_call_t *icall, void *arg)
    108108{
    109109        /* Accept the connection */
    110         async_answer_0(icall_handle, EOK);
     110        async_answer_0(icall, EOK);
    111111
    112112        while (true) {
    113113                ipc_call_t call;
    114                 cap_call_handle_t chandle = async_get_call(&call);
     114                async_get_call(&call);
    115115                sysarg_t method = IPC_GET_IMETHOD(call);
    116116
    117117                if (!method) {
    118118                        /* The other side has hung up */
    119                         async_answer_0(chandle, EOK);
     119                        async_answer_0(&call, EOK);
    120120                        return;
    121121                }
     
    123123                switch (method) {
    124124                case CORECFG_GET_ENABLE:
    125                         corecfg_get_enable_srv(chandle, &call);
     125                        corecfg_get_enable_srv(&call);
    126126                        break;
    127127                case CORECFG_SET_ENABLE:
    128                         corecfg_set_enable_srv(chandle, &call);
     128                        corecfg_set_enable_srv(&call);
    129129                        break;
     130                default:
     131                        async_answer_0(&call, ENOTSUP);
    130132                }
    131133        }
Note: See TracChangeset for help on using the changeset viewer.