Subversion Repositories HelenOS

Rev

Rev 2904 | Rev 2912 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2904 Rev 2905
Line 31... Line 31...
31
 */
31
 */
32
/** @file
32
/** @file
33
 */
33
 */
34
 
34
 
35
#include <udebug.h>
35
#include <udebug.h>
-
 
36
#include <sys/types.h>
36
#include <syscall.h>
37
#include <syscall.h>
37
#include <ipc/ipc.h>
38
#include <ipc/ipc.h>
38
#include <async.h>
39
#include <async.h>
39
 
40
 
40
int udebug_begin(unsigned phoneid)
41
int udebug_begin(int phoneid)
41
{
42
{
42
    return async_req_1_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_BEGIN);
43
    return async_req_1_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_BEGIN);
43
}
44
}
44
 
45
 
45
int udebug_end(unsigned phoneid)
46
int udebug_end(int phoneid)
46
{
47
{
47
    return async_req_1_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_END);
48
    return async_req_1_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_END);
48
}
49
}
49
 
50
 
50
int udebug_set_evmask(unsigned phoneid, udebug_evmask_t mask)
51
int udebug_set_evmask(int phoneid, udebug_evmask_t mask)
51
{
52
{
52
    return async_req_2_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_SET_EVMASK,
53
    return async_req_2_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_SET_EVMASK,
53
        mask);
54
        mask);
54
}
55
}
55
 
56
 
56
int udebug_thread_read(unsigned phoneid, void *buffer, unsigned n,
57
int udebug_thread_read(int phoneid, void *buffer, size_t n,
57
    unsigned *copied, unsigned *needed)
58
    size_t *copied, size_t *needed)
58
{
59
{
59
    unsigned dest_addr;
60
    unsigned dest_addr;
60
 
61
 
61
    return async_req_3_3(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_THREAD_READ,
62
    return async_req_3_3(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_THREAD_READ,
62
        (sysarg_t)buffer, n, &dest_addr, copied, needed);
63
        (sysarg_t)buffer, n, &dest_addr, copied, needed);
63
}
64
}
64
 
65
 
65
int udebug_mem_read(unsigned phoneid, void *buffer, unsigned addr, unsigned n)
66
int udebug_mem_read(int phoneid, void *buffer, uintptr_t addr, size_t n)
66
{
67
{
67
    return async_req_4_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_MEM_READ,
68
    return async_req_4_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_MEM_READ,
68
        (sysarg_t)buffer, addr, n);
69
        (sysarg_t)buffer, addr, n);
69
}
70
}
70
 
71
 
71
int udebug_args_read(unsigned phoneid, unsigned tid, unsigned *buffer)
72
int udebug_args_read(int phoneid, thash_t tid, sysarg_t *buffer)
72
{
73
{
73
    return async_req_3_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_ARGS_READ,
74
    return async_req_3_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_ARGS_READ,
74
        tid, (sysarg_t)buffer);
75
        tid, (sysarg_t)buffer);
75
}
76
}
76
 
77
 
77
int udebug_go(unsigned phoneid, unsigned tid, unsigned *ev_type,
78
int udebug_go(int phoneid, thash_t tid, int *ev_type, int *val0, int *val1)
78
    unsigned *sc_id, unsigned *sc_rc)
-
 
79
{
79
{
80
    return async_req_2_3(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_GO,
80
    return async_req_2_3(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_GO,
81
        tid, (sysarg_t)ev_type, (sysarg_t)sc_id, (sysarg_t)sc_rc);
81
        tid, (sysarg_t)ev_type, (sysarg_t)val0, (sysarg_t)val1);
82
}
82
}
83
 
83
 
84
int udebug_stop(unsigned phoneid, unsigned tid)
84
int udebug_stop(int phoneid, thash_t tid)
85
{
85
{
86
    return async_req_2_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_STOP,
86
    return async_req_2_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_STOP,
87
        tid);
87
        tid);
88
}
88
}
89
 
89