Changeset 41811af in mainline for uspace/app/trace/ipcp.c
- Timestamp:
- 2011-06-10T10:14:26Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ab547063
- Parents:
- 9536e6e (diff), 390d80d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/trace/ipcp.c
r9536e6e r41811af 37 37 #include <adt/hash_table.h> 38 38 #include <sys/typefmt.h> 39 39 #include <kernel/ipc/ipc_methods.h> 40 40 #include "ipc_desc.h" 41 41 #include "proto.h" … … 268 268 proto_t *proto; 269 269 int cphone; 270 270 271 271 sysarg_t *resp; 272 272 oper_t *oper; 273 273 int i; 274 275 // printf("parse_answer\n"); 276 274 277 275 phone = pcall->phone_hash; 278 276 method = IPC_GET_IMETHOD(pcall->question); 279 277 retval = IPC_GET_RETVAL(*answer); 280 278 281 279 resp = answer->args; 282 280 283 281 if ((display_mask & DM_IPC) != 0) { 284 282 printf("Response to %p: retval=%" PRIdn ", args = (%" PRIun ", " … … 288 286 IPC_GET_ARG4(*answer), IPC_GET_ARG5(*answer)); 289 287 } 290 288 291 289 if ((display_mask & DM_USER) != 0) { 292 290 oper = pcall->oper; 293 294 if (oper != NULL && (oper->rv_type != V_VOID || oper->respc > 0)) { 291 292 if ((oper != NULL) && 293 ((oper->rv_type != V_VOID) || (oper->respc > 0))) { 295 294 printf("->"); 296 295 297 296 if (oper->rv_type != V_VOID) { 298 297 putchar(' '); … … 304 303 putchar('('); 305 304 for (i = 1; i <= oper->respc; ++i) { 306 if (i > 1) printf(", "); 305 if (i > 1) 306 printf(", "); 307 307 val_print(resp[i], oper->resp_type[i - 1]); 308 308 } 309 309 putchar(')'); 310 310 } 311 311 312 312 putchar('\n'); 313 313 } 314 314 } 315 316 if (phone == 0 && method == IPC_M_CONNECT_ME_TO && retval == 0) { 315 316 if ((phone == PHONE_NS) && (method == IPC_M_CONNECT_ME_TO) && 317 (retval == 0)) { 317 318 /* Connected to a service (through NS) */ 318 319 service = IPC_GET_ARG1(pcall->question); 319 320 proto = proto_get_by_srv(service); 320 if (proto == NULL) proto = proto_unknown; 321 321 if (proto == NULL) 322 proto = proto_unknown; 323 322 324 cphone = IPC_GET_ARG5(*answer); 323 325 if ((display_mask & DM_SYSTEM) != 0) { 324 326 printf("Registering connection (phone %d, protocol: %s)\n", cphone, 325 proto->name); 326 } 327 proto->name); 328 } 329 327 330 ipcp_connection_set(cphone, 0, proto); 328 331 } … … 334 337 pending_call_t *pcall; 335 338 unsigned long key[1]; 336 337 // printf("ipcp_call_in()\n"); 338 339 339 340 if ((hash & IPC_CALLID_ANSWERED) == 0 && hash != IPCP_CALLID_SYNC) { 340 341 /* Not a response */ … … 344 345 return; 345 346 } 346 347 347 348 hash = hash & ~IPC_CALLID_ANSWERED; 348 349 key[0] = hash; 349 350 350 351 item = hash_table_find(&pending_calls, key); 351 if (item == NULL) return; // No matching question found 352 352 if (item == NULL) 353 return; /* No matching question found */ 354 353 355 /* 354 356 * Response matched to question. … … 357 359 pcall = hash_table_get_instance(item, pending_call_t, link); 358 360 hash_table_remove(&pending_calls, key, 1); 359 361 360 362 parse_answer(hash, pcall, call); 361 363 free(pcall);
Note:
See TracChangeset
for help on using the changeset viewer.