Changeset 984a9ba in mainline for uspace/drv/char/ns8250/ns8250.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/drv/char/ns8250/ns8250.c

    r76f566d r984a9ba  
    311311static errno_t ns8250_open(chardev_srvs_t *, chardev_srv_t *);
    312312static errno_t ns8250_close(chardev_srv_t *);
    313 static void ns8250_default_handler(chardev_srv_t *, cap_call_handle_t, ipc_call_t *);
     313static void ns8250_default_handler(chardev_srv_t *, ipc_call_t *);
    314314
    315315/** The character interface's callbacks. */
     
    322322};
    323323
    324 static void ns8250_char_conn(cap_call_handle_t, ipc_call_t *, void *);
     324static void ns8250_char_conn(ipc_call_t *, void *);
    325325
    326326static errno_t ns8250_dev_add(ddf_dev_t *dev);
     
    10671067 * Configure the parameters of the serial communication.
    10681068 */
    1069 static void ns8250_default_handler(chardev_srv_t *srv, cap_call_handle_t chandle,
    1070     ipc_call_t *call)
     1069static void ns8250_default_handler(chardev_srv_t *srv, ipc_call_t *call)
    10711070{
    10721071        ns8250_t *ns8250 = srv_ns8250(srv);
     
    10791078                ns8250_get_props(ns8250->dev, &baud_rate, &parity, &word_length,
    10801079                    &stop_bits);
    1081                 async_answer_4(chandle, EOK, baud_rate, parity, word_length,
     1080                async_answer_4(call, EOK, baud_rate, parity, word_length,
    10821081                    stop_bits);
    10831082                break;
     
    10901089                ret = ns8250_set_props(ns8250->dev, baud_rate, parity, word_length,
    10911090                    stop_bits);
    1092                 async_answer_0(chandle, ret);
     1091                async_answer_0(call, ret);
    10931092                break;
    10941093
    10951094        default:
    1096                 async_answer_0(chandle, ENOTSUP);
    1097         }
    1098 }
    1099 
    1100 void ns8250_char_conn(cap_call_handle_t icall_handle, ipc_call_t *icall, void *arg)
     1095                async_answer_0(call, ENOTSUP);
     1096        }
     1097}
     1098
     1099void ns8250_char_conn(ipc_call_t *icall, void *arg)
    11011100{
    11021101        ns8250_t *ns8250 = fun_ns8250((ddf_fun_t *)arg);
    11031102
    1104         chardev_conn(icall_handle, icall, &ns8250->cds);
     1103        chardev_conn(icall, &ns8250->cds);
    11051104}
    11061105
Note: See TracChangeset for help on using the changeset viewer.