Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/ns/service.c

    r007e6efa rd9c8c81  
    4343typedef struct {
    4444        link_t link;
    45         sysarg_t service;        /**< Service ID. */
    46         sysarg_t phone;          /**< Phone registered with the service. */
    47         sysarg_t in_phone_hash;  /**< Incoming phone hash. */
     45        ipcarg_t service;        /**< Number of the service. */
     46        ipcarg_t phone;          /**< Phone registered with the service. */
     47        ipcarg_t in_phone_hash;  /**< Incoming phone hash. */
    4848} hashed_service_t;
    4949
     
    5656 *
    5757 */
    58 static hash_index_t service_hash(unsigned long key[])
     58static hash_index_t service_hash(unsigned long *key)
    5959{
    6060        assert(key);
    61         return (key[0] % SERVICE_HASH_TABLE_CHAINS);
     61        return (*key % SERVICE_HASH_TABLE_CHAINS);
    6262}
    6363
     
    8686       
    8787        if (keys == 2)
    88                 return ((key[0] == hs->service) && (key[1] == hs->in_phone_hash));
     88                return (key[1] == hs->in_phone_hash);
    8989        else
    9090                return (key[0] == hs->service);
     
    115115typedef struct {
    116116        link_t link;
    117         sysarg_t service;        /**< Number of the service. */
     117        ipcarg_t service;        /**< Number of the service. */
    118118        ipc_callid_t callid;     /**< Call ID waiting for the connection */
    119         sysarg_t arg2;           /**< Second argument */
    120         sysarg_t arg3;           /**< Third argument */
     119        ipcarg_t arg2;           /**< Second argument */
     120        ipcarg_t arg3;           /**< Third argument */
    121121} pending_conn_t;
    122122
     
    156156               
    157157                hashed_service_t *hs = hash_table_get_instance(link, hashed_service_t, link);
    158                 (void) ipc_forward_fast(pr->callid, hs->phone, pr->arg2,
    159                     pr->arg3, 0, IPC_FF_NONE);
     158                ipcarg_t retval = ipc_forward_fast(pr->callid, hs->phone,
     159                    pr->arg2, pr->arg3, 0, IPC_FF_NONE);
     160               
     161                if (!(pr->callid & IPC_CALLID_NOTIFICATION))
     162                        ipc_answer_0(pr->callid, retval);
    160163               
    161164                list_remove(cur);
     
    174177 *
    175178 */
    176 int register_service(sysarg_t service, sysarg_t phone, ipc_call_t *call)
     179int register_service(ipcarg_t service, ipcarg_t phone, ipc_call_t *call)
    177180{
    178181        unsigned long keys[3] = {
     
    195198        hash_table_insert(&service_hash_table, keys, &hs->link);
    196199       
    197         return EOK;
     200        return 0;
    198201}
    199202
     
    207210 *
    208211 */
    209 void connect_to_service(sysarg_t service, ipc_call_t *call, ipc_callid_t callid)
    210 {
    211         sysarg_t retval;
     212void connect_to_service(ipcarg_t service, ipc_call_t *call, ipc_callid_t callid)
     213{
     214        ipcarg_t retval;
    212215        unsigned long keys[3] = {
    213216                service,
     
    227230                        }
    228231                       
    229                         link_initialize(&pr->link);
    230232                        pr->service = service;
    231233                        pr->callid = callid;
     
    240242       
    241243        hashed_service_t *hs = hash_table_get_instance(link, hashed_service_t, link);
    242         (void) ipc_forward_fast(callid, hs->phone, IPC_GET_ARG2(*call),
     244        retval = ipc_forward_fast(callid, hs->phone, IPC_GET_ARG2(*call),
    243245            IPC_GET_ARG3(*call), 0, IPC_FF_NONE);
    244         return;
    245246       
    246247out:
Note: See TracChangeset for help on using the changeset viewer.