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