Ignore:
File:
1 edited

Legend:

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

    rc638c07 rc7bbf029  
    3535#include <assert.h>
    3636#include <errno.h>
     37#include <stdio.h>
     38#include <malloc.h>
    3739#include "service.h"
    3840#include "ns.h"
     
    4345typedef struct {
    4446        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. */
     47        sysarg_t service;        /**< Service ID. */
     48        sysarg_t phone;          /**< Phone registered with the service. */
     49        sysarg_t in_phone_hash;  /**< Incoming phone hash. */
    4850} hashed_service_t;
    4951
     
    5658 *
    5759 */
    58 static hash_index_t service_hash(unsigned long *key)
     60static hash_index_t service_hash(unsigned long key[])
    5961{
    6062        assert(key);
    61         return (*key % SERVICE_HASH_TABLE_CHAINS);
     63        return (key[0] % SERVICE_HASH_TABLE_CHAINS);
    6264}
    6365
     
    8688       
    8789        if (keys == 2)
    88                 return (key[1] == hs->in_phone_hash);
     90                return ((key[0] == hs->service) && (key[1] == hs->in_phone_hash));
    8991        else
    9092                return (key[0] == hs->service);
     
    115117typedef struct {
    116118        link_t link;
    117         ipcarg_t service;        /**< Number of the service. */
     119        sysarg_t service;        /**< Number of the service. */
    118120        ipc_callid_t callid;     /**< Call ID waiting for the connection */
    119         ipcarg_t arg2;           /**< Second argument */
    120         ipcarg_t arg3;           /**< Third argument */
     121        sysarg_t arg2;           /**< Second argument */
     122        sysarg_t arg3;           /**< Third argument */
    121123} pending_conn_t;
    122124
     
    174176 *
    175177 */
    176 int register_service(ipcarg_t service, ipcarg_t phone, ipc_call_t *call)
     178int register_service(sysarg_t service, sysarg_t phone, ipc_call_t *call)
    177179{
    178180        unsigned long keys[3] = {
     
    195197        hash_table_insert(&service_hash_table, keys, &hs->link);
    196198       
    197         return 0;
     199        return EOK;
    198200}
    199201
     
    207209 *
    208210 */
    209 void connect_to_service(ipcarg_t service, ipc_call_t *call, ipc_callid_t callid)
    210 {
    211         ipcarg_t retval;
     211void connect_to_service(sysarg_t service, ipc_call_t *call, ipc_callid_t callid)
     212{
     213        sysarg_t retval;
    212214        unsigned long keys[3] = {
    213215                service,
     
    227229                        }
    228230                       
     231                        link_initialize(&pr->link);
    229232                        pr->service = service;
    230233                        pr->callid = callid;
Note: See TracChangeset for help on using the changeset viewer.