Changeset 9d12059 in mainline


Ignore:
Timestamp:
2011-01-09T12:16:00Z (13 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0c70f7e, a676574
Parents:
bc5ffeb
Message:

Pass arg1 directly to async_session_create(). arg1 will be used often, so make it easy to use. Also when arg1 is used as portid, (phone, portid) is a port reference, so the two fields belong together and could be potentially fused together in the future.

Location:
uspace
Files:
3 edited

Legend:

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

    rbc5ffeb r9d12059  
    150150 * @param sess  Session structure provided by caller, will be filled in.
    151151 * @param phone Phone connected to the desired server task.
    152  */
    153 void async_session_create(async_sess_t *sess, int phone)
     152 * @param arg1  Value to pass as first argument upon creating a new
     153 *              connection. Typical use is to identify a resource within
     154 *              the server that the caller wants to access (port ID,
     155 *              interface ID, device ID, etc.).
     156 */
     157void async_session_create(async_sess_t *sess, int phone, sysarg_t arg1)
    154158{
    155159        sess->sess_phone = phone;
    156         sess->connect_arg1 = 0;
     160        sess->connect_arg1 = arg1;
    157161        list_initialize(&sess->conn_head);
    158162       
     
    160164        fibril_mutex_lock(&async_sess_mutex);
    161165        list_append(&sess->sess_link, &session_list_head);
    162         fibril_mutex_unlock(&async_sess_mutex);
    163 }
    164 
    165 void async_session_set_connect_args(async_sess_t *sess, sysarg_t arg1)
    166 {
    167         fibril_mutex_lock(&async_sess_mutex);
    168         sess->connect_arg1 = arg1;
    169166        fibril_mutex_unlock(&async_sess_mutex);
    170167}
  • uspace/lib/c/include/async_sess.h

    rbc5ffeb r9d12059  
    4646
    4747extern void _async_sess_init(void);
    48 extern void async_session_create(async_sess_t *, int);
    49 extern void async_session_set_connect_args(async_sess_t *, sysarg_t);
     48extern void async_session_create(async_sess_t *, int, sysarg_t);
    5049extern void async_session_destroy(async_sess_t *);
    5150extern int async_exchange_begin(async_sess_t *);
  • uspace/srv/vfs/vfs_register.c

    rbc5ffeb r9d12059  
    188188       
    189189        phone = IPC_GET_ARG5(call);
    190         async_session_create(&fs_info->session, phone);
     190        async_session_create(&fs_info->session, phone, 0);
    191191        ipc_answer_0(callid, EOK);
    192192       
Note: See TracChangeset for help on using the changeset viewer.