aboutsummaryrefslogtreecommitdiff
path: root/benchmarks/ipc-req/init.c
blob: 910e018a75555c817d68ee43dbb51f0e042f3c9b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include <common/benchmark.h>

START(pid, tid, d0, d1, d2, d3)
{
	UNUSED(tid);
	UNUSED(d0);
	UNUSED(d1);
	UNUSED(d2);
	UNUSED(d3);

	if (pid == 0) {
		uint64_t timebase = sys_timebase();
		uint64_t start = sys_ticks();

		for (size_t i = 0; i < 1000; ++i) {
			sys_ipc_req0(1);
		}

		uint64_t end = sys_ticks();
		report(start, end, timebase);
	}
	else if (pid == 1) {
		sys_ipc_resp0();
	}
}