Ignore:
File:
1 edited

Legend:

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

    rc1694b6b r7354b5e  
    3535#include <stdio.h>
    3636#include <stdlib.h>
    37 #include <str_error.h>
    3837#include <inttypes.h>
    3938#include <adt/hash_table.h>
     
    4544#include "ipcp.h"
    4645
     46#define IPCP_CALLID_SYNC 0
     47
    4748typedef struct {
    4849        sysarg_t phone_hash;
     
    144145                V_INTEGER,
    145146                V_INTEGER,
    146                 V_INTEGER
     147                V_INTEGER               
    147148        };
    148149
     
    188189
    189190        if ((display_mask & DM_IPC) != 0) {
    190                 printf("Call ID: %d, phone: %d, proto: %s, method: ",
    191                     hash, phone,
     191                printf("Call ID: %p, phone: %d, proto: %s, method: ",
     192                    (void *) hash, phone,
    192193                    (proto ? proto->name : "n/a"));
    193194                ipc_m_print(proto, IPC_GET_IMETHOD(*call));
     
    265266       
    266267        if ((display_mask & DM_IPC) != 0) {
    267                 printf("Response to %d: retval=%" PRIdn ", args = (%" PRIun ", "
     268                printf("Response to %p: retval=%" PRIdn ", args = (%" PRIun ", "
    268269                    "%" PRIun ", %" PRIun ", %" PRIun ", %" PRIun ")\n",
    269                     hash, retval, IPC_GET_ARG1(*answer),
     270                    (void *) hash, retval, IPC_GET_ARG1(*answer),
    270271                    IPC_GET_ARG2(*answer), IPC_GET_ARG3(*answer),
    271272                    IPC_GET_ARG4(*answer), IPC_GET_ARG5(*answer));
     
    322323        pending_call_t *pcall;
    323324       
    324         if ((call->flags & IPC_CALL_ANSWERED) == 0) {
     325        if ((hash & IPC_CALLID_ANSWERED) == 0 && hash != IPCP_CALLID_SYNC) {
    325326                /* Not a response */
    326327                if ((display_mask & DM_IPC) != 0) {
    327                         printf("Not a response (hash %d)\n", hash);
     328                        printf("Not a response (hash %p)\n", (void *) hash);
    328329                }
    329330                return;
    330331        }
     332       
     333        hash = hash & ~IPC_CALLID_ANSWERED;
    331334       
    332335        item = hash_table_find(&pending_calls, &hash);
     
    345348}
    346349
     350void 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
    347356void ipcp_hangup(int phone, int rc)
    348357{
    349358        if ((display_mask & DM_SYSTEM) != 0) {
    350                 printf("Hang phone %d up -> %s\n", phone, str_error_name(rc));
     359                printf("Hang phone %d up -> %d\n", phone, rc);
    351360                ipcp_connection_clear(phone);
    352361        }
Note: See TracChangeset for help on using the changeset viewer.