Changeset 05ffb41 in mainline for kernel/generic/src/ipc/sysipc.c


Ignore:
Timestamp:
2017-08-17T19:11:14Z (7 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1c85bae
Parents:
7e3826d9
Message:

Turn IPC phones into kobjects

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/ipc/sysipc.c

    r7e3826d9 r05ffb41  
    264264/** Make a call over IPC and wait for reply.
    265265 *
    266  * @param phoneid     Phone handle for the call.
    267  * @param data[inout] Structure with request/reply data.
    268  * @param priv        Value to be stored in call->priv.
     266 * @param phone_cap    Phone capability for the call.
     267 * @param data[inout]  Structure with request/reply data.
     268 * @param priv         Value to be stored in call->priv.
    269269 *
    270270 * @return EOK on success.
     
    272272 *
    273273 */
    274 int ipc_req_internal(int phoneid, ipc_data_t *data, sysarg_t priv)
    275 {
    276         phone_t *phone;
    277         if (phone_get(phoneid, &phone) != EOK)
     274int ipc_req_internal(int phone_cap, ipc_data_t *data, sysarg_t priv)
     275{
     276        phone_t *phone = phone_get_current(phone_cap);
     277        if (!phone)
    278278                return ENOENT;
    279279       
     
    350350 * the generic function sys_ipc_call_async_slow().
    351351 *
    352  * @param phoneid Phone handle for the call.
    353  * @param imethod Interface and method of the call.
    354  * @param arg1    Service-defined payload argument.
    355  * @param arg2    Service-defined payload argument.
    356  * @param arg3    Service-defined payload argument.
    357  * @param arg4    Service-defined payload argument.
     352 * @param phone_cap  Phone capability for the call.
     353 * @param imethod    Interface and method of the call.
     354 * @param arg1       Service-defined payload argument.
     355 * @param arg2       Service-defined payload argument.
     356 * @param arg3       Service-defined payload argument.
     357 * @param arg4       Service-defined payload argument.
    358358 *
    359359 * @return Call hash on success.
     
    363363 *
    364364 */
    365 sysarg_t sys_ipc_call_async_fast(sysarg_t phoneid, sysarg_t imethod,
     365sysarg_t sys_ipc_call_async_fast(sysarg_t phone_cap, sysarg_t imethod,
    366366    sysarg_t arg1, sysarg_t arg2, sysarg_t arg3, sysarg_t arg4)
    367367{
    368         phone_t *phone;
    369         if (phone_get(phoneid, &phone) != EOK)
     368        phone_t *phone = phone_get_current(phone_cap);
     369        if (!phone)
    370370                return IPC_CALLRET_FATAL;
    371371       
     
    398398/** Make an asynchronous IPC call allowing to transmit the entire payload.
    399399 *
    400  * @param phoneid Phone handle for the call.
    401  * @param data    Userspace address of call data with the request.
     400 * @param phone_cap  Phone capability for the call.
     401 * @param data       Userspace address of call data with the request.
    402402 *
    403403 * @return See sys_ipc_call_async_fast().
    404404 *
    405405 */
    406 sysarg_t sys_ipc_call_async_slow(sysarg_t phoneid, ipc_data_t *data)
    407 {
    408         phone_t *phone;
    409         if (phone_get(phoneid, &phone) != EOK)
     406sysarg_t sys_ipc_call_async_slow(sysarg_t phone_cap, ipc_data_t *data)
     407{
     408        phone_t *phone = phone_get_current(phone_cap);
     409        if (!phone)
    410410                return IPC_CALLRET_FATAL;
    411411
     
    435435 * Common code for both the fast and the slow version.
    436436 *
    437  * @param callid  Hash of the call to forward.
    438  * @param phoneid Phone handle to use for forwarding.
    439  * @param imethod New interface and method to use for the forwarded call.
    440  * @param arg1    New value of the first argument for the forwarded call.
    441  * @param arg2    New value of the second argument for the forwarded call.
    442  * @param arg3    New value of the third argument for the forwarded call.
    443  * @param arg4    New value of the fourth argument for the forwarded call.
    444  * @param arg5    New value of the fifth argument for the forwarded call.
    445  * @param mode    Flags that specify mode of the forward operation.
    446  * @param slow    If true, arg3, arg4 and arg5 are considered. Otherwise
    447  *                the function considers only the fast version arguments:
    448  *                i.e. arg1 and arg2.
     437 * @param callid     Hash of the call to forward.
     438 * @param phone_cap  Phone capability to use for forwarding.
     439 * @param imethod    New interface and method to use for the forwarded call.
     440 * @param arg1       New value of the first argument for the forwarded call.
     441 * @param arg2       New value of the second argument for the forwarded call.
     442 * @param arg3       New value of the third argument for the forwarded call.
     443 * @param arg4       New value of the fourth argument for the forwarded call.
     444 * @param arg5       New value of the fifth argument for the forwarded call.
     445 * @param mode       Flags that specify mode of the forward operation.
     446 * @param slow       If true, arg3, arg4 and arg5 are considered. Otherwise
     447 *                   the function considers only the fast version arguments:
     448 *                   i.e. arg1 and arg2.
    449449 *
    450450 * @return 0 on succes, otherwise an error code.
     
    453453 *
    454454 */
    455 static sysarg_t sys_ipc_forward_common(sysarg_t callid, sysarg_t phoneid,
     455static sysarg_t sys_ipc_forward_common(sysarg_t callid, sysarg_t phone_cap,
    456456    sysarg_t imethod, sysarg_t arg1, sysarg_t arg2, sysarg_t arg3,
    457457    sysarg_t arg4, sysarg_t arg5, unsigned int mode, bool slow)
     
    468468        bool after_forward = false;
    469469        int rc;
    470         phone_t *phone;
    471        
    472         if (phone_get(phoneid, &phone) != EOK) {
     470
     471        phone_t *phone = phone_get_current(phone_cap);
     472        if (!phone) {
    473473                rc = ENOENT;
    474474                goto error;
     
    685685/** Hang up a phone.
    686686 *
    687  * @param Phone handle of the phone to be hung up.
     687 * @param phone_cap  Phone capability of the phone to be hung up.
    688688 *
    689689 * @return 0 on success or an error code.
    690690 *
    691691 */
    692 sysarg_t sys_ipc_hangup(sysarg_t phoneid)
    693 {
    694         phone_t *phone;
    695        
    696         if (phone_get(phoneid, &phone) != EOK)
     692sysarg_t sys_ipc_hangup(sysarg_t phone_cap)
     693{
     694        phone_t *phone = phone_get_current(phone_cap);
     695        if (!phone)
    697696                return ENOENT;
    698697       
Note: See TracChangeset for help on using the changeset viewer.