Changeset b3eeae5 in mainline for uspace/lib/dispcfg/src
- Timestamp:
- 2023-01-15T09:24:50Z (3 years ago)
- Branches:
- master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 46a47c0
- Parents:
- 46b02cb
- Location:
- uspace/lib/dispcfg/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/dispcfg/src/dispcfg.c
r46b02cb rb3eeae5 335 335 exch = async_exchange_begin(dispcfg->sess); 336 336 rc = async_req_1_0(exch, DISPCFG_SEAT_DELETE, seat_id); 337 338 async_exchange_end(exch); 339 return rc; 340 } 341 342 /** Assign device to seat. 343 * 344 * @param dispcfg Display configuration 345 * @param svc_id Device service ID 346 * @param seat_id Seat ID 347 * @return EOK on success or an error code 348 */ 349 errno_t dispcfg_dev_assign(dispcfg_t *dispcfg, sysarg_t svc_id, 350 sysarg_t seat_id) 351 { 352 async_exch_t *exch; 353 errno_t rc; 354 355 exch = async_exchange_begin(dispcfg->sess); 356 rc = async_req_2_0(exch, DISPCFG_DEV_ASSIGN, svc_id, seat_id); 357 358 async_exchange_end(exch); 359 return rc; 360 } 361 362 /** Unassign device from any specific seat. 363 * 364 * The device will fall back to the default seat. 365 * 366 * @param dispcfg Display configuration 367 * @param svc_id Device service ID 368 * @return EOK on success or an error code 369 */ 370 errno_t dispcfg_dev_unassign(dispcfg_t *dispcfg, sysarg_t svc_id) 371 { 372 async_exch_t *exch; 373 errno_t rc; 374 375 exch = async_exchange_begin(dispcfg->sess); 376 rc = async_req_1_0(exch, DISPCFG_DEV_UNASSIGN, svc_id); 337 377 338 378 async_exchange_end(exch); -
uspace/lib/dispcfg/src/dispcfg_srv.c
r46b02cb rb3eeae5 259 259 } 260 260 261 static void dispcfg_dev_assign_srv(dispcfg_srv_t *srv, ipc_call_t *icall) 262 { 263 sysarg_t svc_id; 264 sysarg_t seat_id; 265 errno_t rc; 266 267 svc_id = ipc_get_arg1(icall); 268 seat_id = ipc_get_arg2(icall); 269 270 if (srv->ops->dev_assign == NULL) { 271 async_answer_0(icall, ENOTSUP); 272 return; 273 } 274 275 rc = srv->ops->dev_assign(srv->arg, svc_id, seat_id); 276 async_answer_0(icall, rc); 277 } 278 279 static void dispcfg_dev_unassign_srv(dispcfg_srv_t *srv, ipc_call_t *icall) 280 { 281 sysarg_t svc_id; 282 errno_t rc; 283 284 svc_id = ipc_get_arg1(icall); 285 286 if (srv->ops->dev_unassign == NULL) { 287 async_answer_0(icall, ENOTSUP); 288 return; 289 } 290 291 rc = srv->ops->dev_unassign(srv->arg, svc_id); 292 async_answer_0(icall, rc); 293 } 294 261 295 static void dispcfg_get_event_srv(dispcfg_srv_t *srv, ipc_call_t *icall) 262 296 { … … 332 366 case DISPCFG_SEAT_DELETE: 333 367 dispcfg_seat_delete_srv(srv, &call); 368 break; 369 case DISPCFG_DEV_ASSIGN: 370 dispcfg_dev_assign_srv(srv, &call); 371 break; 372 case DISPCFG_DEV_UNASSIGN: 373 dispcfg_dev_unassign_srv(srv, &call); 334 374 break; 335 375 case DISPCFG_GET_EVENT:
Note:
See TracChangeset
for help on using the changeset viewer.