Changeset b2f05e2 in mainline for uspace/srv/taskman/main.c
- Timestamp:
- 2020-01-09T06:27:27Z (4 years ago)
- Children:
- 8a74512
- Parents:
- 33c5626
- git-author:
- Matthieu Riolo <matthieu.riolo@…> (2020-01-09 02:56:12)
- git-committer:
- Matthieu Riolo <matthieu.riolo@…> (2020-01-09 06:27:27)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/taskman/main.c
r33c5626 rb2f05e2 222 222 } 223 223 224 static void loader_callback(ipc_call_t *icall)224 static void taskman_i_am_loader(ipc_call_t *icall) 225 225 { 226 226 DPRINTF("%s:%d from %" PRIu64 "\n", __func__, __LINE__, icall->task_id); … … 236 236 237 237 /* Create callback connection */ 238 sess_ref->sess = async_callback_receive_start(EXCHANGE_ATOMIC, icall); 239 if (sess_ref->sess == NULL) { 240 async_answer_0(icall, EINVAL); 241 return; 242 } 243 244 async_answer_0(icall, EOK); 238 sess_ref->sess = async_callback_receive(EXCHANGE_ATOMIC); 245 239 246 240 /* Notify spawners */ … … 251 245 static void taskman_connection(ipc_call_t *icall, void *arg) 252 246 { 253 /* handle new incoming calls */ 254 if (ipc_get_imethod(icall) == IPC_M_CONNECT_ME_TO) { 255 switch (ipc_get_arg2(icall)) { 256 case TASKMAN_NEW_TASK: 257 taskman_new_task(icall); 258 break; 259 case TASKMAN_CONNECT_TO_NS: 260 connect_to_ns(icall); 261 return; 262 case TASKMAN_CONNECT_TO_LOADER: 263 connect_to_loader(icall); 264 return; 265 default: 266 DPRINTF("%s:%d from %" PRIu64 "/%" SCNuPTR "/%" SCNuPTR "/%" SCNuPTR "\n", 267 __func__, __LINE__, 268 icall->task_id, ipc_get_imethod(icall), 269 ipc_get_arg1(icall), ipc_get_arg2(icall)); 270 async_answer_0(icall, ENOTSUP); 271 return; 272 } 247 /* handle new incoming IPC_M_CONNECT_ME_TO calls */ 248 switch (ipc_get_arg2(icall)) { 249 case TASKMAN_NEW_TASK: 250 taskman_new_task(icall); 251 break; 252 case TASKMAN_CONNECT_TO_NS: 253 connect_to_ns(icall); 254 break; 255 case TASKMAN_CONNECT_TO_LOADER: 256 connect_to_loader(icall); 257 break; 258 default: 259 DPRINTF("%s:%d from %" PRIu64 "/%" SCNuPTR "/%" SCNuPTR "/%" SCNuPTR "\n", 260 __func__, __LINE__, 261 icall->task_id, ipc_get_imethod(icall), 262 ipc_get_arg1(icall), ipc_get_arg2(icall)); 263 async_answer_0(icall, ENOTSUP); 264 return; 273 265 } 274 266 … … 277 269 ipc_call_t call; 278 270 279 if (!async_get_call(&call) ) {271 if (!async_get_call(&call) || !ipc_get_imethod(&call)) { 280 272 /* Client disconnected */ 281 273 DPRINTF("%s:%d client disconnected\n", __func__, __LINE__); 282 return;274 break; 283 275 } 284 276 … … 287 279 taskman_i_am_ns(&call); 288 280 break; 281 case TASKMAN_I_AM_LOADER: 282 taskman_i_am_loader(&call); 283 break; 289 284 case TASKMAN_WAIT: 290 285 taskman_ctl_wait(&call); … … 296 291 taskman_ctl_ev_callback(&call); 297 292 break; 298 case IPC_M_CONNECT_TO_ME:299 if (ipc_get_arg2(&call) == TASKMAN_LOADER_CALLBACK) {300 loader_callback(&call);301 break;302 }303 goto FALLTHROUGH_DEFAULT;304 break;305 FALLTHROUGH_DEFAULT:306 293 default: 307 294 DPRINTF("%s:%d from %" PRIu64 "/%" SCNuPTR "/%" SCNuPTR "/%" SCNuPTR "\n",
Note:
See TracChangeset
for help on using the changeset viewer.