Changeset a46e56b in mainline for uspace/srv/ns
- Timestamp:
- 2018-03-22T06:49:35Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 77f0a1d
- Parents:
- 3e242d2
- git-author:
- Jakub Jermar <jakub@…> (2018-03-21 23:29:06)
- git-committer:
- Jakub Jermar <jakub@…> (2018-03-22 06:49:35)
- Location:
- uspace/srv/ns
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/ns/clonable.c
r3e242d2 ra46e56b 48 48 service_t service; 49 49 iface_t iface; 50 cap_call_handle_t c allid;50 cap_call_handle_t chandle; 51 51 sysarg_t arg3; 52 52 } cs_req_t; … … 75 75 */ 76 76 void register_clonable(service_t service, sysarg_t phone, ipc_call_t *call, 77 cap_call_handle_t c allid)77 cap_call_handle_t chandle) 78 78 { 79 79 link_t *req_link = list_first(&cs_req); … … 81 81 /* There was no pending connection request. */ 82 82 printf("%s: Unexpected clonable server.\n", NAME); 83 async_answer_0(c allid, EBUSY);83 async_answer_0(chandle, EBUSY); 84 84 return; 85 85 } … … 91 91 assert(csr->service == SERVICE_LOADER); 92 92 93 async_answer_0(c allid, EOK);93 async_answer_0(chandle, EOK); 94 94 95 95 async_sess_t *sess = async_callback_receive(EXCHANGE_SERIALIZE); 96 96 if (sess == NULL) 97 async_answer_0(c allid, EIO);97 async_answer_0(chandle, EIO); 98 98 99 99 async_exch_t *exch = async_exchange_begin(sess); 100 async_forward_fast(csr->c allid, exch, csr->iface, csr->arg3, 0,100 async_forward_fast(csr->chandle, exch, csr->iface, csr->arg3, 0, 101 101 IPC_FF_NONE); 102 102 async_exchange_end(exch); … … 111 111 * @param iface Interface to be connected to. 112 112 * @param call Pointer to call structure. 113 * @param c allidCall ID of the request.113 * @param chandle Call ID of the request. 114 114 * 115 115 * @return Zero on success or a value from @ref errno.h. … … 117 117 */ 118 118 void connect_to_clonable(service_t service, iface_t iface, ipc_call_t *call, 119 cap_call_handle_t c allid)119 cap_call_handle_t chandle) 120 120 { 121 121 assert(service == SERVICE_LOADER); … … 123 123 cs_req_t *csr = malloc(sizeof(cs_req_t)); 124 124 if (csr == NULL) { 125 async_answer_0(c allid, ENOMEM);125 async_answer_0(chandle, ENOMEM); 126 126 return; 127 127 } … … 132 132 if (rc != EOK) { 133 133 free(csr); 134 async_answer_0(c allid, rc);134 async_answer_0(chandle, rc); 135 135 return; 136 136 } … … 139 139 csr->service = service; 140 140 csr->iface = iface; 141 csr->c allid = callid;141 csr->chandle = chandle; 142 142 csr->arg3 = IPC_GET_ARG3(*call); 143 143 -
uspace/srv/ns/ns.c
r3e242d2 ra46e56b 49 49 #include "task.h" 50 50 51 static void ns_connection(cap_call_handle_t i id, ipc_call_t *icall, void *arg)51 static void ns_connection(cap_call_handle_t icall_handle, ipc_call_t *icall, void *arg) 52 52 { 53 53 ipc_call_t call; 54 cap_call_handle_t c allid;54 cap_call_handle_t chandle; 55 55 iface_t iface; 56 56 service_t service; … … 63 63 */ 64 64 if (service_clonable(service)) { 65 connect_to_clonable(service, iface, icall, i id);65 connect_to_clonable(service, iface, icall, icall_handle); 66 66 } else { 67 connect_to_service(service, iface, icall, i id);67 connect_to_service(service, iface, icall, icall_handle); 68 68 } 69 69 return; 70 70 } 71 71 72 async_answer_0(i id, EOK);72 async_answer_0(icall_handle, EOK); 73 73 74 74 while (true) { 75 75 process_pending_conn(); 76 76 77 c allid= async_get_call(&call);77 chandle = async_get_call(&call); 78 78 if (!IPC_GET_IMETHOD(call)) 79 79 break; … … 94 94 */ 95 95 if (service_clonable(service)) { 96 register_clonable(service, phone, &call, c allid);96 register_clonable(service, phone, &call, chandle); 97 97 continue; 98 98 } else { … … 107 107 id = (task_id_t) 108 108 MERGE_LOUP32(IPC_GET_ARG1(call), IPC_GET_ARG2(call)); 109 wait_for_task(id, &call, c allid);109 wait_for_task(id, &call, chandle); 110 110 continue; 111 111 case NS_ID_INTRO: … … 121 121 } 122 122 123 async_answer_0(c allid, retval);123 async_answer_0(chandle, retval); 124 124 } 125 125 -
uspace/srv/ns/service.c
r3e242d2 ra46e56b 87 87 typedef struct { 88 88 link_t link; 89 service_t service; /**< Service ID */90 iface_t iface; /**< Interface ID */91 cap_call_handle_t c allid; /**< Call IDwaiting for the connection */92 sysarg_t arg3; /**< Third argument */89 service_t service; /**< Service ID */ 90 iface_t iface; /**< Interface ID */ 91 cap_call_handle_t chandle; /**< Call handle waiting for the connection */ 92 sysarg_t arg3; /**< Third argument */ 93 93 } pending_conn_t; 94 94 … … 119 119 hashed_service_t *hashed_service = hash_table_get_inst(link, hashed_service_t, link); 120 120 async_exch_t *exch = async_exchange_begin(hashed_service->sess); 121 async_forward_fast(pending->c allid, exch, pending->iface,121 async_forward_fast(pending->chandle, exch, pending->iface, 122 122 pending->arg3, 0, IPC_FF_NONE); 123 123 async_exchange_end(exch); … … 163 163 * @param iface Interface to be connected to. 164 164 * @param call Pointer to call structure. 165 * @param c allidCall ID of the request.165 * @param chandle Call ID of the request. 166 166 * 167 167 * @return Zero on success or a value from @ref errno.h. … … 169 169 */ 170 170 void connect_to_service(service_t service, iface_t iface, ipc_call_t *call, 171 cap_call_handle_t c allid)171 cap_call_handle_t chandle) 172 172 { 173 173 sysarg_t arg3 = IPC_GET_ARG3(*call); … … 189 189 pending->service = service; 190 190 pending->iface = iface; 191 pending->c allid = callid;191 pending->chandle = chandle; 192 192 pending->arg3 = arg3; 193 193 … … 202 202 hashed_service_t *hashed_service = hash_table_get_inst(link, hashed_service_t, link); 203 203 async_exch_t *exch = async_exchange_begin(hashed_service->sess); 204 async_forward_fast(c allid, exch, iface, arg3, 0, IPC_FF_NONE);204 async_forward_fast(chandle, exch, iface, arg3, 0, IPC_FF_NONE); 205 205 async_exchange_end(exch); 206 206 return; 207 207 208 208 out: 209 async_answer_0(c allid, retval);209 async_answer_0(chandle, retval); 210 210 } 211 211 -
uspace/srv/ns/task.c
r3e242d2 ra46e56b 146 146 link_t link; 147 147 task_id_t id; /**< Task ID. */ 148 cap_call_handle_t c allid; /**< Call ID waiting for the connection */148 cap_call_handle_t chandle; /**< Call ID waiting for the connection */ 149 149 } pending_wait_t; 150 150 … … 184 184 texit = ht->have_rval ? TASK_EXIT_NORMAL : 185 185 TASK_EXIT_UNEXPECTED; 186 async_answer_2(pr->c allid, EOK, texit, ht->retval);186 async_answer_2(pr->chandle, EOK, texit, ht->retval); 187 187 188 188 list_remove(&pr->link); … … 192 192 } 193 193 194 void wait_for_task(task_id_t id, ipc_call_t *call, cap_call_handle_t c allid)194 void wait_for_task(task_id_t id, ipc_call_t *call, cap_call_handle_t chandle) 195 195 { 196 196 ht_link_t *link = hash_table_find(&task_hash_table, &id); … … 200 200 if (ht == NULL) { 201 201 /* No such task exists. */ 202 async_answer_0(c allid, ENOENT);202 async_answer_0(chandle, ENOENT); 203 203 return; 204 204 } … … 207 207 task_exit_t texit = ht->have_rval ? TASK_EXIT_NORMAL : 208 208 TASK_EXIT_UNEXPECTED; 209 async_answer_2(c allid, EOK, texit, ht->retval);209 async_answer_2(chandle, EOK, texit, ht->retval); 210 210 return; 211 211 } … … 215 215 (pending_wait_t *) malloc(sizeof(pending_wait_t)); 216 216 if (!pr) { 217 async_answer_0(c allid, ENOMEM);217 async_answer_0(chandle, ENOMEM); 218 218 return; 219 219 } … … 221 221 link_initialize(&pr->link); 222 222 pr->id = id; 223 pr->c allid = callid;223 pr->chandle = chandle; 224 224 list_append(&pr->link, &pending_wait); 225 225 }
Note:
See TracChangeset
for help on using the changeset viewer.
