Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/udebug.c

    r79ae36dd r64d2b10  
    3535#include <udebug.h>
    3636#include <sys/types.h>
    37 #include <kernel/ipc/ipc_methods.h>
    3837#include <async.h>
    3938
    40 int udebug_begin(async_sess_t *sess)
     39int udebug_begin(int phoneid)
    4140{
    42         async_exch_t *exch = async_exchange_begin(sess);
    43         return async_req_1_0(exch, IPC_M_DEBUG, UDEBUG_M_BEGIN);
     41        return async_req_1_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_BEGIN);
    4442}
    4543
    46 int udebug_end(async_sess_t *sess)
     44int udebug_end(int phoneid)
    4745{
    48         async_exch_t *exch = async_exchange_begin(sess);
    49         return async_req_1_0(exch, IPC_M_DEBUG, UDEBUG_M_END);
     46        return async_req_1_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_END);
    5047}
    5148
    52 int udebug_set_evmask(async_sess_t *sess, udebug_evmask_t mask)
     49int udebug_set_evmask(int phoneid, udebug_evmask_t mask)
    5350{
    54         async_exch_t *exch = async_exchange_begin(sess);
    55         return async_req_2_0(exch, IPC_M_DEBUG, UDEBUG_M_SET_EVMASK, mask);
     51        return async_req_2_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_SET_EVMASK,
     52                mask);
    5653}
    5754
    58 int udebug_thread_read(async_sess_t *sess, void *buffer, size_t n,
    59     size_t *copied, size_t *needed)
     55int udebug_thread_read(int phoneid, void *buffer, size_t n,
     56        size_t *copied, size_t *needed)
    6057{
    6158        sysarg_t a_copied, a_needed;
    62        
    63         async_exch_t *exch = async_exchange_begin(sess);
    64         int rc = async_req_3_3(exch, IPC_M_DEBUG, UDEBUG_M_THREAD_READ,
    65             (sysarg_t) buffer, n, NULL, &a_copied, &a_needed);
    66        
    67         *copied = (size_t) a_copied;
    68         *needed = (size_t) a_needed;
    69        
     59        int rc;
     60
     61        rc = async_req_3_3(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_THREAD_READ,
     62                (sysarg_t)buffer, n, NULL, &a_copied, &a_needed);
     63
     64        *copied = (size_t)a_copied;
     65        *needed = (size_t)a_needed;
     66
    7067        return rc;
    7168}
    7269
    73 int udebug_name_read(async_sess_t *sess, void *buffer, size_t n,
    74     size_t *copied, size_t *needed)
     70int udebug_name_read(int phoneid, void *buffer, size_t n,
     71        size_t *copied, size_t *needed)
    7572{
    7673        sysarg_t a_copied, a_needed;
    77        
    78         async_exch_t *exch = async_exchange_begin(sess);
    79         int rc = async_req_3_3(exch, IPC_M_DEBUG, UDEBUG_M_NAME_READ,
    80             (sysarg_t) buffer, n, NULL, &a_copied, &a_needed);
    81        
    82         *copied = (size_t) a_copied;
    83         *needed = (size_t) a_needed;
    84        
     74        int rc;
     75
     76        rc = async_req_3_3(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_NAME_READ,
     77                (sysarg_t)buffer, n, NULL, &a_copied, &a_needed);
     78
     79        *copied = (size_t)a_copied;
     80        *needed = (size_t)a_needed;
     81
    8582        return rc;
    8683}
    8784
    88 int udebug_areas_read(async_sess_t *sess, void *buffer, size_t n,
    89     size_t *copied, size_t *needed)
     85int udebug_areas_read(int phoneid, void *buffer, size_t n,
     86        size_t *copied, size_t *needed)
    9087{
    9188        sysarg_t a_copied, a_needed;
    92        
    93         async_exch_t *exch = async_exchange_begin(sess);
    94         int rc = async_req_3_3(exch, IPC_M_DEBUG, UDEBUG_M_AREAS_READ,
    95             (sysarg_t) buffer, n, NULL, &a_copied, &a_needed);
    96        
    97         *copied = (size_t) a_copied;
    98         *needed = (size_t) a_needed;
    99        
     89        int rc;
     90
     91        rc = async_req_3_3(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_AREAS_READ,
     92                (sysarg_t)buffer, n, NULL, &a_copied, &a_needed);
     93
     94        *copied = (size_t)a_copied;
     95        *needed = (size_t)a_needed;
     96
    10097        return rc;
    10198}
    10299
    103 int udebug_mem_read(async_sess_t *sess, void *buffer, uintptr_t addr, size_t n)
     100int udebug_mem_read(int phoneid, void *buffer, uintptr_t addr, size_t n)
    104101{
    105         async_exch_t *exch = async_exchange_begin(sess);
    106         return async_req_4_0(exch, IPC_M_DEBUG, UDEBUG_M_MEM_READ,
    107             (sysarg_t) buffer, addr, n);
     102        return async_req_4_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_MEM_READ,
     103            (sysarg_t)buffer, addr, n);
    108104}
    109105
    110 int udebug_args_read(async_sess_t *sess, thash_t tid, sysarg_t *buffer)
     106int udebug_args_read(int phoneid, thash_t tid, sysarg_t *buffer)
    111107{
    112         async_exch_t *exch = async_exchange_begin(sess);
    113         return async_req_3_0(exch, IPC_M_DEBUG, UDEBUG_M_ARGS_READ,
    114             tid, (sysarg_t) buffer);
     108        return async_req_3_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_ARGS_READ,
     109            tid, (sysarg_t)buffer);
    115110}
    116111
    117 int udebug_regs_read(async_sess_t *sess, thash_t tid, void *buffer)
     112int udebug_regs_read(int phoneid, thash_t tid, void *buffer)
    118113{
    119         async_exch_t *exch = async_exchange_begin(sess);
    120         return async_req_3_0(exch, IPC_M_DEBUG, UDEBUG_M_REGS_READ,
    121             tid, (sysarg_t) buffer);
     114        return async_req_3_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_REGS_READ,
     115            tid, (sysarg_t)buffer);
    122116}
    123117
    124 int udebug_go(async_sess_t *sess, thash_t tid, udebug_event_t *ev_type,
     118int udebug_go(int phoneid, thash_t tid, udebug_event_t *ev_type,
    125119    sysarg_t *val0, sysarg_t *val1)
    126120{
    127121        sysarg_t a_ev_type;
    128        
    129         async_exch_t *exch = async_exchange_begin(sess);
    130         int rc = async_req_2_3(exch, IPC_M_DEBUG, UDEBUG_M_GO,
     122        int rc;
     123
     124        rc =  async_req_2_3(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_GO,
    131125            tid, &a_ev_type, val0, val1);
    132        
     126
    133127        *ev_type = a_ev_type;
    134128        return rc;
    135129}
    136130
    137 int udebug_stop(async_sess_t *sess, thash_t tid)
     131int udebug_stop(int phoneid, thash_t tid)
    138132{
    139         async_exch_t *exch = async_exchange_begin(sess);
    140         return async_req_2_0(exch, IPC_M_DEBUG, UDEBUG_M_STOP, tid);
     133        return async_req_2_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_STOP,
     134            tid);
    141135}
    142136
Note: See TracChangeset for help on using the changeset viewer.