Changeset 3c22f70 in mainline


Ignore:
Timestamp:
2011-01-24T00:14:13Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8c9b742
Parents:
11bb813
Message:

Pass client task hash into async_new_connection().

Location:
uspace
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/async.c

    r11bb813 r3c22f70  
    139139        link_t link;
    140140       
     141        /** Incoming client task hash. */
     142        sysarg_t in_task_hash;
    141143        /** Incoming phone hash. */
    142144        sysarg_t in_phone_hash;
     
    517519 * particular fibrils.
    518520 *
     521 * @param in_task_hash  Identification of the incoming connection.
    519522 * @param in_phone_hash Identification of the incoming connection.
    520523 * @param callid        Hash of the opening IPC_M_CONNECT_ME_TO call.
     
    529532 *
    530533 */
    531 fid_t async_new_connection(sysarg_t in_phone_hash, ipc_callid_t callid,
    532     ipc_call_t *call, void (*cfibril)(ipc_callid_t, ipc_call_t *))
     534fid_t async_new_connection(sysarg_t in_task_hash, sysarg_t in_phone_hash,
     535    ipc_callid_t callid, ipc_call_t *call,
     536    void (*cfibril)(ipc_callid_t, ipc_call_t *))
    533537{
    534538        connection_t *conn = malloc(sizeof(*conn));
     
    539543        }
    540544       
     545        conn->in_task_hash = in_task_hash;
    541546        conn->in_phone_hash = in_phone_hash;
    542547        list_initialize(&conn->msg_queue);
     
    592597        case IPC_M_CONNECT_ME_TO:
    593598                /* Open new connection with fibril etc. */
    594                 async_new_connection(IPC_GET_ARG5(*call), callid, call,
    595                     client_connection);
     599                async_new_connection(call->in_task_hash, IPC_GET_ARG5(*call),
     600                    callid, call, client_connection);
    596601                goto out;
    597602        }
  • uspace/lib/c/generic/net/modules.c

    r11bb813 r3c22f70  
    143143        if (phone >= 0) {
    144144                /* Request the bidirectional connection */
     145                sysarg_t taskhash;
    145146                sysarg_t phonehash;
    146147               
    147                 rc = ipc_connect_to_me(phone, arg1, arg2, arg3, NULL,
     148                rc = ipc_connect_to_me(phone, arg1, arg2, arg3, &taskhash,
    148149                    &phonehash);
    149150                if (rc != EOK) {
     
    151152                        return rc;
    152153                }
    153                 async_new_connection(phonehash, 0, NULL, client_receiver);
     154                async_new_connection(taskhash, phonehash, 0, NULL,
     155                    client_receiver);
    154156        }
    155157       
  • uspace/lib/c/include/async.h

    r11bb813 r3c22f70  
    9292extern int async_wait_timeout(aid_t, sysarg_t *, suseconds_t);
    9393
    94 extern fid_t async_new_connection(sysarg_t, ipc_callid_t, ipc_call_t *,
    95     void (*)(ipc_callid_t, ipc_call_t *));
     94extern fid_t async_new_connection(sysarg_t, sysarg_t, ipc_callid_t,
     95    ipc_call_t *, void (*)(ipc_callid_t, ipc_call_t *));
    9696extern void async_usleep(suseconds_t);
    9797extern void async_create_manager(void);
  • uspace/lib/c/include/ipc/ipc.h

    r11bb813 r3c22f70  
    4646typedef struct {
    4747        sysarg_t args[IPC_CALL_LEN];
     48        sysarg_t in_task_hash;
    4849        sysarg_t in_phone_hash;
    49         sysarg_t in_task_hash;
    5050} ipc_call_t;
    5151
  • uspace/lib/fs/libfs.c

    r11bb813 r3c22f70  
    102102         * Ask VFS for callback connection.
    103103         */
    104         ipc_connect_to_me(vfs_phone, 0, 0, 0, NULL, &reg->vfs_phonehash);
     104        sysarg_t taskhash;
     105        ipc_connect_to_me(vfs_phone, 0, 0, 0, &taskhash, &reg->vfs_phonehash);
    105106       
    106107        /*
     
    131132         * Create a connection fibril to handle the callback connection.
    132133         */
    133         async_new_connection(reg->vfs_phonehash, 0, NULL, conn);
     134        async_new_connection(taskhash, reg->vfs_phonehash, 0, NULL, conn);
    134135       
    135136        /*
  • uspace/srv/hid/adb_mouse/adb_dev.c

    r11bb813 r3c22f70  
    6868
    6969        /* NB: The callback connection is slotted for removal */
     70        sysarg_t taskhash;
    7071        sysarg_t phonehash;
    71         if (ipc_connect_to_me(dev_phone, 0, 0, 0, NULL, &phonehash) != 0) {
     72        if (ipc_connect_to_me(dev_phone, 0, 0, 0, &taskhash, &phonehash) != 0) {
    7273                printf(NAME ": Failed to create callback from device\n");
    7374                return false;
    7475        }
    7576
    76         async_new_connection(phonehash, 0, NULL, adb_dev_events);
     77        async_new_connection(taskhash, phonehash, 0, NULL, adb_dev_events);
    7778
    7879        return 0;
  • uspace/srv/hid/char_mouse/chardev.c

    r11bb813 r3c22f70  
    7070
    7171        /* NB: The callback connection is slotted for removal */
     72        sysarg_t taskhash;
    7273        sysarg_t phonehash;
    73         if (ipc_connect_to_me(dev_phone, 0, 0, 0, NULL, &phonehash) != 0) {
     74        if (ipc_connect_to_me(dev_phone, 0, 0, 0, &taskhash, &phonehash) != 0) {
    7475                printf(NAME ": Failed to create callback from device\n");
    7576                return false;
    7677        }
    7778
    78         async_new_connection(phonehash, 0, NULL, chardev_events);
     79        async_new_connection(taskhash, phonehash, 0, NULL, chardev_events);
    7980
    8081        return 0;
  • uspace/srv/hid/console/console.c

    r11bb813 r3c22f70  
    726726       
    727727        /* NB: The callback connection is slotted for removal */
     728        sysarg_t taskhash;
    728729        sysarg_t phonehash;
    729         if (ipc_connect_to_me(kbd_phone, SERVICE_CONSOLE, 0, 0, NULL,
     730        if (ipc_connect_to_me(kbd_phone, SERVICE_CONSOLE, 0, 0, &taskhash,
    730731            &phonehash) != 0) {
    731732                printf(NAME ": Failed to create callback from input device\n");
     
    733734        }
    734735       
    735         async_new_connection(phonehash, 0, NULL, keyboard_events);
     736        async_new_connection(taskhash, phonehash, 0, NULL, keyboard_events);
    736737       
    737738        /* Connect to mouse device */
     
    750751        }
    751752       
    752         if (ipc_connect_to_me(mouse_phone, SERVICE_CONSOLE, 0, 0, NULL,
     753        if (ipc_connect_to_me(mouse_phone, SERVICE_CONSOLE, 0, 0, &taskhash,
    753754            &phonehash) != 0) {
    754755                printf(NAME ": Failed to create callback from mouse device\n");
     
    757758        }
    758759       
    759         async_new_connection(phonehash, 0, NULL, mouse_events);
     760        async_new_connection(taskhash, phonehash, 0, NULL, mouse_events);
    760761skip_mouse:
    761762       
  • uspace/srv/hid/kbd/port/adb.c

    r11bb813 r3c22f70  
    7171
    7272        /* NB: The callback connection is slotted for removal */
     73        sysarg_t taskhash;
    7374        sysarg_t phonehash;
    74         if (ipc_connect_to_me(dev_phone, 0, 0, 0, NULL, &phonehash) != 0) {
     75        if (ipc_connect_to_me(dev_phone, 0, 0, 0, &taskhash, &phonehash) != 0) {
    7576                printf(NAME ": Failed to create callback from device\n");
    7677                return false;
    7778        }
    7879
    79         async_new_connection(phonehash, 0, NULL, kbd_port_events);
     80        async_new_connection(taskhash, phonehash, 0, NULL, kbd_port_events);
    8081
    8182        return 0;
  • uspace/srv/hid/kbd/port/chardev.c

    r11bb813 r3c22f70  
    9191
    9292        /* NB: The callback connection is slotted for removal */
     93        sysarg_t taskhash;
    9394        sysarg_t phonehash;
    94         if (ipc_connect_to_me(dev_phone, 0, 0, 0, NULL, &phonehash) != 0) {
     95        if (ipc_connect_to_me(dev_phone, 0, 0, 0, &taskhash, &phonehash) != 0) {
    9596                printf(NAME ": Failed to create callback from device\n");
    9697                return -1;
    9798        }
    9899
    99         async_new_connection(phonehash, 0, NULL, kbd_port_events);
     100        async_new_connection(taskhash, phonehash, 0, NULL, kbd_port_events);
    100101
    101102        return 0;
Note: See TracChangeset for help on using the changeset viewer.