Changes in uspace/srv/ns/service.c [d9c8c81:007e6efa] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/ns/service.c
rd9c8c81 r007e6efa 43 43 typedef struct { 44 44 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. */ 48 48 } hashed_service_t; 49 49 … … 56 56 * 57 57 */ 58 static hash_index_t service_hash(unsigned long *key)58 static hash_index_t service_hash(unsigned long key[]) 59 59 { 60 60 assert(key); 61 return ( *key% SERVICE_HASH_TABLE_CHAINS);61 return (key[0] % SERVICE_HASH_TABLE_CHAINS); 62 62 } 63 63 … … 86 86 87 87 if (keys == 2) 88 return ( key[1] == hs->in_phone_hash);88 return ((key[0] == hs->service) && (key[1] == hs->in_phone_hash)); 89 89 else 90 90 return (key[0] == hs->service); … … 115 115 typedef struct { 116 116 link_t link; 117 ipcarg_t service; /**< Number of the service. */117 sysarg_t service; /**< Number of the service. */ 118 118 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 */ 121 121 } pending_conn_t; 122 122 … … 156 156 157 157 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); 163 160 164 161 list_remove(cur); … … 177 174 * 178 175 */ 179 int register_service( ipcarg_t service, ipcarg_t phone, ipc_call_t *call)176 int register_service(sysarg_t service, sysarg_t phone, ipc_call_t *call) 180 177 { 181 178 unsigned long keys[3] = { … … 198 195 hash_table_insert(&service_hash_table, keys, &hs->link); 199 196 200 return 0;197 return EOK; 201 198 } 202 199 … … 210 207 * 211 208 */ 212 void connect_to_service( ipcarg_t service, ipc_call_t *call, ipc_callid_t callid)213 { 214 ipcarg_t retval;209 void connect_to_service(sysarg_t service, ipc_call_t *call, ipc_callid_t callid) 210 { 211 sysarg_t retval; 215 212 unsigned long keys[3] = { 216 213 service, … … 230 227 } 231 228 229 link_initialize(&pr->link); 232 230 pr->service = service; 233 231 pr->callid = callid; … … 242 240 243 241 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), 245 243 IPC_GET_ARG3(*call), 0, IPC_FF_NONE); 244 return; 246 245 247 246 out:
Note:
See TracChangeset
for help on using the changeset viewer.