aboutsummaryrefslogtreecommitdiff
path: root/src/tests/test.c
blob: f6213ae08b6224065cc2c3c71dba6f972e0b3dd4 (plain)
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
26
27
28
29
30
#include <cpu.h>
#include <drivers/uart.h>
#include <graphics/lfb.h>
#include <lib/kmem.h>
#include <sys/core.h>
#include <sys/schedule.h>

extern void atest(void);

void test_entry(void)
{
	draw_string(0, 18, "Starting tests");
	unsigned long long ti, tf, dt=0;
	for(int i = 0; i < 64; i++) {
		sys0_64(SYS_TIME, &ti);
		sys0_64(SYS_TIME, &tf);
		dt += tf - ti;
	}
	DRAW64(0, 19, dt/64);
	DRAW64(17, 19, dt%64);

	// atest
	add_thread(atest, 0, 0);
	sys0_64(SYS_TIME, &ti);
	sys0(SYS_YIELD);
	sys0_64(SYS_TIME, &tf);
	dt += tf - ti;
	DRAW64(34, 19, dt/64);
	DRAW64(34+17, 19, dt%64);
}