Changes in uspace/lib/c/include/async.h [ae6021d:b4df8db] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/include/async.h
rae6021d rb4df8db 45 45 #include <atomic.h> 46 46 #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> 51 48 52 49 typedef ipc_callid_t aid_t; 53 typedef sysarg_t port_id_t;54 50 55 51 typedef void *(*async_client_data_ctor_t)(void); 56 52 typedef void (*async_client_data_dtor_t)(void *); 57 53 58 /** Port connection handler54 /** Client connection handler 59 55 * 60 56 * @param callid ID of incoming call or 0 if connection initiated from 61 * inside using async_c reate_callback_port()57 * inside using async_connect_to_me() 62 58 * @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 */ 62 typedef void (*async_client_conn_t)(ipc_callid_t, ipc_call_t *, void *); 63 64 /** Interrupt handler */ 65 typedef void (*async_interrupt_handler_t)(ipc_callid_t, ipc_call_t *); 72 66 73 67 /** Exchange management style … … 83 77 EXCHANGE_ATOMIC = 0, 84 78 85 /** Exchange management via mutual exclusion86 *87 * Suitable for any kind of client/server communication,88 * but can limit parallelism.89 *90 */91 EXCHANGE_SERIALIZE = 1,92 93 79 /** Exchange management via phone cloning 94 80 * … … 98 84 * 99 85 */ 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 101 95 } exch_mgmt_t; 102 96 … … 111 105 112 106 #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) 117 108 118 109 #define async_get_call(data) \ … … 150 141 extern void async_forget(aid_t); 151 142 143 extern fid_t async_new_connection(task_id_t, sysarg_t, ipc_callid_t, 144 ipc_call_t *, async_client_conn_t, void *); 145 152 146 extern void async_usleep(suseconds_t); 153 147 extern void async_create_manager(void); … … 160 154 extern void async_put_client_data_by_id(task_id_t); 161 155 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); 156 extern void async_set_client_connection(async_client_conn_t); 157 extern void async_set_interrupt_received(async_interrupt_handler_t); 158 extern void async_set_interrupt_handler_stack_size(size_t); 180 159 181 160 /* … … 346 325 extern async_sess_t *async_connect_me_to(exch_mgmt_t, async_exch_t *, sysarg_t, 347 326 sysarg_t, sysarg_t); 348 extern async_sess_t *async_connect_me_to_iface(async_exch_t *, iface_t,349 sysarg_t, sysarg_t);350 327 extern async_sess_t *async_connect_me_to_blocking(exch_mgmt_t, async_exch_t *, 351 328 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);354 329 extern async_sess_t *async_connect_kbox(task_id_t); 355 330 356 extern int async_connect_to_me(async_exch_t *, sysarg_t, sysarg_t, sysarg_t); 331 extern int async_connect_to_me(async_exch_t *, sysarg_t, sysarg_t, sysarg_t, 332 async_client_conn_t, void *); 357 333 358 334 extern int async_hangup(async_sess_t *); … … 423 399 extern int async_data_read_start(async_exch_t *, void *, size_t); 424 400 extern 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 *);426 401 extern int async_data_read_finalize(ipc_callid_t, const void *, size_t); 427 402 … … 462 437 extern int async_data_write_start(async_exch_t *, const void *, size_t); 463 438 extern 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 *);465 439 extern int async_data_write_finalize(ipc_callid_t, void *, size_t); 466 440 … … 488 462 extern void async_remote_state_release_exchange(async_exch_t *); 489 463 490 extern void *async_as_area_create(void *, size_t, unsigned int, async_sess_t *,491 sysarg_t, sysarg_t, sysarg_t);492 493 464 #endif 494 465
Note:
See TracChangeset
for help on using the changeset viewer.