Changeset a5c3f73 in mainline


Ignore:
Timestamp:
2008-09-19T11:30:04Z (16 years ago)
Author:
Jiri Svoboda <jirik.svoboda@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
356acd0
Parents:
f7176b1
Message:

trace: 64-bit-related fixes

Location:
uspace
Files:
3 edited

Legend:

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

    rf7176b1 ra5c3f73  
    4545
    4646typedef struct {
    47         int phone_hash;
     47        ipcarg_t phone_hash;
    4848        ipc_call_t question;
    4949        oper_t *oper;
    5050
    51         int call_hash;
     51        ipc_callid_t call_hash;
    5252
    5353        link_t link;
     
    9898        hs = hash_table_get_instance(item, pending_call_t, link);
    9999
     100        // FIXME: this will fail if sizeof(long) < sizeof(void *).
    100101        return key[0] == hs->call_hash;
    101102}
     
    135136
    136137        if (oper != NULL) {
    137                 printf("%s (%d)", oper->name, method);
     138                printf("%s (%ld)", oper->name, method);
    138139                return;
    139140        }
    140141
    141         printf("%d", method);
     142        printf("%ld", method);
    142143}
    143144
     
    199200
    200201        if ((display_mask & DM_IPC) != 0) {
    201                 printf("Call ID: 0x%x, phone: %d, proto: %s, method: ", hash,
     202                printf("Call ID: 0x%lx, phone: %d, proto: %s, method: ", hash,
    202203                        phone, (proto ? proto->name : "n/a"));
    203204                ipc_m_print(proto, IPC_GET_METHOD(*call));
    204                 printf(" args: (%u, %u, %u, %u, %u)\n", args[1], args[2],
     205                printf(" args: (%lu, %lu, %lu, %lu, %lu)\n", args[1], args[2],
    205206                    args[3], args[4], args[5]);
    206207        }
     
    258259    ipc_call_t *answer)
    259260{
    260         int phone;
     261        ipcarg_t phone;
    261262        ipcarg_t method;
    262263        ipcarg_t service;
    263         int retval;
     264        ipcarg_t retval;
    264265        proto_t *proto;
    265266        int cphone;
     
    278279
    279280        if ((display_mask & DM_IPC) != 0) {
    280                 printf("Response to 0x%x: retval=%d, args = (%u, %u, %u, %u, %u)\n",
     281                printf("Response to 0x%lx: retval=%ld, args = (%lu, %lu, %lu, %lu, %lu)\n",
    281282                        hash, retval, IPC_GET_ARG1(*answer),
    282283                        IPC_GET_ARG2(*answer), IPC_GET_ARG3(*answer),
     
    333334/*      printf("phone: %d, method: ", call->in_phone_hash);
    334335        ipc_m_print(IPC_GET_METHOD(*call));
    335         printf(" args: (%u, %u, %u, %u, %u)\n",
     336        printf(" args: (%lu, %lu, %lu, %lu, %lu)\n",
    336337            IPC_GET_ARG1(*call),
    337338            IPC_GET_ARG2(*call),
     
    344345                /* Not a response */
    345346                if ((display_mask & DM_IPC) != 0) {
    346                         printf("Not a response (hash %d)\n", hash);
     347                        printf("Not a response (hash 0x%lx)\n", hash);
    347348                }
    348349                return;
  • uspace/app/trace/trace.c

    rf7176b1 ra5c3f73  
    5656
    5757#define THBUF_SIZE 64
    58 unsigned thread_hash_buf[THBUF_SIZE];
    59 unsigned n_threads;
     58uintptr_t thread_hash_buf[THBUF_SIZE];
     59int n_threads;
    6060
    6161int next_thread_id;
     
    6464int abort_trace;
    6565
    66 unsigned thash;
     66uintptr_t thash;
    6767volatile int paused;
    6868
    69 void thread_trace_start(unsigned thread_hash);
     69void thread_trace_start(uintptr_t thread_hash);
    7070
    7171static proto_t *proto_console;
     
    126126        }
    127127
    128         n_threads = tb_copied / sizeof(unsigned);
     128        n_threads = tb_copied / sizeof(uintptr_t);
    129129
    130130        printf("Threads:");
    131131        for (i = 0; i < n_threads; i++) {
    132                 printf(" [%d] (hash 0x%x)", 1+i, thread_hash_buf[i]);
    133         }
    134         printf("\ntotal of %u threads\n", tb_needed/sizeof(unsigned));
     132                printf(" [%d] (hash 0x%lx)", 1+i, thread_hash_buf[i]);
     133        }
     134        printf("\ntotal of %u threads\n", tb_needed / sizeof(uintptr_t));
    135135
    136136        return 0;
     
    197197}
    198198
    199 static void print_sc_args(unsigned *sc_args, int n)
     199static void print_sc_args(sysarg_t *sc_args, int n)
    200200{
    201201        int i;
    202202
    203203        putchar('(');
    204         if (n > 0) printf("%d", sc_args[0]);
     204        if (n > 0) printf("%ld", sc_args[0]);
    205205        for (i = 1; i < n; i++) {
    206                 printf(", %d", sc_args[i]);
     206                printf(", %ld", sc_args[i]);
    207207        }
    208208        putchar(')');
    209209}
    210210
    211 static void sc_ipc_call_async_fast(unsigned *sc_args, int sc_rc)
     211static void sc_ipc_call_async_fast(sysarg_t *sc_args, sysarg_t sc_rc)
    212212{
    213213        ipc_call_t call;
    214         int phoneid;
     214        ipcarg_t phoneid;
    215215       
    216216        if (sc_rc == IPC_CALLRET_FATAL || sc_rc == IPC_CALLRET_TEMPORARY)
     
    229229}
    230230
    231 static void sc_ipc_call_async_slow(unsigned *sc_args, int sc_rc)
     231static void sc_ipc_call_async_slow(sysarg_t *sc_args, sysarg_t sc_rc)
    232232{
    233233        ipc_call_t call;
     
    245245}
    246246
    247 static void sc_ipc_call_sync_fast(unsigned *sc_args)
     247static void sc_ipc_call_sync_fast(sysarg_t *sc_args)
    248248{
    249249        ipc_call_t question, reply;
     
    273273}
    274274
    275 static void sc_ipc_call_sync_slow(unsigned *sc_args)
     275static void sc_ipc_call_sync_slow(sysarg_t *sc_args)
    276276{
    277277        ipc_call_t question, reply;
     
    291291}
    292292
    293 static void sc_ipc_wait(unsigned *sc_args, int sc_rc)
     293static void sc_ipc_wait(sysarg_t *sc_args, int sc_rc)
    294294{
    295295        ipc_call_t call;
     
    308308}
    309309
    310 static void event_syscall_b(unsigned thread_id, unsigned thread_hash,  unsigned sc_id, int sc_rc)
    311 {
    312         unsigned sc_args[6];
     310static void event_syscall_b(unsigned thread_id, uintptr_t thread_hash,
     311    unsigned sc_id, sysarg_t sc_rc)
     312{
     313        sysarg_t sc_args[6];
    313314        int rc;
    314315
     
    335336}
    336337
    337 static void event_syscall_e(unsigned thread_id, unsigned thread_hash,  unsigned sc_id, int sc_rc)
    338 {
    339         unsigned sc_args[6];
     338static void event_syscall_e(unsigned thread_id, uintptr_t thread_hash,
     339    unsigned sc_id, sysarg_t sc_rc)
     340{
     341        sysarg_t sc_args[6];
    340342        int rv_type;
    341343        int rc;
     
    383385}
    384386
    385 static void event_thread_b(unsigned hash)
     387static void event_thread_b(uintptr_t hash)
    386388{
    387389        async_serialize_start();
    388         printf("New thread, hash 0x%x\n", hash);
     390        printf("New thread, hash 0x%lx\n", hash);
    389391        async_serialize_end();
    390392
     
    396398        int rc;
    397399        unsigned ev_type;
    398         unsigned thread_hash;
     400        uintptr_t thread_hash;
    399401        unsigned thread_id;
    400         unsigned val0, val1;
    401 
    402         thread_hash = (unsigned)thread_hash_arg;
     402        sysarg_t val0, val1;
     403
     404        thread_hash = (uintptr_t)thread_hash_arg;
    403405        thread_id = next_thread_id++;
    404406
    405         printf("Start tracing thread [%d] (hash 0x%x)\n", thread_id, thread_hash);
     407        printf("Start tracing thread [%d] (hash 0x%lx)\n", thread_id, thread_hash);
    406408
    407409        while (!abort_trace) {
     
    439441                                break;
    440442                        case UDEBUG_EVENT_THREAD_E:
    441                                 printf("Thread 0x%x exited\n", val0);
     443                                printf("Thread 0x%lx exited\n", val0);
    442444                                abort_trace = 1;
    443445                                break;
     
    454456}
    455457
    456 void thread_trace_start(unsigned thread_hash)
     458void thread_trace_start(uintptr_t thread_hash)
    457459{
    458460        fid_t fid;
     
    673675
    674676        if (task_id != 0) {
    675                 if (argc == 0) return;
     677                if (argc == 0) return 0;
    676678                printf("Extra arguments\n");
    677679                print_syntax();
  • uspace/lib/libc/generic/udebug.c

    rf7176b1 ra5c3f73  
    5858        size_t *copied, size_t *needed)
    5959{
    60         unsigned dest_addr;
    61 
    6260        return async_req_3_3(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_THREAD_READ,
    63                 (sysarg_t)buffer, n, &dest_addr, copied, needed);
     61                (sysarg_t)buffer, n, NULL, copied, needed);
    6462}
    6563
Note: See TracChangeset for help on using the changeset viewer.