Changes in uspace/lib/c/include/async.h [b4df8db:ae6021d] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/include/async.h
rb4df8db rae6021d 45 45 #include <atomic.h> 46 46 #include <stdbool.h> 47 #include <task.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> 48 51 49 52 typedef ipc_callid_t aid_t; 53 typedef sysarg_t port_id_t; 50 54 51 55 typedef void *(*async_client_data_ctor_t)(void); 52 56 typedef void (*async_client_data_dtor_t)(void *); 53 57 54 /** Client connection handler58 /** Port connection handler 55 59 * 56 60 * @param callid ID of incoming call or 0 if connection initiated from 57 * inside using async_c onnect_to_me()61 * inside using async_create_callback_port() 58 62 * @param call Incoming call or 0 if connection initiated from inside 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 *); 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 *); 66 72 67 73 /** Exchange management style … … 77 83 EXCHANGE_ATOMIC = 0, 78 84 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 79 93 /** Exchange management via phone cloning 80 94 * … … 84 98 * 85 99 */ 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 100 EXCHANGE_PARALLEL = 2 95 101 } exch_mgmt_t; 96 102 … … 105 111 106 112 #define async_manager() \ 107 fibril_switch(FIBRIL_TO_MANAGER) 113 do { \ 114 futex_down(&async_futex); \ 115 fibril_switch(FIBRIL_FROM_DEAD); \ 116 } while (0) 108 117 109 118 #define async_get_call(data) \ … … 141 150 extern void async_forget(aid_t); 142 151 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 146 152 extern void async_usleep(suseconds_t); 147 153 extern void async_create_manager(void); … … 154 160 extern void async_put_client_data_by_id(task_id_t); 155 161 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); 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); 159 180 160 181 /* … … 325 346 extern async_sess_t *async_connect_me_to(exch_mgmt_t, async_exch_t *, sysarg_t, 326 347 sysarg_t, sysarg_t); 348 extern async_sess_t *async_connect_me_to_iface(async_exch_t *, iface_t, 349 sysarg_t, sysarg_t); 327 350 extern async_sess_t *async_connect_me_to_blocking(exch_mgmt_t, async_exch_t *, 328 351 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); 329 354 extern async_sess_t *async_connect_kbox(task_id_t); 330 355 331 extern int async_connect_to_me(async_exch_t *, sysarg_t, sysarg_t, sysarg_t, 332 async_client_conn_t, void *); 356 extern int async_connect_to_me(async_exch_t *, sysarg_t, sysarg_t, sysarg_t); 333 357 334 358 extern int async_hangup(async_sess_t *); … … 399 423 extern int async_data_read_start(async_exch_t *, void *, size_t); 400 424 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 *); 401 426 extern int async_data_read_finalize(ipc_callid_t, const void *, size_t); 402 427 … … 437 462 extern int async_data_write_start(async_exch_t *, const void *, size_t); 438 463 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 *); 439 465 extern int async_data_write_finalize(ipc_callid_t, void *, size_t); 440 466 … … 462 488 extern void async_remote_state_release_exchange(async_exch_t *); 463 489 490 extern void *async_as_area_create(void *, size_t, unsigned int, async_sess_t *, 491 sysarg_t, sysarg_t, sysarg_t); 492 464 493 #endif 465 494
Note:
See TracChangeset
for help on using the changeset viewer.