Ignore:
File:
1 edited

Legend:

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

    r228e490 rc0699467  
    3737#include <adt/hash_table.h>
    3838#include <sys/typefmt.h>
    39 
     39#include <abi/ipc/methods.h>
    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 
    275 //      printf("parse_answer\n");
    276 
     274       
    277275        phone = pcall->phone_hash;
    278276        method = IPC_GET_IMETHOD(pcall->question);
    279277        retval = IPC_GET_RETVAL(*answer);
    280 
     278       
    281279        resp = answer->args;
    282 
     280       
    283281        if ((display_mask & DM_IPC) != 0) {
    284282                printf("Response to %p: retval=%" PRIdn ", args = (%" PRIun ", "
     
    288286                    IPC_GET_ARG4(*answer), IPC_GET_ARG5(*answer));
    289287        }
    290 
     288       
    291289        if ((display_mask & DM_USER) != 0) {
    292290                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))) {
    295294                        printf("->");
    296 
     295                       
    297296                        if (oper->rv_type != V_VOID) {
    298297                                putchar(' ');
     
    304303                                putchar('(');
    305304                                for (i = 1; i <= oper->respc; ++i) {
    306                                         if (i > 1) printf(", ");
     305                                        if (i > 1)
     306                                                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 == 0 && method == IPC_M_CONNECT_ME_TO && retval == 0) {
     315       
     316        if ((phone == PHONE_NS) && (method == IPC_M_CONNECT_ME_TO) &&
     317            (retval == 0)) {
    317318                /* Connected to a service (through NS) */
    318319                service = IPC_GET_ARG1(pcall->question);
    319320                proto = proto_get_by_srv(service);
    320                 if (proto == NULL) proto = proto_unknown;
    321 
     321                if (proto == NULL)
     322                        proto = proto_unknown;
     323               
    322324                cphone = IPC_GET_ARG5(*answer);
    323325                if ((display_mask & DM_SYSTEM) != 0) {
    324326                        printf("Registering connection (phone %d, protocol: %s)\n", cphone,
    325                                 proto->name);
    326                 }
     327                    proto->name);
     328                }
     329               
    327330                ipcp_connection_set(cphone, 0, proto);
    328331        }
     
    334337        pending_call_t *pcall;
    335338        unsigned long key[1];
    336 
    337 //      printf("ipcp_call_in()\n");
    338 
     339       
    339340        if ((hash & IPC_CALLID_ANSWERED) == 0 && hash != IPCP_CALLID_SYNC) {
    340341                /* Not a response */
     
    344345                return;
    345346        }
    346 
     347       
    347348        hash = hash & ~IPC_CALLID_ANSWERED;
    348349        key[0] = hash;
    349 
     350       
    350351        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       
    353355        /*
    354356         * Response matched to question.
     
    357359        pcall = hash_table_get_instance(item, pending_call_t, link);
    358360        hash_table_remove(&pending_calls, key, 1);
    359 
     361       
    360362        parse_answer(hash, pcall, call);
    361363        free(pcall);
Note: See TracChangeset for help on using the changeset viewer.