Ignore:
File:
1 edited

Legend:

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

    rc7bbf029 rc638c07  
    3535#include <assert.h>
    3636#include <errno.h>
    37 #include <stdio.h>
    38 #include <malloc.h>
    3937#include "service.h"
    4038#include "ns.h"
     
    4543typedef struct {
    4644        link_t link;
    47         sysarg_t service;        /**< Service ID. */
    48         sysarg_t phone;          /**< Phone registered with the service. */
    49         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. */
    5048} hashed_service_t;
    5149
     
    5856 *
    5957 */
    60 static hash_index_t service_hash(unsigned long key[])
     58static hash_index_t service_hash(unsigned long *key)
    6159{
    6260        assert(key);
    63         return (key[0] % SERVICE_HASH_TABLE_CHAINS);
     61        return (*key % SERVICE_HASH_TABLE_CHAINS);
    6462}
    6563
     
    8886       
    8987        if (keys == 2)
    90                 return ((key[0] == hs->service) && (key[1] == hs->in_phone_hash));
     88                return (key[1] == hs->in_phone_hash);
    9189        else
    9290                return (key[0] == hs->service);
     
    117115typedef struct {
    118116        link_t link;
    119         sysarg_t service;        /**< Number of the service. */
     117        ipcarg_t service;        /**< Number of the service. */
    120118        ipc_callid_t callid;     /**< Call ID waiting for the connection */
    121         sysarg_t arg2;           /**< Second argument */
    122         sysarg_t arg3;           /**< Third argument */
     119        ipcarg_t arg2;           /**< Second argument */
     120        ipcarg_t arg3;           /**< Third argument */
    123121} pending_conn_t;
    124122
     
    176174 *
    177175 */
    178 int register_service(sysarg_t service, sysarg_t phone, ipc_call_t *call)
     176int register_service(ipcarg_t service, ipcarg_t phone, ipc_call_t *call)
    179177{
    180178        unsigned long keys[3] = {
     
    197195        hash_table_insert(&service_hash_table, keys, &hs->link);
    198196       
    199         return EOK;
     197        return 0;
    200198}
    201199
     
    209207 *
    210208 */
    211 void connect_to_service(sysarg_t service, ipc_call_t *call, ipc_callid_t callid)
    212 {
    213         sysarg_t retval;
     209void connect_to_service(ipcarg_t service, ipc_call_t *call, ipc_callid_t callid)
     210{
     211        ipcarg_t retval;
    214212        unsigned long keys[3] = {
    215213                service,
     
    229227                        }
    230228                       
    231                         link_initialize(&pr->link);
    232229                        pr->service = service;
    233230                        pr->callid = callid;
Note: See TracChangeset for help on using the changeset viewer.