Changeset ab34cc9 in mainline


Ignore:
Timestamp:
2011-08-19T18:03:34Z (13 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7b2a7ad
Parents:
16f9782
Message:

Make IPC_M_CONNECT_TO_ME more consistent with IPC_M_CONNECT_TO_ME.

  • Instead of passing the task ID of the connecting task in IPC argument 3 and 4, pass it in ipc_call_t::in_task_id.
  • Actually, all answers are signed by the answering task ID like this.
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • abi/include/ipc/methods.h

    r16f9782 rab34cc9  
    9696 *                       error is sent back to caller. Otherwise
    9797 *                       the call is accepted and the response is sent back.
    98  *                     - the hash of the client task is passed to userspace
    99  *                       (on the receiving side) as ARG4 of the call.
    10098 *                     - the hash of the allocated phone is passed to userspace
    10199 *                       (on the receiving side) as ARG5 of the call.
  • kernel/generic/include/ipc/ipc.h

    r16f9782 rab34cc9  
    9898typedef struct {
    9999        sysarg_t args[IPC_CALL_LEN];
    100         /** Task which made or forwarded the call with IPC_FF_ROUTE_FROM_ME. */
     100        /**
     101         * Task which made or forwarded the call with IPC_FF_ROUTE_FROM_ME,
     102         * or the task which answered the call.
     103         */
    101104        task_id_t task_id;
    102105        /** Phone which made or last masqueraded this call. */
  • kernel/generic/src/ipc/ipc.c

    r16f9782 rab34cc9  
    230230                }
    231231        }
     232
     233        call->data.task_id = TASK->taskid;
    232234       
    233235        if (do_lock)
  • kernel/generic/src/ipc/sysipc.c

    r16f9782 rab34cc9  
    253253                        /* The connection was accepted */
    254254                        phone_connect(phoneid, &answer->sender->answerbox);
    255                         /* Set 'task ID' as arg3 and arg4 of response */
    256                         IPC_SET_ARG3(answer->data, LOWER32(TASK->taskid));
    257                         IPC_SET_ARG4(answer->data, UPPER32(TASK->taskid));
    258255                        /* Set 'phone hash' as arg5 of response */
    259256                        IPC_SET_ARG5(answer->data,
  • uspace/lib/c/generic/async.c

    r16f9782 rab34cc9  
    14721472                return ENOENT;
    14731473       
    1474         task_id_t task_id;
    1475         sysarg_t task_id_lo;
    1476         sysarg_t task_id_hi;
    14771474        sysarg_t phone_hash;
    1478         int rc = async_req_3_5(exch, IPC_M_CONNECT_TO_ME, arg1, arg2, arg3,
    1479             NULL, NULL, &task_id_lo, &task_id_hi, &phone_hash);
     1475        sysarg_t rc;
     1476
     1477        aid_t req;
     1478        ipc_call_t answer;
     1479        req = async_send_3(exch, IPC_M_CONNECT_TO_ME, arg1, arg2, arg3,
     1480            &answer);
     1481        async_wait_for(req, &rc);
    14801482        if (rc != EOK)
    1481                 return rc;
    1482 
    1483         task_id = (task_id_t) MERGE_LOUP32(task_id_lo, task_id_hi);
    1484        
     1483                return (int) rc;
     1484
     1485        phone_hash = IPC_GET_ARG5(answer);
     1486
    14851487        if (client_receiver != NULL)
    1486                 async_new_connection(task_id, phone_hash, 0, NULL,
     1488                async_new_connection(answer.in_task_id, phone_hash, 0, NULL,
    14871489                    client_receiver, carg);
    14881490       
  • uspace/lib/c/generic/ipc.c

    r16f9782 rab34cc9  
    629629    task_id_t *task_id, sysarg_t *phonehash)
    630630{
    631         sysarg_t task_id_lo = 0;
    632         sysarg_t task_id_hi = 0;
    633         int rc;
    634 
    635         rc = ipc_call_sync_3_5(phoneid, IPC_M_CONNECT_TO_ME, arg1, arg2, arg3,
    636             NULL, NULL, &task_id_lo, &task_id_hi, phonehash);
    637 
    638         *task_id = (task_id_t) MERGE_LOUP32(task_id_lo, task_id_hi);
     631        ipc_call_t data;
     632        int rc = __SYSCALL6(SYS_IPC_CALL_SYNC_FAST, phoneid,
     633            IPC_M_CONNECT_TO_ME, arg1, arg2, arg3, (sysarg_t) &data);
     634        if (rc == EOK) {
     635                *task_id = data.in_task_id;
     636                *phonehash = IPC_GET_ARG5(data);
     637        }       
    639638        return rc;
    640639}
Note: See TracChangeset for help on using the changeset viewer.