Changeset 9934f7d in mainline for uspace/lib/c/generic
- Timestamp:
- 2011-06-13T19:53:48Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a07a454
- Parents:
- 43ac0cc
- Location:
- uspace/lib/c/generic
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/async.c
r43ac0cc r9934f7d 166 166 /** Call data of the opening call. */ 167 167 ipc_call_t call; 168 /** Local argument or NULL if none. */ 169 void *carg; 168 170 169 171 /** Identification of the closing call. */ … … 171 173 172 174 /** Fibril function that will be used to handle the connection. */ 173 void (*cfibril)(ipc_callid_t, ipc_call_t *);175 async_client_conn_t cfibril; 174 176 } connection_t; 175 177 … … 211 213 * This function is defined as a weak symbol - to be redefined in user code. 212 214 * 213 * @param callid Hash of the incoming call. 214 * @param call Data of the incoming call. 215 * 216 */ 217 static void default_client_connection(ipc_callid_t callid, ipc_call_t *call) 215 * @param callid Hash of the incoming call. 216 * @param call Data of the incoming call. 217 * @param arg Local argument 218 * 219 */ 220 static void default_client_connection(ipc_callid_t callid, ipc_call_t *call, 221 void *arg) 218 222 { 219 223 ipc_answer_0(callid, ENOENT); … … 224 228 * This function is defined as a weak symbol - to be redefined in user code. 225 229 * 226 * @param callid Hash of the incoming call. 227 * @param call Data of the incoming call. 230 * @param callid Hash of the incoming call. 231 * @param call Data of the incoming call. 232 * @param arg Local argument. 228 233 * 229 234 */ … … 233 238 234 239 static async_client_conn_t client_connection = default_client_connection; 235 static async_ client_conn_t interrupt_received = default_interrupt_received;240 static async_interrupt_handler_t interrupt_received = default_interrupt_received; 236 241 237 242 /** Setter for client_connection function pointer. … … 250 255 * notification fibril. 251 256 */ 252 void async_set_interrupt_received(async_ client_conn_t intr)257 void async_set_interrupt_received(async_interrupt_handler_t intr) 253 258 { 254 259 interrupt_received = intr; … … 633 638 */ 634 639 fibril_connection->cfibril(fibril_connection->callid, 635 &fibril_connection->call );640 &fibril_connection->call, fibril_connection->carg); 636 641 637 642 /* … … 704 709 * @param cfibril Fibril function that should be called upon opening the 705 710 * connection. 711 * @param carg Extra argument to pass to the connection fibril 706 712 * 707 713 * @return New fibril id or NULL on failure. … … 710 716 fid_t async_new_connection(sysarg_t in_task_hash, sysarg_t in_phone_hash, 711 717 ipc_callid_t callid, ipc_call_t *call, 712 async_client_conn_t cfibril )718 async_client_conn_t cfibril, void *carg) 713 719 { 714 720 connection_t *conn = malloc(sizeof(*conn)); … … 725 731 conn->callid = callid; 726 732 conn->close_callid = 0; 733 conn->carg = carg; 727 734 728 735 if (call) … … 779 786 /* Open new connection with fibril, etc. */ 780 787 async_new_connection(call->in_task_hash, IPC_GET_ARG5(*call), 781 callid, call, client_connection );788 callid, call, client_connection, NULL); 782 789 return; 783 790 } … … 1414 1421 */ 1415 1422 int async_connect_to_me(async_exch_t *exch, sysarg_t arg1, sysarg_t arg2, 1416 sysarg_t arg3, async_client_conn_t client_receiver )1423 sysarg_t arg3, async_client_conn_t client_receiver, void *carg) 1417 1424 { 1418 1425 if (exch == NULL) … … 1428 1435 if (client_receiver != NULL) 1429 1436 async_new_connection(task_hash, phone_hash, 0, NULL, 1430 client_receiver );1437 client_receiver, carg); 1431 1438 1432 1439 return EOK; -
uspace/lib/c/generic/async_obsolete.c
r43ac0cc r9934f7d 240 240 */ 241 241 int async_obsolete_connect_to_me(int phone, sysarg_t arg1, sysarg_t arg2, 242 sysarg_t arg3, async_client_conn_t client_receiver )242 sysarg_t arg3, async_client_conn_t client_receiver, void *carg) 243 243 { 244 244 sysarg_t task_hash; … … 251 251 if (client_receiver != NULL) 252 252 async_new_connection(task_hash, phone_hash, 0, NULL, 253 client_receiver );253 client_receiver, carg); 254 254 255 255 return EOK; -
uspace/lib/c/generic/devman.c
r43ac0cc r9934f7d 194 194 195 195 exch = devman_exchange_begin(DEVMAN_DRIVER); 196 async_connect_to_me(exch, 0, 0, 0, NULL );196 async_connect_to_me(exch, 0, 0, 0, NULL, NULL); 197 197 devman_exchange_end(exch); 198 198 -
uspace/lib/c/generic/devmap.c
r43ac0cc r9934f7d 187 187 188 188 exch = devmap_exchange_begin(DEVMAP_DRIVER); 189 async_connect_to_me(exch, 0, 0, 0, NULL );189 async_connect_to_me(exch, 0, 0, 0, NULL, NULL); 190 190 devmap_exchange_end(exch); 191 191 -
uspace/lib/c/generic/net/modules.c
r43ac0cc r9934f7d 141 141 if (phone >= 0) { 142 142 /* Request the bidirectional connection */ 143 int rc = async_obsolete_connect_to_me(phone, arg1, arg2, arg3, client_receiver); 143 int rc = async_obsolete_connect_to_me(phone, arg1, arg2, arg3, 144 client_receiver, NULL); 144 145 if (rc != EOK) { 145 146 async_obsolete_hangup(phone); -
uspace/lib/c/generic/net/socket_client.c
r43ac0cc r9934f7d 203 203 * @param[in] iid The initial message identifier. 204 204 * @param[in] icall The initial message call structure. 205 */ 206 static void socket_connection(ipc_callid_t iid, ipc_call_t * icall) 205 * @param[in] arg Local argument. 206 */ 207 static void socket_connection(ipc_callid_t iid, ipc_call_t * icall, void *arg) 207 208 { 208 209 ipc_callid_t callid; -
uspace/lib/c/generic/ns.c
r43ac0cc r9934f7d 42 42 { 43 43 async_exch_t *exch = async_exchange_begin(session_ns); 44 int rc = async_connect_to_me(exch, service, 0, 0, NULL );44 int rc = async_connect_to_me(exch, service, 0, 0, NULL, NULL); 45 45 async_exchange_end(exch); 46 46
Note:
See TracChangeset
for help on using the changeset viewer.