Changeset 11eae82 in mainline


Ignore:
Timestamp:
2006-03-16T20:57:12Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c05290e
Parents:
48627ab
Message:

Added support for ipc_connect_me_to.

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • init/init.c

    r48627ab r11eae82  
    145145        ipc_callid_t callid;
    146146        ipc_call_t data;
     147        int i;
    147148
    148149        printf("Asking 0 to connect to me...\n");
    149150        res = ipc_connect_to_me(0, 1, 2, &taskid);
    150151        printf("Result: %d - taskid: %Q\n", res, taskid);
    151 //      while (1) {
     152        for (i=0; i < 100; i++) {
    152153                printf("----------------\n");
    153154                ipc_call_async(PHONE_NS, NS_PING_SVC, 0, "prov",
     
    156157                printf("Received ping\n");
    157158                ipc_answer(callid, 0, 0, 0);
    158 //      }
    159                 callid = ipc_wait_for_call(&data, NULL);
     159        }
     160        callid = ipc_wait_for_call(&data, NULL);
     161}
     162
     163static void test_connection_ipc(void)
     164{
     165        int res;
     166        ipcarg_t result;
     167
     168        printf("Starting connect...\n");
     169        res = ipc_connect_me_to(PHONE_NS, 10, 20);
     170        printf("Connected: %d\n", res);
     171        printf("pinging.\n");
     172        res = ipc_call_sync(res, NS_PING, 0xbeef,&result);
     173        printf("Retval: %d - received: %P\n", res, result);
     174       
    160175}
    161176
     
    167182//      test_ping();
    168183//      test_async_ipc();
    169         test_advanced_ipc();
     184//      test_advanced_ipc();
     185        test_connection_ipc();
    170186        return 0;
    171187}
  • libipc/generic/ipc.c

    r48627ab r11eae82  
    246246                          (sysarg_t) taskid);
    247247}
     248
     249/** Ask through phone for a new connection to some service */
     250int ipc_connect_me_to(int phoneid, int arg1, int arg2)
     251{
     252        return __SYSCALL3(SYS_IPC_CONNECT_ME_TO, phoneid, arg1, arg2);
     253}
     254
  • libipc/include/ipc.h

    r48627ab r11eae82  
    6565int ipc_connect_to_me(int phoneid, int arg1, int arg2,
    6666                      unsigned long long *taskid);
     67int ipc_connect_me_to(int phoneid, int arg1, int arg2);
    6768
    6869#endif
  • ns/ns.c

    r48627ab r11eae82  
    2525                        retval = 0;
    2626                        break;
     27                case IPC_M_CONNECTMETO:
     28                        printf("Somebody wants to connect to: %d\n",
     29                               IPC_GET_ARG1(call.data));
     30                        retval = 0;
     31                        break;
    2732                case NS_PING:
    2833                        printf("Ping...%P %P\n", IPC_GET_ARG1(call.data),
Note: See TracChangeset for help on using the changeset viewer.