Changeset 984a9ba in mainline for uspace/lib/c/generic/async/server.c
- Timestamp:
- 2018-07-05T09:34:09Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 63d46341
- Parents:
- 76f566d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/async/server.c
r76f566d r984a9ba 77 77 * } 78 78 * 79 * port_handler(i chandle,*icall)79 * port_handler(ipc_call_t *icall) 80 80 * { 81 81 * if (want_refuse) { 82 * async_answer_0(ic handle, ELIMIT);82 * async_answer_0(icall, ELIMIT); 83 83 * return; 84 84 * } 85 * async_answer_0(ichandle, EOK); 86 * 87 * chandle = async_get_call(&call); 88 * somehow_handle_the_call(chandle, call); 89 * async_answer_2(chandle, 1, 2, 3); 90 * 91 * chandle = async_get_call(&call); 85 * 86 * async_answer_0(icall, EOK); 87 * 88 * async_get_call(&call); 89 * somehow_handle_the_call(&call); 90 * async_answer_2(&call, 1, 2, 3); 91 * 92 * async_get_call(&call); 92 93 * ... 93 94 * } … … 133 134 typedef struct { 134 135 link_t link; 135 136 136 ipc_call_t call; 137 137 } msg_t; … … 418 418 * Call the connection handler function. 419 419 */ 420 fibril_connection->handler( fibril_connection->call.cap_handle,421 &fibril_connection->call,fibril_connection->data);420 fibril_connection->handler(&fibril_connection->call, 421 fibril_connection->data); 422 422 423 423 /* … … 964 964 /** Return new incoming message for the current (fibril-local) connection. 965 965 * 966 * @param call 967 * @param usecs 968 * 969 * @return If no timeout was specified, then a handle of the incoming call is970 * returned. If a timeout is specified, then a handle of the incoming971 * call is returned unless the timeout expires prior to receiving a972 * message. In that case zero CAP_NIL is returned.973 */ 974 cap_call_handle_tasync_get_call_timeout(ipc_call_t *call, suseconds_t usecs)966 * @param call Storage where the incoming call data will be stored. 967 * @param usecs Timeout in microseconds. Zero denotes no timeout. 968 * 969 * @return If no timeout was specified, then true is returned. 970 * @return If a timeout is specified, then true is returned unless 971 * the timeout expires prior to receiving a message. 972 * 973 */ 974 bool async_get_call_timeout(ipc_call_t *call, suseconds_t usecs) 975 975 { 976 976 assert(call); … … 1007 1007 IPC_SET_IMETHOD(*call, IPC_M_PHONE_HUNGUP); 1008 1008 futex_unlock(&async_futex); 1009 return conn->close_chandle;1009 return true; 1010 1010 } 1011 1011 … … 1027 1027 /* If we timed out -> exit */ 1028 1028 futex_unlock(&async_futex); 1029 return CAP_NIL;1029 return false; 1030 1030 } 1031 1031 } … … 1035 1035 list_remove(&msg->link); 1036 1036 1037 cap_call_handle_t chandle = msg->call.cap_handle;1038 1037 *call = msg->call; 1039 1038 free(msg); 1040 1039 1041 1040 futex_unlock(&async_futex); 1042 return chandle;1041 return true; 1043 1042 } 1044 1043 … … 1251 1250 } 1252 1251 1253 errno_t async_answer_0( cap_call_handle_t chandle, errno_t retval)1254 { 1255 return ipc_answer_0(c handle, retval);1256 } 1257 1258 errno_t async_answer_1( cap_call_handle_t chandle, errno_t retval, sysarg_t arg1)1259 { 1260 return ipc_answer_1(c handle, retval, arg1);1261 } 1262 1263 errno_t async_answer_2( cap_call_handle_t chandle, errno_t retval, sysarg_t arg1,1252 errno_t async_answer_0(ipc_call_t *call, errno_t retval) 1253 { 1254 return ipc_answer_0(call->cap_handle, retval); 1255 } 1256 1257 errno_t async_answer_1(ipc_call_t *call, errno_t retval, sysarg_t arg1) 1258 { 1259 return ipc_answer_1(call->cap_handle, retval, arg1); 1260 } 1261 1262 errno_t async_answer_2(ipc_call_t *call, errno_t retval, sysarg_t arg1, 1264 1263 sysarg_t arg2) 1265 1264 { 1266 return ipc_answer_2(c handle, retval, arg1, arg2);1267 } 1268 1269 errno_t async_answer_3( cap_call_handle_t chandle, errno_t retval, sysarg_t arg1,1265 return ipc_answer_2(call->cap_handle, retval, arg1, arg2); 1266 } 1267 1268 errno_t async_answer_3(ipc_call_t *call, errno_t retval, sysarg_t arg1, 1270 1269 sysarg_t arg2, sysarg_t arg3) 1271 1270 { 1272 return ipc_answer_3(c handle, retval, arg1, arg2, arg3);1273 } 1274 1275 errno_t async_answer_4( cap_call_handle_t chandle, errno_t retval, sysarg_t arg1,1271 return ipc_answer_3(call->cap_handle, retval, arg1, arg2, arg3); 1272 } 1273 1274 errno_t async_answer_4(ipc_call_t *call, errno_t retval, sysarg_t arg1, 1276 1275 sysarg_t arg2, sysarg_t arg3, sysarg_t arg4) 1277 1276 { 1278 return ipc_answer_4(c handle, retval, arg1, arg2, arg3, arg4);1279 } 1280 1281 errno_t async_answer_5( cap_call_handle_t chandle, errno_t retval, sysarg_t arg1,1277 return ipc_answer_4(call->cap_handle, retval, arg1, arg2, arg3, arg4); 1278 } 1279 1280 errno_t async_answer_5(ipc_call_t *call, errno_t retval, sysarg_t arg1, 1282 1281 sysarg_t arg2, sysarg_t arg3, sysarg_t arg4, sysarg_t arg5) 1283 1282 { 1284 return ipc_answer_5(chandle, retval, arg1, arg2, arg3, arg4, arg5); 1285 } 1286 1287 errno_t async_forward_fast(cap_call_handle_t chandle, async_exch_t *exch, 1283 return ipc_answer_5(call->cap_handle, retval, arg1, arg2, arg3, arg4, 1284 arg5); 1285 } 1286 1287 errno_t async_forward_fast(ipc_call_t *call, async_exch_t *exch, 1288 1288 sysarg_t imethod, sysarg_t arg1, sysarg_t arg2, unsigned int mode) 1289 1289 { 1290 assert(call); 1291 1290 1292 if (exch == NULL) 1291 1293 return ENOENT; 1292 1294 1293 return ipc_forward_fast(chandle, exch->phone, imethod, arg1, arg2, mode); 1294 } 1295 1296 errno_t async_forward_slow(cap_call_handle_t chandle, async_exch_t *exch, 1295 return ipc_forward_fast(call->cap_handle, exch->phone, imethod, arg1, 1296 arg2, mode); 1297 } 1298 1299 errno_t async_forward_slow(ipc_call_t *call, async_exch_t *exch, 1297 1300 sysarg_t imethod, sysarg_t arg1, sysarg_t arg2, sysarg_t arg3, 1298 1301 sysarg_t arg4, sysarg_t arg5, unsigned int mode) 1299 1302 { 1303 assert(call); 1304 1300 1305 if (exch == NULL) 1301 1306 return ENOENT; 1302 1307 1303 return ipc_forward_slow(c handle, exch->phone, imethod, arg1, arg2, arg3,1304 arg 4, arg5, mode);1308 return ipc_forward_slow(call->cap_handle, exch->phone, imethod, arg1, 1309 arg2, arg3, arg4, arg5, mode); 1305 1310 } 1306 1311 … … 1309 1314 * Ask through phone for a new connection to some service. 1310 1315 * 1311 * @param exch 1312 * @param arg1 1313 * @param arg2 1314 * @param arg3 1316 * @param exch Exchange for sending the message. 1317 * @param arg1 User defined argument. 1318 * @param arg2 User defined argument. 1319 * @param arg3 User defined argument. 1315 1320 * 1316 1321 * @return Zero on success or an error code. … … 1350 1355 * So far, this wrapper is to be used from within a connection fibril. 1351 1356 * 1352 * @param c handle Storage for the handleof the IPC_M_SHARE_IN call.1353 * @param size 1357 * @param call Storage for the data of the IPC_M_SHARE_IN call. 1358 * @param size Destination address space area size. 1354 1359 * 1355 1360 * @return True on success, false on failure. 1356 1361 * 1357 1362 */ 1358 bool async_share_in_receive( cap_call_handle_t *chandle, size_t *size)1359 { 1360 assert(c handle);1363 bool async_share_in_receive(ipc_call_t *call, size_t *size) 1364 { 1365 assert(call); 1361 1366 assert(size); 1362 1367 1363 ipc_call_t data; 1364 *chandle = async_get_call(&data); 1365 1366 if (IPC_GET_IMETHOD(data) != IPC_M_SHARE_IN) 1368 async_get_call(call); 1369 1370 if (IPC_GET_IMETHOD(*call) != IPC_M_SHARE_IN) 1367 1371 return false; 1368 1372 1369 *size = (size_t) IPC_GET_ARG1( data);1373 *size = (size_t) IPC_GET_ARG1(*call); 1370 1374 return true; 1371 1375 } … … 1377 1381 * argument. 1378 1382 * 1379 * @param c handle Handle of theIPC_M_DATA_READ call to answer.1380 * @param src 1381 * @param flags 1383 * @param call IPC_M_DATA_READ call to answer. 1384 * @param src Source address space base. 1385 * @param flags Flags to be used for sharing. Bits can be only cleared. 1382 1386 * 1383 1387 * @return Zero on success or a value from @ref errno.h on failure. 1384 1388 * 1385 1389 */ 1386 errno_t async_share_in_finalize(cap_call_handle_t chandle, void *src, 1387 unsigned int flags) 1388 { 1390 errno_t async_share_in_finalize(ipc_call_t *call, void *src, unsigned int flags) 1391 { 1392 assert(call); 1393 1389 1394 // FIXME: The source has no business deciding destination address. 1390 return ipc_answer_3(c handle, EOK, (sysarg_t) src, (sysarg_t) flags,1395 return ipc_answer_3(call->cap_handle, EOK, (sysarg_t) src, (sysarg_t) flags, 1391 1396 (sysarg_t) _end); 1392 1397 } … … 1400 1405 * So far, this wrapper is to be used from within a connection fibril. 1401 1406 * 1402 * @param c handle Storage for the hashof the IPC_M_SHARE_OUT call.1403 * @param size 1404 * @param flags 1407 * @param call Storage for the data of the IPC_M_SHARE_OUT call. 1408 * @param size Storage for the source address space area size. 1409 * @param flags Storage for the sharing flags. 1405 1410 * 1406 1411 * @return True on success, false on failure. 1407 1412 * 1408 1413 */ 1409 bool async_share_out_receive( cap_call_handle_t *chandle, size_t *size,1414 bool async_share_out_receive(ipc_call_t *call, size_t *size, 1410 1415 unsigned int *flags) 1411 1416 { 1412 assert(c handle);1417 assert(call); 1413 1418 assert(size); 1414 1419 assert(flags); 1415 1420 1416 ipc_call_t data; 1417 *chandle = async_get_call(&data); 1418 1419 if (IPC_GET_IMETHOD(data) != IPC_M_SHARE_OUT) 1421 async_get_call(call); 1422 1423 if (IPC_GET_IMETHOD(*call) != IPC_M_SHARE_OUT) 1420 1424 return false; 1421 1425 1422 *size = (size_t) IPC_GET_ARG2( data);1423 *flags = (unsigned int) IPC_GET_ARG3( data);1426 *size = (size_t) IPC_GET_ARG2(*call); 1427 *flags = (unsigned int) IPC_GET_ARG3(*call); 1424 1428 return true; 1425 1429 } … … 1431 1435 * argument. 1432 1436 * 1433 * @param c handle Handle of theIPC_M_DATA_WRITE call to answer.1434 * @param dst 1435 * 1437 * @param call IPC_M_DATA_WRITE call to answer. 1438 * @param dst Address of the storage for the destination address space area 1439 * base address. 1436 1440 * 1437 1441 * @return Zero on success or a value from @ref errno.h on failure. 1438 1442 * 1439 1443 */ 1440 errno_t async_share_out_finalize(cap_call_handle_t chandle, void **dst) 1441 { 1442 return ipc_answer_2(chandle, EOK, (sysarg_t) _end, (sysarg_t) dst); 1444 errno_t async_share_out_finalize(ipc_call_t *call, void **dst) 1445 { 1446 assert(call); 1447 1448 return ipc_answer_2(call->cap_handle, EOK, (sysarg_t) _end, 1449 (sysarg_t) dst); 1443 1450 } 1444 1451 … … 1451 1458 * So far, this wrapper is to be used from within a connection fibril. 1452 1459 * 1453 * @param c handle Storage for the handleof the IPC_M_DATA_READ.1454 * @param size 1460 * @param call Storage for the data of the IPC_M_DATA_READ. 1461 * @param size Storage for the maximum size. Can be NULL. 1455 1462 * 1456 1463 * @return True on success, false on failure. 1457 1464 * 1458 1465 */ 1459 bool async_data_read_receive(cap_call_handle_t *chandle, size_t *size) 1460 { 1461 ipc_call_t data; 1462 return async_data_read_receive_call(chandle, &data, size); 1463 } 1464 1465 /** Wrapper for receiving the IPC_M_DATA_READ calls using the async framework. 1466 * 1467 * This wrapper only makes it more comfortable to receive IPC_M_DATA_READ 1468 * calls so that the user doesn't have to remember the meaning of each IPC 1469 * argument. 1470 * 1471 * So far, this wrapper is to be used from within a connection fibril. 1472 * 1473 * @param chandle Storage for the handle of the IPC_M_DATA_READ. 1474 * @param size Storage for the maximum size. Can be NULL. 1475 * 1476 * @return True on success, false on failure. 1477 * 1478 */ 1479 bool async_data_read_receive_call(cap_call_handle_t *chandle, ipc_call_t *data, 1480 size_t *size) 1481 { 1482 assert(chandle); 1483 assert(data); 1484 1485 *chandle = async_get_call(data); 1486 1487 if (IPC_GET_IMETHOD(*data) != IPC_M_DATA_READ) 1466 bool async_data_read_receive(ipc_call_t *call, size_t *size) 1467 { 1468 assert(call); 1469 1470 async_get_call(call); 1471 1472 if (IPC_GET_IMETHOD(*call) != IPC_M_DATA_READ) 1488 1473 return false; 1489 1474 1490 1475 if (size) 1491 *size = (size_t) IPC_GET_ARG2(* data);1476 *size = (size_t) IPC_GET_ARG2(*call); 1492 1477 1493 1478 return true; … … 1500 1485 * argument. 1501 1486 * 1502 * @param c handle Handle of theIPC_M_DATA_READ call to answer.1503 * @param src 1504 * @param size 1505 * 1487 * @param call IPC_M_DATA_READ call to answer. 1488 * @param src Source address for the IPC_M_DATA_READ call. 1489 * @param size Size for the IPC_M_DATA_READ call. Can be smaller than 1490 * the maximum size announced by the sender. 1506 1491 * 1507 1492 * @return Zero on success or a value from @ref errno.h on failure. 1508 1493 * 1509 1494 */ 1510 errno_t async_data_read_finalize(cap_call_handle_t chandle, const void *src, 1511 size_t size) 1512 { 1513 return ipc_answer_2(chandle, EOK, (sysarg_t) src, (sysarg_t) size); 1495 errno_t async_data_read_finalize(ipc_call_t *call, const void *src, size_t size) 1496 { 1497 assert(call); 1498 1499 return ipc_answer_2(call->cap_handle, EOK, (sysarg_t) src, 1500 (sysarg_t) size); 1514 1501 } 1515 1502 … … 1524 1511 return ENOENT; 1525 1512 1526 cap_call_handle_t chandle;1527 if (!async_data_read_receive(&c handle, NULL)) {1528 ipc_answer_0(chandle, EINVAL);1513 ipc_call_t call; 1514 if (!async_data_read_receive(&call, NULL)) { 1515 async_answer_0(&call, EINVAL); 1529 1516 return EINVAL; 1530 1517 } … … 1533 1520 dataptr); 1534 1521 if (msg == 0) { 1535 ipc_answer_0(chandle, EINVAL);1522 async_answer_0(&call, EINVAL); 1536 1523 return EINVAL; 1537 1524 } 1538 1525 1539 errno_t retval = ipc_forward_fast(c handle, exch->phone, 0, 0, 0,1526 errno_t retval = ipc_forward_fast(call.cap_handle, exch->phone, 0, 0, 0, 1540 1527 IPC_FF_ROUTE_FROM_ME); 1541 1528 if (retval != EOK) { 1542 1529 async_forget(msg); 1543 ipc_answer_0(chandle, retval);1530 async_answer_0(&call, retval); 1544 1531 return retval; 1545 1532 } … … 1559 1546 * So far, this wrapper is to be used from within a connection fibril. 1560 1547 * 1561 * @param chandle Storage for the handle of the IPC_M_DATA_WRITE. 1562 * @param size Storage for the suggested size. May be NULL. 1563 * 1564 * @return True on success, false on failure. 1565 * 1566 */ 1567 bool async_data_write_receive(cap_call_handle_t *chandle, size_t *size) 1568 { 1569 ipc_call_t data; 1570 return async_data_write_receive_call(chandle, &data, size); 1571 } 1572 1573 /** Wrapper for receiving the IPC_M_DATA_WRITE calls using the async framework. 1574 * 1575 * This wrapper only makes it more comfortable to receive IPC_M_DATA_WRITE 1576 * calls so that the user doesn't have to remember the meaning of each IPC 1577 * argument. 1578 * 1579 * So far, this wrapper is to be used from within a connection fibril. 1580 * 1581 * @param chandle Storage for the handle of the IPC_M_DATA_WRITE. 1582 * @param data Storage for the ipc call data. 1583 * @param size Storage for the suggested size. May be NULL. 1548 * @param call Storage for the data of the IPC_M_DATA_WRITE. 1549 * @param size Storage for the suggested size. May be NULL. 1584 1550 * 1585 1551 * @return True on success, false on failure. 1586 1552 * 1587 1553 */ 1588 bool async_data_write_receive_call(cap_call_handle_t *chandle, ipc_call_t *data, 1589 size_t *size) 1590 { 1591 assert(chandle); 1592 assert(data); 1593 1594 *chandle = async_get_call(data); 1595 1596 if (IPC_GET_IMETHOD(*data) != IPC_M_DATA_WRITE) 1554 bool async_data_write_receive(ipc_call_t *call, size_t *size) 1555 { 1556 assert(call); 1557 1558 async_get_call(call); 1559 1560 if (IPC_GET_IMETHOD(*call) != IPC_M_DATA_WRITE) 1597 1561 return false; 1598 1562 1599 1563 if (size) 1600 *size = (size_t) IPC_GET_ARG2(* data);1564 *size = (size_t) IPC_GET_ARG2(*call); 1601 1565 1602 1566 return true; … … 1609 1573 * argument. 1610 1574 * 1611 * @param c handle Handle of theIPC_M_DATA_WRITE call to answer.1612 * @param dst 1613 * @param size 1575 * @param call IPC_M_DATA_WRITE call to answer. 1576 * @param dst Final destination address for the IPC_M_DATA_WRITE call. 1577 * @param size Final size for the IPC_M_DATA_WRITE call. 1614 1578 * 1615 1579 * @return Zero on success or a value from @ref errno.h on failure. 1616 1580 * 1617 1581 */ 1618 errno_t async_data_write_finalize(cap_call_handle_t chandle, void *dst, 1619 size_t size) 1620 { 1621 return ipc_answer_2(chandle, EOK, (sysarg_t) dst, (sysarg_t) size); 1582 errno_t async_data_write_finalize(ipc_call_t *call, void *dst, size_t size) 1583 { 1584 assert(call); 1585 1586 return async_answer_2(call, EOK, (sysarg_t) dst, (sysarg_t) size); 1622 1587 } 1623 1588 … … 1649 1614 assert(data); 1650 1615 1651 cap_call_handle_t chandle;1616 ipc_call_t call; 1652 1617 size_t size; 1653 if (!async_data_write_receive(&c handle, &size)) {1654 ipc_answer_0(chandle, EINVAL);1618 if (!async_data_write_receive(&call, &size)) { 1619 async_answer_0(&call, EINVAL); 1655 1620 return EINVAL; 1656 1621 } 1657 1622 1658 1623 if (size < min_size) { 1659 ipc_answer_0(chandle, EINVAL);1624 async_answer_0(&call, EINVAL); 1660 1625 return EINVAL; 1661 1626 } 1662 1627 1663 1628 if ((max_size > 0) && (size > max_size)) { 1664 ipc_answer_0(chandle, EINVAL);1629 async_answer_0(&call, EINVAL); 1665 1630 return EINVAL; 1666 1631 } 1667 1632 1668 1633 if ((granularity > 0) && ((size % granularity) != 0)) { 1669 ipc_answer_0(chandle, EINVAL);1634 async_answer_0(&call, EINVAL); 1670 1635 return EINVAL; 1671 1636 } … … 1679 1644 1680 1645 if (arg_data == NULL) { 1681 ipc_answer_0(chandle, ENOMEM);1646 async_answer_0(&call, ENOMEM); 1682 1647 return ENOMEM; 1683 1648 } 1684 1649 1685 errno_t rc = async_data_write_finalize( chandle, arg_data, size);1650 errno_t rc = async_data_write_finalize(&call, arg_data, size); 1686 1651 if (rc != EOK) { 1687 1652 free(arg_data); … … 1708 1673 void async_data_write_void(errno_t retval) 1709 1674 { 1710 cap_call_handle_t chandle;1711 async_data_write_receive(&c handle, NULL);1712 ipc_answer_0(chandle, retval);1675 ipc_call_t call; 1676 async_data_write_receive(&call, NULL); 1677 async_answer_0(&call, retval); 1713 1678 } 1714 1679 … … 1723 1688 return ENOENT; 1724 1689 1725 cap_call_handle_t chandle;1726 if (!async_data_write_receive(&c handle, NULL)) {1727 ipc_answer_0(chandle, EINVAL);1690 ipc_call_t call; 1691 if (!async_data_write_receive(&call, NULL)) { 1692 async_answer_0(&call, EINVAL); 1728 1693 return EINVAL; 1729 1694 } … … 1732 1697 dataptr); 1733 1698 if (msg == 0) { 1734 ipc_answer_0(chandle, EINVAL);1699 async_answer_0(&call, EINVAL); 1735 1700 return EINVAL; 1736 1701 } 1737 1702 1738 errno_t retval = ipc_forward_fast(c handle, exch->phone, 0, 0, 0,1703 errno_t retval = ipc_forward_fast(call.cap_handle, exch->phone, 0, 0, 0, 1739 1704 IPC_FF_ROUTE_FROM_ME); 1740 1705 if (retval != EOK) { 1741 1706 async_forget(msg); 1742 ipc_answer_0(chandle, retval);1707 async_answer_0(&call, retval); 1743 1708 return retval; 1744 1709 } … … 1765 1730 /* Accept the phone */ 1766 1731 ipc_call_t call; 1767 cap_call_handle_t chandle = async_get_call(&call); 1732 async_get_call(&call); 1733 1768 1734 cap_phone_handle_t phandle = (cap_handle_t) IPC_GET_ARG5(call); 1769 1735 1770 1736 if ((IPC_GET_IMETHOD(call) != IPC_M_CONNECT_TO_ME) || 1771 1737 !CAP_HANDLE_VALID((phandle))) { 1772 async_answer_0( chandle, EINVAL);1738 async_answer_0(&call, EINVAL); 1773 1739 return NULL; 1774 1740 } … … 1776 1742 async_sess_t *sess = (async_sess_t *) malloc(sizeof(async_sess_t)); 1777 1743 if (sess == NULL) { 1778 async_answer_0( chandle, ENOMEM);1744 async_answer_0(&call, ENOMEM); 1779 1745 return NULL; 1780 1746 } … … 1795 1761 1796 1762 /* Acknowledge the connected phone */ 1797 async_answer_0( chandle, EOK);1763 async_answer_0(&call, EOK); 1798 1764 1799 1765 return sess; … … 1843 1809 } 1844 1810 1845 bool async_state_change_receive(cap_call_handle_t *chandle, sysarg_t *arg1, 1846 sysarg_t *arg2, sysarg_t *arg3) 1847 { 1848 assert(chandle); 1849 1850 ipc_call_t call; 1851 *chandle = async_get_call(&call); 1852 1853 if (IPC_GET_IMETHOD(call) != IPC_M_STATE_CHANGE_AUTHORIZE) 1811 bool async_state_change_receive(ipc_call_t *call) 1812 { 1813 assert(call); 1814 1815 async_get_call(call); 1816 1817 if (IPC_GET_IMETHOD(*call) != IPC_M_STATE_CHANGE_AUTHORIZE) 1854 1818 return false; 1855 1819 1856 if (arg1)1857 *arg1 = IPC_GET_ARG1(call);1858 if (arg2)1859 *arg2 = IPC_GET_ARG2(call);1860 if (arg3)1861 *arg3 = IPC_GET_ARG3(call);1862 1863 1820 return true; 1864 1821 } 1865 1822 1866 errno_t async_state_change_finalize(cap_call_handle_t chandle, 1867 async_exch_t *other_exch) 1868 { 1869 return ipc_answer_1(chandle, EOK, CAP_HANDLE_RAW(other_exch->phone)); 1823 errno_t async_state_change_finalize(ipc_call_t *call, async_exch_t *other_exch) 1824 { 1825 assert(call); 1826 1827 return async_answer_1(call, EOK, CAP_HANDLE_RAW(other_exch->phone)); 1870 1828 } 1871 1829
Note:
See TracChangeset
for help on using the changeset viewer.