Changeset 984a9ba in mainline for uspace/drv/intctl/apic/apic.c


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/drv/intctl/apic/apic.c

    r76f566d r984a9ba  
    160160/** Handle one connection to APIC.
    161161 *
    162  * @param iid   Hash of the request that opened the connection.
    163162 * @param icall Call data of the request that opened the connection.
    164  * @param arg   Local argument.
    165  */
    166 static void apic_connection(cap_call_handle_t icall_handle, ipc_call_t *icall, void *arg)
    167 {
    168         cap_call_handle_t chandle;
     163 * @param arg   Local argument.
     164 *
     165 */
     166static void apic_connection(ipc_call_t *icall, void *arg)
     167{
    169168        ipc_call_t call;
    170169        apic_t *apic;
     
    173172         * Answer the first IPC_M_CONNECT_ME_TO call.
    174173         */
    175         async_answer_0(icall_handle, EOK);
    176 
    177         apic = (apic_t *)ddf_dev_data_get(ddf_fun_get_dev((ddf_fun_t *)arg));
     174        async_answer_0(icall, EOK);
     175
     176        apic = (apic_t *) ddf_dev_data_get(ddf_fun_get_dev((ddf_fun_t *) arg));
    178177
    179178        while (true) {
    180                 chandle = async_get_call(&call);
     179                async_get_call(&call);
    181180
    182181                if (!IPC_GET_IMETHOD(call)) {
    183182                        /* The other side has hung up. */
    184                         async_answer_0(chandle, EOK);
     183                        async_answer_0(&call, EOK);
    185184                        return;
    186185                }
     
    188187                switch (IPC_GET_IMETHOD(call)) {
    189188                case IRC_ENABLE_INTERRUPT:
    190                         async_answer_0(chandle, apic_enable_irq(apic,
     189                        async_answer_0(&call, apic_enable_irq(apic,
    191190                            IPC_GET_ARG1(call)));
    192191                        break;
    193192                case IRC_DISABLE_INTERRUPT:
    194193                        /* XXX TODO */
    195                         async_answer_0(chandle, EOK);
     194                        async_answer_0(&call, EOK);
    196195                        break;
    197196                case IRC_CLEAR_INTERRUPT:
    198197                        /* Noop */
    199                         async_answer_0(chandle, EOK);
     198                        async_answer_0(&call, EOK);
    200199                        break;
    201200                default:
    202                         async_answer_0(chandle, EINVAL);
     201                        async_answer_0(&call, EINVAL);
    203202                        break;
    204203                }
Note: See TracChangeset for help on using the changeset viewer.