Changeset c0757e1f in mainline for uspace/lib/dispcfg/src/dispcfg_srv.c
- Timestamp:
- 2023-04-19T11:13:06Z (20 months ago)
- Branches:
- master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 37087c8
- Parents:
- ec8ef12
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/dispcfg/src/dispcfg_srv.c
rec8ef12 rc0757e1f 293 293 } 294 294 295 static void dispcfg_get_asgn_dev_list_srv(dispcfg_srv_t *srv, ipc_call_t *icall) 296 { 297 sysarg_t seat_id; 298 ipc_call_t call; 299 dispcfg_dev_list_t *list = NULL; 300 size_t size; 301 errno_t rc; 302 303 seat_id = ipc_get_arg1(icall); 304 305 if (srv->ops->get_asgn_dev_list == NULL) { 306 async_answer_0(icall, ENOTSUP); 307 return; 308 } 309 310 rc = srv->ops->get_asgn_dev_list(srv->arg, seat_id, &list); 311 if (rc != EOK) { 312 async_answer_0(icall, rc); 313 return; 314 } 315 316 /* Send list size */ 317 318 if (!async_data_read_receive(&call, &size)) { 319 dispcfg_free_dev_list(list); 320 async_answer_0(&call, EREFUSED); 321 async_answer_0(icall, EREFUSED); 322 return; 323 } 324 325 if (size != sizeof(list->ndevs)) { 326 dispcfg_free_dev_list(list); 327 async_answer_0(&call, EINVAL); 328 async_answer_0(icall, EINVAL); 329 return; 330 } 331 332 rc = async_data_read_finalize(&call, &list->ndevs, size); 333 if (rc != EOK) { 334 dispcfg_free_dev_list(list); 335 async_answer_0(&call, rc); 336 async_answer_0(icall, rc); 337 return; 338 } 339 340 /* Send device list */ 341 342 if (!async_data_read_receive(&call, &size)) { 343 dispcfg_free_dev_list(list); 344 async_answer_0(&call, EREFUSED); 345 async_answer_0(icall, EREFUSED); 346 return; 347 } 348 349 if (size != list->ndevs * sizeof(sysarg_t)) { 350 dispcfg_free_dev_list(list); 351 async_answer_0(&call, EINVAL); 352 async_answer_0(icall, EINVAL); 353 return; 354 } 355 356 rc = async_data_read_finalize(&call, list->devs, size); 357 if (rc != EOK) { 358 dispcfg_free_dev_list(list); 359 async_answer_0(&call, rc); 360 async_answer_0(icall, rc); 361 return; 362 } 363 364 async_answer_0(icall, EOK); 365 dispcfg_free_dev_list(list); 366 } 367 295 368 static void dispcfg_get_event_srv(dispcfg_srv_t *srv, ipc_call_t *icall) 296 369 { … … 372 445 case DISPCFG_DEV_UNASSIGN: 373 446 dispcfg_dev_unassign_srv(srv, &call); 447 break; 448 case DISPCFG_GET_ASGN_DEV_LIST: 449 dispcfg_get_asgn_dev_list_srv(srv, &call); 374 450 break; 375 451 case DISPCFG_GET_EVENT:
Note:
See TracChangeset
for help on using the changeset viewer.