Changeset 41811af in mainline for uspace/lib/c/generic/udebug.c


Ignore:
Timestamp:
2011-06-10T10:14:26Z (14 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ab547063
Parents:
9536e6e (diff), 390d80d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline

File:
1 edited

Legend:

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

    r9536e6e r41811af  
    3535#include <udebug.h>
    3636#include <sys/types.h>
     37#include <kernel/ipc/ipc_methods.h>
    3738#include <async.h>
    3839
    39 int udebug_begin(int phoneid)
     40int udebug_begin(async_sess_t *sess)
    4041{
    41         return async_req_1_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_BEGIN);
     42        async_exch_t *exch = async_exchange_begin(sess);
     43        return async_req_1_0(exch, IPC_M_DEBUG, UDEBUG_M_BEGIN);
    4244}
    4345
    44 int udebug_end(int phoneid)
     46int udebug_end(async_sess_t *sess)
    4547{
    46         return async_req_1_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_END);
     48        async_exch_t *exch = async_exchange_begin(sess);
     49        return async_req_1_0(exch, IPC_M_DEBUG, UDEBUG_M_END);
    4750}
    4851
    49 int udebug_set_evmask(int phoneid, udebug_evmask_t mask)
     52int udebug_set_evmask(async_sess_t *sess, udebug_evmask_t mask)
    5053{
    51         return async_req_2_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_SET_EVMASK,
    52                 mask);
     54        async_exch_t *exch = async_exchange_begin(sess);
     55        return async_req_2_0(exch, IPC_M_DEBUG, UDEBUG_M_SET_EVMASK, mask);
    5356}
    5457
    55 int udebug_thread_read(int phoneid, void *buffer, size_t n,
    56         size_t *copied, size_t *needed)
     58int udebug_thread_read(async_sess_t *sess, void *buffer, size_t n,
     59    size_t *copied, size_t *needed)
    5760{
    5861        sysarg_t a_copied, a_needed;
    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 
     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       
    6770        return rc;
    6871}
    6972
    70 int udebug_name_read(int phoneid, void *buffer, size_t n,
    71         size_t *copied, size_t *needed)
     73int udebug_name_read(async_sess_t *sess, void *buffer, size_t n,
     74    size_t *copied, size_t *needed)
    7275{
    7376        sysarg_t a_copied, a_needed;
    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 
     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       
    8285        return rc;
    8386}
    8487
    85 int udebug_areas_read(int phoneid, void *buffer, size_t n,
    86         size_t *copied, size_t *needed)
     88int udebug_areas_read(async_sess_t *sess, void *buffer, size_t n,
     89    size_t *copied, size_t *needed)
    8790{
    8891        sysarg_t a_copied, a_needed;
    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 
     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       
    97100        return rc;
    98101}
    99102
    100 int udebug_mem_read(int phoneid, void *buffer, uintptr_t addr, size_t n)
     103int udebug_mem_read(async_sess_t *sess, void *buffer, uintptr_t addr, size_t n)
    101104{
    102         return async_req_4_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_MEM_READ,
    103             (sysarg_t)buffer, addr, n);
     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);
    104108}
    105109
    106 int udebug_args_read(int phoneid, thash_t tid, sysarg_t *buffer)
     110int udebug_args_read(async_sess_t *sess, thash_t tid, sysarg_t *buffer)
    107111{
    108         return async_req_3_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_ARGS_READ,
    109             tid, (sysarg_t)buffer);
     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);
    110115}
    111116
    112 int udebug_regs_read(int phoneid, thash_t tid, void *buffer)
     117int udebug_regs_read(async_sess_t *sess, thash_t tid, void *buffer)
    113118{
    114         return async_req_3_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_REGS_READ,
    115             tid, (sysarg_t)buffer);
     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);
    116122}
    117123
    118 int udebug_go(int phoneid, thash_t tid, udebug_event_t *ev_type,
     124int udebug_go(async_sess_t *sess, thash_t tid, udebug_event_t *ev_type,
    119125    sysarg_t *val0, sysarg_t *val1)
    120126{
    121127        sysarg_t a_ev_type;
    122         int rc;
    123 
    124         rc =  async_req_2_3(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_GO,
     128       
     129        async_exch_t *exch = async_exchange_begin(sess);
     130        int rc = async_req_2_3(exch, IPC_M_DEBUG, UDEBUG_M_GO,
    125131            tid, &a_ev_type, val0, val1);
    126 
     132       
    127133        *ev_type = a_ev_type;
    128134        return rc;
    129135}
    130136
    131 int udebug_stop(int phoneid, thash_t tid)
     137int udebug_stop(async_sess_t *sess, thash_t tid)
    132138{
    133         return async_req_2_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_STOP,
    134             tid);
     139        async_exch_t *exch = async_exchange_begin(sess);
     140        return async_req_2_0(exch, IPC_M_DEBUG, UDEBUG_M_STOP, tid);
    135141}
    136142
Note: See TracChangeset for help on using the changeset viewer.