Ignore:
File:
1 edited

Legend:

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

    r7354b5e r1569a9b  
    3535#include <stdio.h>
    3636#include <stdlib.h>
     37#include <str_error.h>
    3738#include <inttypes.h>
    3839#include <adt/hash_table.h>
     
    4445#include "ipcp.h"
    4546
    46 #define IPCP_CALLID_SYNC 0
    47 
    4847typedef struct {
    4948        sysarg_t phone_hash;
     
    145144                V_INTEGER,
    146145                V_INTEGER,
    147                 V_INTEGER               
     146                V_INTEGER
    148147        };
    149148
     
    189188
    190189        if ((display_mask & DM_IPC) != 0) {
    191                 printf("Call ID: %p, phone: %d, proto: %s, method: ",
    192                     (void *) hash, phone,
     190                printf("Call ID: %d, phone: %d, proto: %s, method: ",
     191                    hash, phone,
    193192                    (proto ? proto->name : "n/a"));
    194193                ipc_m_print(proto, IPC_GET_IMETHOD(*call));
     
    251250        sysarg_t method;
    252251        sysarg_t service;
    253         sysarg_t retval;
     252        int retval;
    254253        proto_t *proto;
    255254        int cphone;
     
    266265       
    267266        if ((display_mask & DM_IPC) != 0) {
    268                 printf("Response to %p: retval=%" PRIdn ", args = (%" PRIun ", "
     267                printf("Response to %d: retval=%s, args = (%" PRIun ", "
    269268                    "%" PRIun ", %" PRIun ", %" PRIun ", %" PRIun ")\n",
    270                     (void *) hash, retval, IPC_GET_ARG1(*answer),
     269                    hash, str_error_name(retval), IPC_GET_ARG1(*answer),
    271270                    IPC_GET_ARG2(*answer), IPC_GET_ARG3(*answer),
    272271                    IPC_GET_ARG4(*answer), IPC_GET_ARG5(*answer));
     
    282281                        if (oper->rv_type != V_VOID) {
    283282                                putchar(' ');
    284                                 val_print(retval, oper->rv_type);
     283                                val_print((sysarg_t) retval, oper->rv_type);
    285284                        }
    286285                       
     
    323322        pending_call_t *pcall;
    324323       
    325         if ((hash & IPC_CALLID_ANSWERED) == 0 && hash != IPCP_CALLID_SYNC) {
     324        if ((call->flags & IPC_CALL_ANSWERED) == 0) {
    326325                /* Not a response */
    327326                if ((display_mask & DM_IPC) != 0) {
    328                         printf("Not a response (hash %p)\n", (void *) hash);
     327                        printf("Not a response (hash %d)\n", hash);
    329328                }
    330329                return;
    331330        }
    332        
    333         hash = hash & ~IPC_CALLID_ANSWERED;
    334331       
    335332        item = hash_table_find(&pending_calls, &hash);
     
    348345}
    349346
    350 void ipcp_call_sync(int phone, ipc_call_t *call, ipc_call_t *answer)
    351 {
    352         ipcp_call_out(phone, call, IPCP_CALLID_SYNC);
    353         ipcp_call_in(answer, IPCP_CALLID_SYNC);
    354 }
    355 
    356347void ipcp_hangup(int phone, int rc)
    357348{
    358349        if ((display_mask & DM_SYSTEM) != 0) {
    359                 printf("Hang phone %d up -> %d\n", phone, rc);
     350                printf("Hang phone %d up -> %s\n", phone, str_error_name(rc));
    360351                ipcp_connection_clear(phone);
    361352        }
Note: See TracChangeset for help on using the changeset viewer.