Changes in uspace/srv/ns/service.c [c7bbf029:c638c07] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/ns/service.c
rc7bbf029 rc638c07 35 35 #include <assert.h> 36 36 #include <errno.h> 37 #include <stdio.h>38 #include <malloc.h>39 37 #include "service.h" 40 38 #include "ns.h" … … 45 43 typedef struct { 46 44 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. */ 50 48 } hashed_service_t; 51 49 … … 58 56 * 59 57 */ 60 static hash_index_t service_hash(unsigned long key[])58 static hash_index_t service_hash(unsigned long *key) 61 59 { 62 60 assert(key); 63 return ( key[0]% SERVICE_HASH_TABLE_CHAINS);61 return (*key % SERVICE_HASH_TABLE_CHAINS); 64 62 } 65 63 … … 88 86 89 87 if (keys == 2) 90 return ( (key[0] == hs->service) && (key[1] == hs->in_phone_hash));88 return (key[1] == hs->in_phone_hash); 91 89 else 92 90 return (key[0] == hs->service); … … 117 115 typedef struct { 118 116 link_t link; 119 sysarg_t service; /**< Number of the service. */117 ipcarg_t service; /**< Number of the service. */ 120 118 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 */ 123 121 } pending_conn_t; 124 122 … … 176 174 * 177 175 */ 178 int register_service( sysarg_t service, sysarg_t phone, ipc_call_t *call)176 int register_service(ipcarg_t service, ipcarg_t phone, ipc_call_t *call) 179 177 { 180 178 unsigned long keys[3] = { … … 197 195 hash_table_insert(&service_hash_table, keys, &hs->link); 198 196 199 return EOK;197 return 0; 200 198 } 201 199 … … 209 207 * 210 208 */ 211 void connect_to_service( sysarg_t service, ipc_call_t *call, ipc_callid_t callid)212 { 213 sysarg_t retval;209 void connect_to_service(ipcarg_t service, ipc_call_t *call, ipc_callid_t callid) 210 { 211 ipcarg_t retval; 214 212 unsigned long keys[3] = { 215 213 service, … … 229 227 } 230 228 231 link_initialize(&pr->link);232 229 pr->service = service; 233 230 pr->callid = callid;
Note:
See TracChangeset
for help on using the changeset viewer.