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/lib/drv/generic/remote_pio_window.c

    r76f566d r984a9ba  
    4040#include "ddf/driver.h"
    4141
    42 static void remote_pio_window_get(ddf_fun_t *, void *, cap_call_handle_t,
    43     ipc_call_t *);
     42static void remote_pio_window_get(ddf_fun_t *, void *, ipc_call_t *);
    4443
    4544static const remote_iface_func_ptr_t remote_pio_window_iface_ops [] = {
     
    5352
    5453static void remote_pio_window_get(ddf_fun_t *fun, void *ops,
    55     cap_call_handle_t chandle, ipc_call_t *call)
     54    ipc_call_t *call)
    5655{
    5756        pio_window_ops_t *pio_win_ops = (pio_window_ops_t *) ops;
    58         size_t len;
    5957
    6058        if (!pio_win_ops->get_pio_window) {
    61                 async_answer_0(chandle, ENOTSUP);
     59                async_answer_0(call, ENOTSUP);
    6260                return;
    6361        }
     
    6563        pio_window_t *pio_window = pio_win_ops->get_pio_window(fun);
    6664        if (!pio_window) {
    67                 async_answer_0(chandle, ENOENT);
     65                async_answer_0(call, ENOENT);
    6866                return;
    6967        }
    7068
    71         async_answer_0(chandle, EOK);
     69        async_answer_0(call, EOK);
    7270
    73         if (!async_data_read_receive(&chandle, &len)) {
     71        ipc_call_t data;
     72        size_t len;
     73        if (!async_data_read_receive(&data, &len)) {
    7474                /* Protocol error - the recipient is not accepting data */
    7575                return;
    7676        }
    7777
    78         async_data_read_finalize(chandle, pio_window, len);
     78        async_data_read_finalize(&data, pio_window, len);
    7979}
    8080
Note: See TracChangeset for help on using the changeset viewer.