Subversion Repositories HelenOS

Rev

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

Rev 2833 Rev 2835
Line 5... Line 5...
5
 */
5
 */
6
 
6
 
7
#include <stdio.h>
7
#include <stdio.h>
8
#include <syscall.h>
8
#include <syscall.h>
9
#include <ipc/ipc.h>
9
#include <ipc/ipc.h>
-
 
10
#include <async.h>
10
#include <udebug.h>
11
#include <udebug.h>
11
 
12
 
12
#include "debug_api.h"
13
#include "debug_api.h"
13
 
14
 
14
int debug_begin(unsigned phoneid)
15
int debug_begin(unsigned phoneid)
15
{
16
{
16
    return ipc_call_sync_1_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_BEGIN);
17
    return async_req_1_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_BEGIN);
-
 
18
}
-
 
19
 
-
 
20
int debug_end(unsigned phoneid)
-
 
21
{
-
 
22
    return async_req_1_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_END);
17
}
23
}
18
 
24
 
19
int debug_thread_read(unsigned phoneid, void *buffer, unsigned n,
25
int debug_thread_read(unsigned phoneid, void *buffer, unsigned n,
20
    unsigned *copied, unsigned *needed)
26
    unsigned *copied, unsigned *needed)
21
{
27
{
22
    printf("send IPC_M_DEBUG_THREAD_READ message\n");
28
    printf("send IPC_M_DEBUG_THREAD_READ message\n");
23
    return ipc_call_sync_3_2(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_THREAD_READ,
29
    return async_req_3_2(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_THREAD_READ,
24
        (sysarg_t)buffer, n, copied, needed);
30
        (sysarg_t)buffer, n, copied, needed);
25
}
31
}
26
 
32
 
27
int debug_mem_read(unsigned phoneid, void *buffer, unsigned addr, unsigned n)
33
int debug_mem_read(unsigned phoneid, void *buffer, unsigned addr, unsigned n)
28
{
34
{
29
    return ipc_call_sync_4_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_MEM_READ,
35
    return async_req_4_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_MEM_READ,
30
        (sysarg_t)buffer, addr, n);
36
        (sysarg_t)buffer, addr, n);
31
}
37
}
32
 
38
 
33
int debug_args_read(unsigned phoneid, unsigned tid, unsigned *buffer)
39
int debug_args_read(unsigned phoneid, unsigned tid, unsigned *buffer)
34
{
40
{
35
    return ipc_call_sync_3_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_ARGS_READ,
41
    return async_req_3_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_ARGS_READ,
36
        tid, (sysarg_t)buffer);
42
        tid, (sysarg_t)buffer);
37
}
43
}
38
 
44
 
39
int debug_go(unsigned phoneid, unsigned tid, unsigned *ev_type,
45
int debug_go(unsigned phoneid, unsigned tid, unsigned *ev_type,
40
    unsigned *sc_id, unsigned *sc_rc)
46
    unsigned *sc_id, unsigned *sc_rc)
41
{
47
{
42
    /* Run thread until a syscall is executed */
48
    /* Run thread until a syscall is executed */
43
    return ipc_call_sync_2_3(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_GO,
49
    return async_req_2_3(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_GO,
44
        tid, (sysarg_t)ev_type, (sysarg_t)sc_id, (sysarg_t)sc_rc);
50
        tid, (sysarg_t)ev_type, (sysarg_t)sc_id, (sysarg_t)sc_rc);
45
}
51
}
46
 
52
 
47
/** @}
53
/** @}
48
 */
54
 */