Skip to content

Commit 33a6fac

Browse files
committed
cleanup
1 parent 7b8cb16 commit 33a6fac

File tree

4 files changed

+230
-229
lines changed

4 files changed

+230
-229
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
obj-m+=hello.o
1+
obj-m+=uncached_ram.o
22

33
all:
44
make -C /lib/modules/$(shell uname -r)/build/ M=$(PWD) modules

hello.c

Lines changed: 0 additions & 219 deletions
This file was deleted.

test/test.c

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -75,30 +75,25 @@ int main(int ac, char **av)
7575
else
7676
map = malloc(size); /* test normal memory */
7777

78-
unsigned int *pt = ((unsigned int*)map);
79-
/* uncached mem should start with 0xdeadbeaf */
80-
printf("read %#0x\n", *pt);
81-
//if (uncached_mem_test) assert(*pt == 0xdeadbeaf);
82-
//printf("sizeof(off_t): %i\n", sizeof(off_t));
8378

8479
/*********************************************************************/
85-
/* benchmark reads */
80+
/* Read benchmarks */
8681

8782
double time_start = time_now();
8883

84+
unsigned int *pt = ((unsigned int*)map);
8985
int tsize = size / sizeof(int);
90-
//int t[tsize];
9186
#define STEP 10
9287
unsigned int sum = 0;
93-
int reads = 0;
88+
unsigned int reads = 0;
9489
for (int i = 0; i < tsize - STEP; i++)
9590
for (int k = 0; k < 10; k++)
9691
for (int j = 0; j < STEP; j++) {
9792
sum += pt[i+j];
9893
reads++;
9994
}
10095

101-
printf("%s mem test: %i reads in %.2fs (sum: %i)\n",
96+
printf("%s mem test: %u reads in %.2fs (sum: %i)\n",
10297
(uncached_mem_test ? "uncached" : "cached"),
10398
reads, time_now() - time_start, sum);
10499
}

0 commit comments

Comments
 (0)