Changes in uspace/lib/c/include/async.h [8869f7b:93ad49a8] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/include/async.h
r8869f7b r93ad49a8 42 42 #include <ipc/common.h> 43 43 #include <fibril.h> 44 #include <fibril_synch.h>45 44 #include <sys/time.h> 46 45 #include <atomic.h> … … 53 52 typedef void (*async_client_data_dtor_t)(void *); 54 53 55 typedef void (*async_client_conn_t)(ipc_callid_t, ipc_call_t *); 54 /** Client connection handler 55 * 56 * @param callid ID of incoming call or 0 if connection initiated from 57 * inside using async_connect_to_me() 58 * @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 *); 56 66 57 67 /** Exchange management style … … 85 95 } exch_mgmt_t; 86 96 87 /** Session data */ 88 typedef struct { 89 /** List of inactive exchanges */ 90 link_t exch_list; 91 92 /** Exchange management style */ 93 exch_mgmt_t mgmt; 94 95 /** Session identification */ 96 int phone; 97 98 /** First clone connection argument */ 99 sysarg_t arg1; 100 101 /** Second clone connection argument */ 102 sysarg_t arg2; 103 104 /** Third clone connection argument */ 105 sysarg_t arg3; 106 107 /** Exchange mutex */ 108 fibril_mutex_t mutex; 109 110 /** Number of opened exchanges */ 111 atomic_t refcnt; 112 } async_sess_t; 113 114 /** Exchange data */ 115 typedef struct { 116 /** Link into list of inactive exchanges */ 117 link_t sess_link; 118 119 /** Link into global list of inactive exchanges */ 120 link_t global_link; 121 122 /** Session pointer */ 123 async_sess_t *sess; 124 125 /** Exchange identification */ 126 int phone; 127 } async_exch_t; 97 /** Forward declarations */ 98 struct _async_exch; 99 struct _async_sess; 100 101 typedef struct _async_sess async_sess_t; 102 typedef struct _async_exch async_exch_t; 128 103 129 104 extern atomic_t threads_in_ipc_wait; … … 165 140 extern int async_wait_timeout(aid_t, sysarg_t *, suseconds_t); 166 141 167 extern fid_t async_new_connection( sysarg_t, sysarg_t, ipc_callid_t,168 ipc_call_t *, async_client_conn_t );142 extern fid_t async_new_connection(task_id_t, sysarg_t, ipc_callid_t, 143 ipc_call_t *, async_client_conn_t, void *); 169 144 170 145 extern void async_usleep(suseconds_t); … … 175 150 extern void async_set_client_data_destructor(async_client_data_dtor_t); 176 151 extern void *async_get_client_data(void); 152 extern void *async_get_client_data_by_id(task_id_t); 153 extern void async_put_client_data_by_id(task_id_t); 177 154 178 155 extern void async_set_client_connection(async_client_conn_t); 179 extern void async_set_interrupt_received(async_ client_conn_t);156 extern void async_set_interrupt_received(async_interrupt_handler_t); 180 157 181 158 /* … … 351 328 352 329 extern int async_connect_to_me(async_exch_t *, sysarg_t, sysarg_t, sysarg_t, 353 async_client_conn_t );330 async_client_conn_t, void *); 354 331 355 332 extern int async_hangup(async_sess_t *); … … 358 335 extern async_exch_t *async_exchange_begin(async_sess_t *); 359 336 extern void async_exchange_end(async_exch_t *); 337 338 /* 339 * FIXME These functions just work around problems with parallel exchange 340 * management. Proper solution needs to be implemented. 341 */ 342 void async_sess_args_set(async_sess_t *sess, sysarg_t, sysarg_t, sysarg_t); 360 343 361 344 /* … … 466 449 extern async_sess_t *async_callback_receive_start(exch_mgmt_t, ipc_call_t *); 467 450 451 extern int async_state_change_start(async_exch_t *, sysarg_t, sysarg_t, 452 sysarg_t, async_exch_t *); 453 extern bool async_state_change_receive(ipc_callid_t *, sysarg_t *, sysarg_t *, 454 sysarg_t *); 455 extern int async_state_change_finalize(ipc_callid_t, async_exch_t *); 456 457 extern void *async_remote_state_acquire(async_sess_t *); 458 extern void async_remote_state_update(async_sess_t *, void *); 459 extern void async_remote_state_release(async_sess_t *); 460 extern void async_remote_state_release_exchange(async_exch_t *); 461 468 462 #endif 469 463
Note:
See TracChangeset
for help on using the changeset viewer.