Changeset 9d12059 in mainline for uspace/lib/c/generic/async_sess.c


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.

File:
1 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}
Note: See TracChangeset for help on using the changeset viewer.