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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/drv/generic/remote_battery_dev.c

    r76f566d r984a9ba  
    9090}
    9191
    92 static void remote_battery_status_get(ddf_fun_t *, void *, cap_call_handle_t,
    93     ipc_call_t *);
    94 static void remote_battery_charge_level_get(ddf_fun_t *, void *, cap_call_handle_t,
    95     ipc_call_t *);
     92static void remote_battery_status_get(ddf_fun_t *, void *, ipc_call_t *);
     93static void remote_battery_charge_level_get(ddf_fun_t *, void *, ipc_call_t *);
    9694
    9795/** Remote battery interface operations */
     
    114112/** Process the status_get() request from the remote client
    115113 *
    116  * @param fun    The function from which the battery status is read
    117  * @param ops    The local ops structure
     114 * @param fun The function from which the battery status is read
     115 * @param ops The local ops structure
     116 *
    118117 */
    119 static void
    120 remote_battery_status_get(ddf_fun_t *fun, void *ops, cap_call_handle_t chandle,
     118static void remote_battery_status_get(ddf_fun_t *fun, void *ops,
    121119    ipc_call_t *call)
    122120{
     
    124122
    125123        if (bops->battery_status_get == NULL) {
    126                 async_answer_0(chandle, ENOTSUP);
     124                async_answer_0(call, ENOTSUP);
    127125                return;
    128126        }
     
    132130
    133131        if (rc != EOK)
    134                 async_answer_0(chandle, rc);
     132                async_answer_0(call, rc);
    135133        else
    136                 async_answer_1(chandle, rc, batt_status);
     134                async_answer_1(call, rc, batt_status);
    137135}
    138136
    139137/** Process the battery_charge_level_get() request from the remote client
    140138 *
    141  * @param fun    The function from which the battery charge level is read
    142  * @param ops    The local ops structure
     139 * @param fun  The function from which the battery charge level is read
     140 * @param ops The local ops structure
    143141 *
    144142 */
    145 static void
    146 remote_battery_charge_level_get(ddf_fun_t *fun, void *ops, cap_call_handle_t chandle,
     143static void remote_battery_charge_level_get(ddf_fun_t *fun, void *ops,
    147144    ipc_call_t *call)
    148145{
     
    150147
    151148        if (bops->battery_charge_level_get == NULL) {
    152                 async_answer_0(chandle, ENOTSUP);
     149                async_answer_0(call, ENOTSUP);
    153150                return;
    154151        }
     
    158155
    159156        if (rc != EOK)
    160                 async_answer_0(chandle, rc);
     157                async_answer_0(call, rc);
    161158        else
    162                 async_answer_1(chandle, rc, battery_level);
     159                async_answer_1(call, rc, battery_level);
    163160}
    164 
Note: See TracChangeset for help on using the changeset viewer.