Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/trace/ipcp.c

    rc0699467 r228e490  
    3737#include <adt/hash_table.h>
    3838#include <sys/typefmt.h>
    39 #include <abi/ipc/methods.h>
     39
    4040#include "ipc_desc.h"
    4141#include "proto.h"
     
    268268        proto_t *proto;
    269269        int cphone;
    270        
     270
    271271        sysarg_t *resp;
    272272        oper_t *oper;
    273273        int i;
    274        
     274
     275//      printf("parse_answer\n");
     276
    275277        phone = pcall->phone_hash;
    276278        method = IPC_GET_IMETHOD(pcall->question);
    277279        retval = IPC_GET_RETVAL(*answer);
    278        
     280
    279281        resp = answer->args;
    280        
     282
    281283        if ((display_mask & DM_IPC) != 0) {
    282284                printf("Response to %p: retval=%" PRIdn ", args = (%" PRIun ", "
     
    286288                    IPC_GET_ARG4(*answer), IPC_GET_ARG5(*answer));
    287289        }
    288        
     290
    289291        if ((display_mask & DM_USER) != 0) {
    290292                oper = pcall->oper;
    291                
    292                 if ((oper != NULL) &&
    293                     ((oper->rv_type != V_VOID) || (oper->respc > 0))) {
     293
     294                if (oper != NULL && (oper->rv_type != V_VOID || oper->respc > 0)) {
    294295                        printf("->");
    295                        
     296
    296297                        if (oper->rv_type != V_VOID) {
    297298                                putchar(' ');
     
    303304                                putchar('(');
    304305                                for (i = 1; i <= oper->respc; ++i) {
    305                                         if (i > 1)
    306                                                 printf(", ");
     306                                        if (i > 1) printf(", ");
    307307                                        val_print(resp[i], oper->resp_type[i - 1]);
    308308                                }
    309309                                putchar(')');
    310310                        }
    311                        
     311
    312312                        putchar('\n');
    313313                }
    314314        }
    315        
    316         if ((phone == PHONE_NS) && (method == IPC_M_CONNECT_ME_TO) &&
    317             (retval == 0)) {
     315
     316        if (phone == 0 && method == IPC_M_CONNECT_ME_TO && retval == 0) {
    318317                /* Connected to a service (through NS) */
    319318                service = IPC_GET_ARG1(pcall->question);
    320319                proto = proto_get_by_srv(service);
    321                 if (proto == NULL)
    322                         proto = proto_unknown;
    323                
     320                if (proto == NULL) proto = proto_unknown;
     321
    324322                cphone = IPC_GET_ARG5(*answer);
    325323                if ((display_mask & DM_SYSTEM) != 0) {
    326324                        printf("Registering connection (phone %d, protocol: %s)\n", cphone,
    327                     proto->name);
    328                 }
    329                
     325                                proto->name);
     326                }
    330327                ipcp_connection_set(cphone, 0, proto);
    331328        }
     
    337334        pending_call_t *pcall;
    338335        unsigned long key[1];
    339        
     336
     337//      printf("ipcp_call_in()\n");
     338
    340339        if ((hash & IPC_CALLID_ANSWERED) == 0 && hash != IPCP_CALLID_SYNC) {
    341340                /* Not a response */
     
    345344                return;
    346345        }
    347        
     346
    348347        hash = hash & ~IPC_CALLID_ANSWERED;
    349348        key[0] = hash;
    350        
     349
    351350        item = hash_table_find(&pending_calls, key);
    352         if (item == NULL)
    353                 return; /* No matching question found */
    354        
     351        if (item == NULL) return; // No matching question found
     352
    355353        /*
    356354         * Response matched to question.
     
    359357        pcall = hash_table_get_instance(item, pending_call_t, link);
    360358        hash_table_remove(&pending_calls, key, 1);
    361        
     359
    362360        parse_answer(hash, pcall, call);
    363361        free(pcall);
Note: See TracChangeset for help on using the changeset viewer.