-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.c
46 lines (40 loc) · 828 Bytes
/
main.c
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "asm.h"
#define AARCH64_TIMING
#include "timing.c"
#define FIELD(name) void name(void *dest, void *src);
#include "test.def"
#undef FIELD
struct test
{
const char *name;
void (*func)(void *dest, void *src);
}tests[] =
{
#define FIELD(name) { #name, name },
#include "test.def"
#undef FIELD
{ NULL, NULL }
};
int main(void)
{
void *pagesrc = NULL;
void *pagedst = NULL;
int i, j;
posix_memalign (&pagesrc, PAGE_SIZE, PAGE_SIZE);
posix_memalign (&pagedst, PAGE_SIZE, PAGE_SIZE);
for(j = 0;j < 2; j++)
for(i = 0; tests[i].name != NULL; i++)
{
//memset (pagesrc, i, PAGE_SIZE);
start_time();
tests[i].func(pagedst, pagesrc);
stop_time();
printf ("%s: ", tests[i].name);
print_time();
printf ("\n");
}
return 0;
}