Ignore:
File:
1 edited

Legend:

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

    rd9c8c81 r007e6efa  
    4343typedef struct {
    4444        link_t link;
    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. */
     45        sysarg_t service;        /**< Service ID. */
     46        sysarg_t phone;          /**< Phone registered with the service. */
     47        sysarg_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 % SERVICE_HASH_TABLE_CHAINS);
     61        return (key[0] % SERVICE_HASH_TABLE_CHAINS);
    6262}
    6363
     
    8686       
    8787        if (keys == 2)
    88                 return (key[1] == hs->in_phone_hash);
     88                return ((key[0] == hs->service) && (key[1] == hs->in_phone_hash));
    8989        else
    9090                return (key[0] == hs->service);
     
    115115typedef struct {
    116116        link_t link;
    117         ipcarg_t service;        /**< Number of the service. */
     117        sysarg_t service;        /**< Number of the service. */
    118118        ipc_callid_t callid;     /**< Call ID waiting for the connection */
    119         ipcarg_t arg2;           /**< Second argument */
    120         ipcarg_t arg3;           /**< Third argument */
     119        sysarg_t arg2;           /**< Second argument */
     120        sysarg_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                 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);
     158                (void) ipc_forward_fast(pr->callid, hs->phone, pr->arg2,
     159                    pr->arg3, 0, IPC_FF_NONE);
    163160               
    164161                list_remove(cur);
     
    177174 *
    178175 */
    179 int register_service(ipcarg_t service, ipcarg_t phone, ipc_call_t *call)
     176int register_service(sysarg_t service, sysarg_t phone, ipc_call_t *call)
    180177{
    181178        unsigned long keys[3] = {
     
    198195        hash_table_insert(&service_hash_table, keys, &hs->link);
    199196       
    200         return 0;
     197        return EOK;
    201198}
    202199
     
    210207 *
    211208 */
    212 void connect_to_service(ipcarg_t service, ipc_call_t *call, ipc_callid_t callid)
    213 {
    214         ipcarg_t retval;
     209void connect_to_service(sysarg_t service, ipc_call_t *call, ipc_callid_t callid)
     210{
     211        sysarg_t retval;
    215212        unsigned long keys[3] = {
    216213                service,
     
    230227                        }
    231228                       
     229                        link_initialize(&pr->link);
    232230                        pr->service = service;
    233231                        pr->callid = callid;
     
    242240       
    243241        hashed_service_t *hs = hash_table_get_instance(link, hashed_service_t, link);
    244         retval = ipc_forward_fast(callid, hs->phone, IPC_GET_ARG2(*call),
     242        (void) ipc_forward_fast(callid, hs->phone, IPC_GET_ARG2(*call),
    245243            IPC_GET_ARG3(*call), 0, IPC_FF_NONE);
     244        return;
    246245       
    247246out:
Note: See TracChangeset for help on using the changeset viewer.