Subversion Repositories HelenOS

Rev

Rev 2805 | Rev 2807 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2801 svoboda 1
#include <stdio.h>
2
#include <unistd.h>
3
#include <ipc/ipc.h>
4
#include "../tester.h"
5
 
2806 svoboda 6
const char *syscall_name[] = {
7
    "sys_io",
8
    "sys_tls_set",
9
    "sys_thread_create",
10
    "sys_thread_exit",
11
    "sys_thread_get_id",
12
    "sys_task_get_id",
13
    "sys_futex_sleep_timeout",
14
    "sys_futex_wakeup",
15
    "sys_as_area_create",
16
    "sys_as_area_resize",
17
    "sys_as_area_destroy",
18
    "sys_ipc_call_sync_fast",
19
    "sys_ipc_call_sync_slow",
20
    "sys_ipc_call_async_fast",
21
    "sys_ipc_call_async_slow",
22
    "sys_ipc_answer_fast",
23
    "sys_ipc_answer_slow",
24
    "sys_ipc_forward_fast",
25
    "sys_ipc_wait_for_call",
26
    "sys_ipc_hangup",
27
    "sys_ipc_register_irq",
28
    "sys_ipc_unregister_irq",
29
    "sys_cap_grant",
30
    "sys_cap_revoke",
31
    "sys_physmem_map",
32
    "sys_iospace_enable",
33
    "sys_preempt_control",
34
    "sys_sysinfo_valid",
35
    "sys_sysinfo_value",
36
    "sys_debug_enable_console",
37
    "sys_ipc_connect_task"
38
};
2801 svoboda 39
 
40
char * test_debug1(bool quiet)
41
{
42
	int taskid;
43
	int rc;
44
	int phoneid;
45
	int i;
2805 svoboda 46
	unsigned sc_args[6];
47
	unsigned copied;
48
	unsigned ev_type;
49
	unsigned sc_id;
50
	int sc_rc;
2801 svoboda 51
 
52
	printf("running debug1 test\n");
53
	taskid = 12;
54
	printf("ipc_connect_task(%d)...\n", taskid);
55
	rc = ipc_connect_task(taskid);
56
	printf("-> %d\n", rc);
57
	phoneid = rc;
58
 
59
	printf("send IPC_M_DEBUG_BEGIN message\n");
60
	rc = ipc_call_sync_0_0(phoneid, IPC_M_DEBUG_BEGIN);
61
	printf("-> %d\n", rc);
62
 
63
	while (1) {
2805 svoboda 64
		rc = ipc_call_sync_0_3(phoneid, IPC_M_DEBUG_GO, &ev_type,
65
		    &sc_id, &sc_rc);
66
		rc = ipc_call_sync_3_1(phoneid, IPC_M_DEBUG_ARGS_READ, NULL,
67
		    sc_args, 6 * sizeof(unsigned), &copied);
68
		if (rc >= 0) {
2806 svoboda 69
			printf("%s[%d](%u, %u, %u, %u, %u, %u) -> %d\n",
70
			    syscall_name[sc_id], sc_id,
2805 svoboda 71
			    sc_args[0], sc_args[1], sc_args[2],
72
			    sc_args[3], sc_args[4], sc_args[5],
73
			    sc_rc);
74
		}
2801 svoboda 75
	}
76
 
77
	printf("done\n");
78
	return NULL;
79
}