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/srv/hid/s3c24xx_ts/s3c24xx_ts.c

    r76f566d r984a9ba  
    6969static s3c24xx_ts_t *ts;
    7070
    71 static void s3c24xx_ts_connection(cap_call_handle_t icall_handle, ipc_call_t *icall,
    72     void *arg);
    73 static void s3c24xx_ts_irq_handler(ipc_call_t *call, void *);
    74 static void s3c24xx_ts_pen_down(s3c24xx_ts_t *ts);
    75 static void s3c24xx_ts_pen_up(s3c24xx_ts_t *ts);
    76 static void s3c24xx_ts_eoc(s3c24xx_ts_t *ts);
    77 static int s3c24xx_ts_init(s3c24xx_ts_t *ts);
    78 static void s3c24xx_ts_wait_for_int_mode(s3c24xx_ts_t *ts, ts_updn_t updn);
    79 static void s3c24xx_ts_convert_samples(int smp0, int smp1, int *x, int *y);
    80 static int lin_map_range(int v, int i0, int i1, int o0, int o1);
     71static void s3c24xx_ts_connection(ipc_call_t *, void *);
     72static void s3c24xx_ts_irq_handler(ipc_call_t *, void *);
     73static void s3c24xx_ts_pen_down(s3c24xx_ts_t *);
     74static void s3c24xx_ts_pen_up(s3c24xx_ts_t *);
     75static void s3c24xx_ts_eoc(s3c24xx_ts_t *);
     76static int s3c24xx_ts_init(s3c24xx_ts_t *);
     77static void s3c24xx_ts_wait_for_int_mode(s3c24xx_ts_t *, ts_updn_t);
     78static void s3c24xx_ts_convert_samples(int, int, int *, int *);
     79static int lin_map_range(int, int, int, int, int);
    8180
    8281int main(int argc, char *argv[])
     
    371370
    372371/** Handle mouse client connection. */
    373 static void s3c24xx_ts_connection(cap_call_handle_t icall_handle, ipc_call_t *icall,
    374     void *arg)
    375 {
    376         async_answer_0(icall_handle, EOK);
     372static void s3c24xx_ts_connection(ipc_call_t *icall, void *arg)
     373{
     374        async_answer_0(icall, EOK);
    377375
    378376        while (true) {
    379377                ipc_call_t call;
    380                 cap_call_handle_t chandle = async_get_call(&call);
     378                async_get_call(&call);
    381379
    382380                if (!IPC_GET_IMETHOD(call)) {
     
    386384                        }
    387385
    388                         async_answer_0(chandle, EOK);
     386                        async_answer_0(&call, EOK);
    389387                        return;
    390388                }
     
    395393                        if (ts->client_sess == NULL) {
    396394                                ts->client_sess = sess;
    397                                 async_answer_0(chandle, EOK);
     395                                async_answer_0(&call, EOK);
    398396                        } else
    399                                 async_answer_0(chandle, ELIMIT);
     397                                async_answer_0(&call, ELIMIT);
    400398                } else
    401                         async_answer_0(chandle, EINVAL);
     399                        async_answer_0(&call, EINVAL);
    402400        }
    403401}
Note: See TracChangeset for help on using the changeset viewer.