Changeset c0757e1f in mainline for uspace/lib/dispcfg/src/dispcfg.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.c
rec8ef12 rc0757e1f 206 206 /** Free seat list. 207 207 * 208 * @param list Display configurationlist208 * @param list Seat list 209 209 */ 210 210 void dispcfg_free_seat_list(dispcfg_seat_list_t *list) … … 277 277 /** Free seat information. 278 278 * 279 * @param info Display configurationinformation279 * @param info Seat information 280 280 */ 281 281 void dispcfg_free_seat_info(dispcfg_seat_info_t *info) … … 378 378 async_exchange_end(exch); 379 379 return rc; 380 } 381 382 /** Get list of devices assigned to a seat. 383 * 384 * @param dispcfg Display configuration 385 * @param seat_id Seat ID 386 * @param rlist Place to store pointer to new device list structure 387 * @return EOK on success or an error code 388 */ 389 errno_t dispcfg_get_asgn_dev_list(dispcfg_t *dispcfg, sysarg_t seat_id, 390 dispcfg_dev_list_t **rlist) 391 { 392 async_exch_t *exch; 393 aid_t req; 394 ipc_call_t answer; 395 dispcfg_dev_list_t *list; 396 sysarg_t ndevs; 397 sysarg_t *devs; 398 errno_t rc; 399 400 exch = async_exchange_begin(dispcfg->sess); 401 req = async_send_1(exch, DISPCFG_GET_ASGN_DEV_LIST, seat_id, &answer); 402 403 /* Receive device list length */ 404 rc = async_data_read_start(exch, &ndevs, sizeof (ndevs)); 405 if (rc != EOK) { 406 async_exchange_end(exch); 407 async_wait_for(req, &rc); 408 return rc; 409 } 410 411 devs = calloc(ndevs, sizeof(sysarg_t)); 412 if (devs == NULL) { 413 async_exchange_end(exch); 414 async_forget(req); 415 return ENOMEM; 416 } 417 418 /* Receive device list */ 419 rc = async_data_read_start(exch, devs, ndevs * sizeof (sysarg_t)); 420 async_exchange_end(exch); 421 422 if (rc != EOK) { 423 async_forget(req); 424 return rc; 425 } 426 427 async_wait_for(req, &rc); 428 if (rc != EOK) 429 return rc; 430 431 list = calloc(1, sizeof(dispcfg_dev_list_t)); 432 if (list == NULL) 433 return ENOMEM; 434 435 list->ndevs = ndevs; 436 list->devs = devs; 437 *rlist = list; 438 return EOK; 439 } 440 441 /** Free device list. 442 * 443 * @param list Device list 444 */ 445 void dispcfg_free_dev_list(dispcfg_dev_list_t *list) 446 { 447 free(list->devs); 448 free(list); 380 449 } 381 450
Note:
See TracChangeset
for help on using the changeset viewer.