Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/include/async.h

    rae6021d rb4df8db  
    4545#include <atomic.h>
    4646#include <stdbool.h>
    47 #include <abi/proc/task.h>
    48 #include <abi/ddi/irq.h>
    49 #include <abi/ipc/event.h>
    50 #include <abi/ipc/interfaces.h>
     47#include <task.h>
    5148
    5249typedef ipc_callid_t aid_t;
    53 typedef sysarg_t port_id_t;
    5450
    5551typedef void *(*async_client_data_ctor_t)(void);
    5652typedef void (*async_client_data_dtor_t)(void *);
    5753
    58 /** Port connection handler
     54/** Client connection handler
    5955 *
    6056 * @param callid ID of incoming call or 0 if connection initiated from
    61  *               inside using async_create_callback_port()
     57 *               inside using async_connect_to_me()
    6258 * @param call   Incoming call or 0 if connection initiated from inside
    63  *               using async_create_callback_port()
    64  * @param arg    Local argument.
    65  *
    66  */
    67 typedef void (*async_port_handler_t)(ipc_callid_t, ipc_call_t *, void *);
    68 
    69 /** Notification handler */
    70 typedef void (*async_notification_handler_t)(ipc_callid_t, ipc_call_t *,
    71     void *);
     59 * @param arg    Local argument passed from async_new_connection() or
     60 *               async_connect_to_me()
     61 */
     62typedef void (*async_client_conn_t)(ipc_callid_t, ipc_call_t *, void *);
     63
     64/** Interrupt handler */
     65typedef void (*async_interrupt_handler_t)(ipc_callid_t, ipc_call_t *);
    7266
    7367/** Exchange management style
     
    8377        EXCHANGE_ATOMIC = 0,
    8478       
    85         /** Exchange management via mutual exclusion
    86          *
    87          * Suitable for any kind of client/server communication,
    88          * but can limit parallelism.
    89          *
    90          */
    91         EXCHANGE_SERIALIZE = 1,
    92        
    9379        /** Exchange management via phone cloning
    9480         *
     
    9884         *
    9985         */
    100         EXCHANGE_PARALLEL = 2
     86        EXCHANGE_PARALLEL,
     87       
     88        /** Exchange management via mutual exclusion
     89         *
     90         * Suitable for any kind of client/server communication,
     91         * but can limit parallelism.
     92         *
     93         */
     94        EXCHANGE_SERIALIZE
    10195} exch_mgmt_t;
    10296
     
    111105
    112106#define async_manager() \
    113         do { \
    114                 futex_down(&async_futex); \
    115                 fibril_switch(FIBRIL_FROM_DEAD); \
    116         } while (0)
     107        fibril_switch(FIBRIL_TO_MANAGER)
    117108
    118109#define async_get_call(data) \
     
    150141extern void async_forget(aid_t);
    151142
     143extern fid_t async_new_connection(task_id_t, sysarg_t, ipc_callid_t,
     144    ipc_call_t *, async_client_conn_t, void *);
     145
    152146extern void async_usleep(suseconds_t);
    153147extern void async_create_manager(void);
     
    160154extern void async_put_client_data_by_id(task_id_t);
    161155
    162 extern int async_create_port(iface_t, async_port_handler_t, void *,
    163     port_id_t *);
    164 extern void async_set_fallback_port_handler(async_port_handler_t, void *);
    165 extern int async_create_callback_port(async_exch_t *, iface_t, sysarg_t,
    166     sysarg_t, async_port_handler_t, void *, port_id_t *);
    167 
    168 extern int async_irq_subscribe(int, int, async_notification_handler_t, void *,
    169     const irq_code_t *);
    170 extern int async_irq_unsubscribe(int, int);
    171 
    172 extern int async_event_subscribe(event_type_t, async_notification_handler_t,
    173     void *);
    174 extern int async_event_task_subscribe(event_task_type_t,
    175     async_notification_handler_t, void *);
    176 extern int async_event_unsubscribe(event_type_t);
    177 extern int async_event_task_unsubscribe(event_task_type_t);
    178 extern int async_event_unmask(event_type_t);
    179 extern int async_event_task_unmask(event_task_type_t);
     156extern void async_set_client_connection(async_client_conn_t);
     157extern void async_set_interrupt_received(async_interrupt_handler_t);
     158extern void async_set_interrupt_handler_stack_size(size_t);
    180159
    181160/*
     
    346325extern async_sess_t *async_connect_me_to(exch_mgmt_t, async_exch_t *, sysarg_t,
    347326    sysarg_t, sysarg_t);
    348 extern async_sess_t *async_connect_me_to_iface(async_exch_t *, iface_t,
    349     sysarg_t, sysarg_t);
    350327extern async_sess_t *async_connect_me_to_blocking(exch_mgmt_t, async_exch_t *,
    351328    sysarg_t, sysarg_t, sysarg_t);
    352 extern async_sess_t *async_connect_me_to_blocking_iface(async_exch_t *, iface_t,
    353     sysarg_t, sysarg_t);
    354329extern async_sess_t *async_connect_kbox(task_id_t);
    355330
    356 extern int async_connect_to_me(async_exch_t *, sysarg_t, sysarg_t, sysarg_t);
     331extern int async_connect_to_me(async_exch_t *, sysarg_t, sysarg_t, sysarg_t,
     332    async_client_conn_t, void *);
    357333
    358334extern int async_hangup(async_sess_t *);
     
    423399extern int async_data_read_start(async_exch_t *, void *, size_t);
    424400extern bool async_data_read_receive(ipc_callid_t *, size_t *);
    425 extern bool async_data_read_receive_call(ipc_callid_t *, ipc_call_t *, size_t *);
    426401extern int async_data_read_finalize(ipc_callid_t, const void *, size_t);
    427402
     
    462437extern int async_data_write_start(async_exch_t *, const void *, size_t);
    463438extern bool async_data_write_receive(ipc_callid_t *, size_t *);
    464 extern bool async_data_write_receive_call(ipc_callid_t *, ipc_call_t *, size_t *);
    465439extern int async_data_write_finalize(ipc_callid_t, void *, size_t);
    466440
     
    488462extern void async_remote_state_release_exchange(async_exch_t *);
    489463
    490 extern void *async_as_area_create(void *, size_t, unsigned int, async_sess_t *,
    491     sysarg_t, sysarg_t, sysarg_t);
    492 
    493464#endif
    494465
Note: See TracChangeset for help on using the changeset viewer.