Changes in uspace/srv/ns/service.c [007e6efa:d9c8c81] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/ns/service.c
r007e6efa rd9c8c81 43 43 typedef struct { 44 44 link_t link; 45 sysarg_t service; /**< Service ID. */46 sysarg_t phone; /**< Phone registered with the service. */47 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. */ 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[0]% SERVICE_HASH_TABLE_CHAINS);61 return (*key % SERVICE_HASH_TABLE_CHAINS); 62 62 } 63 63 … … 86 86 87 87 if (keys == 2) 88 return ( (key[0] == hs->service) && (key[1] == hs->in_phone_hash));88 return (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 sysarg_t service; /**< Number of the service. */117 ipcarg_t service; /**< Number of the service. */ 118 118 ipc_callid_t callid; /**< Call ID waiting for the connection */ 119 sysarg_t arg2; /**< Second argument */120 sysarg_t arg3; /**< Third argument */119 ipcarg_t arg2; /**< Second argument */ 120 ipcarg_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 (void) ipc_forward_fast(pr->callid, hs->phone, pr->arg2, 159 pr->arg3, 0, IPC_FF_NONE); 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); 160 163 161 164 list_remove(cur); … … 174 177 * 175 178 */ 176 int register_service( sysarg_t service, sysarg_t phone, ipc_call_t *call)179 int register_service(ipcarg_t service, ipcarg_t phone, ipc_call_t *call) 177 180 { 178 181 unsigned long keys[3] = { … … 195 198 hash_table_insert(&service_hash_table, keys, &hs->link); 196 199 197 return EOK;200 return 0; 198 201 } 199 202 … … 207 210 * 208 211 */ 209 void connect_to_service( sysarg_t service, ipc_call_t *call, ipc_callid_t callid)210 { 211 sysarg_t retval;212 void connect_to_service(ipcarg_t service, ipc_call_t *call, ipc_callid_t callid) 213 { 214 ipcarg_t retval; 212 215 unsigned long keys[3] = { 213 216 service, … … 227 230 } 228 231 229 link_initialize(&pr->link);230 232 pr->service = service; 231 233 pr->callid = callid; … … 240 242 241 243 hashed_service_t *hs = hash_table_get_instance(link, hashed_service_t, link); 242 (void)ipc_forward_fast(callid, hs->phone, IPC_GET_ARG2(*call),244 retval = ipc_forward_fast(callid, hs->phone, IPC_GET_ARG2(*call), 243 245 IPC_GET_ARG3(*call), 0, IPC_FF_NONE); 244 return;245 246 246 247 out:
Note:
See TracChangeset
for help on using the changeset viewer.