Rev 2853 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2832 | svoboda | 1 | /** @addtogroup sctrace |
2 | * @{ |
||
3 | */ |
||
4 | /** @file |
||
5 | */ |
||
6 | |||
7 | #include <stdio.h> |
||
8 | #include <syscall.h> |
||
9 | #include <ipc/ipc.h> |
||
2835 | svoboda | 10 | #include <async.h> |
2832 | svoboda | 11 | #include <udebug.h> |
12 | |||
13 | #include "debug_api.h" |
||
14 | |||
15 | int debug_begin(unsigned phoneid) |
||
16 | { |
||
2835 | svoboda | 17 | return async_req_1_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_BEGIN); |
2832 | svoboda | 18 | } |
19 | |||
2835 | svoboda | 20 | int debug_end(unsigned phoneid) |
21 | { |
||
22 | return async_req_1_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_END); |
||
23 | } |
||
24 | |||
2832 | svoboda | 25 | int debug_thread_read(unsigned phoneid, void *buffer, unsigned n, |
26 | unsigned *copied, unsigned *needed) |
||
27 | { |
||
2885 | svoboda | 28 | unsigned dest_addr; |
29 | |||
30 | return async_req_3_3(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_THREAD_READ, |
||
31 | (sysarg_t)buffer, n, &dest_addr, copied, needed); |
||
2832 | svoboda | 32 | } |
33 | |||
34 | int debug_mem_read(unsigned phoneid, void *buffer, unsigned addr, unsigned n) |
||
35 | { |
||
2835 | svoboda | 36 | return async_req_4_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_MEM_READ, |
2832 | svoboda | 37 | (sysarg_t)buffer, addr, n); |
38 | } |
||
39 | |||
40 | int debug_args_read(unsigned phoneid, unsigned tid, unsigned *buffer) |
||
41 | { |
||
2835 | svoboda | 42 | return async_req_3_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_ARGS_READ, |
2833 | svoboda | 43 | tid, (sysarg_t)buffer); |
2832 | svoboda | 44 | } |
45 | |||
46 | int debug_go(unsigned phoneid, unsigned tid, unsigned *ev_type, |
||
47 | unsigned *sc_id, unsigned *sc_rc) |
||
48 | { |
||
49 | /* Run thread until a syscall is executed */ |
||
2835 | svoboda | 50 | return async_req_2_3(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_GO, |
2832 | svoboda | 51 | tid, (sysarg_t)ev_type, (sysarg_t)sc_id, (sysarg_t)sc_rc); |
52 | } |
||
53 | |||
54 | /** @} |
||
55 | */ |