Changeset 984a9ba in mainline for uspace/lib/usbvirt/src/device.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/lib/usbvirt/src/device.c

    r76f566d r984a9ba  
    5050/** Main IPC call handling from virtual host controller.
    5151 *
    52  * @param iid   Caller identification
    5352 * @param icall Initial incoming call
    5453 * @param arg   Local argument
     54 *
    5555 */
    56 static void callback_connection(cap_call_handle_t icall_handle, ipc_call_t *icall, void *arg)
     56static void callback_connection(ipc_call_t *icall, void *arg)
    5757{
    5858        assert(DEV != NULL);
    5959
    60         async_answer_0(icall_handle, EOK);
     60        async_answer_0(icall, EOK);
    6161
    6262        while (true) {
    63                 cap_call_handle_t chandle;
    6463                ipc_call_t call;
     64                async_get_call(&call);
    6565
    66                 chandle = async_get_call(&call);
    67                 bool processed = usbvirt_ipc_handle_call(DEV, chandle, &call);
     66                bool processed = usbvirt_ipc_handle_call(DEV, &call);
    6867                if (!processed) {
    6968                        if (!IPC_GET_IMETHOD(call)) {
    70                                 async_answer_0(chandle, EOK);
     69                                async_answer_0(&call, EOK);
    7170                                return;
    7271                        } else
    73                                 async_answer_0(chandle, EINVAL);
     72                                async_answer_0(&call, EINVAL);
    7473                }
    7574        }
Note: See TracChangeset for help on using the changeset viewer.