Commit f55c9ca56c59ba97df6863bfc4910d47ae1664f9
1 parent
b7090bc7b5
Exists in
master
pagefault
Showing 2 changed files with 2 additions and 2 deletions Side-by-side Diff
memory/pagefault.c
View file @
f55c9ca
... | ... | @@ -60,7 +60,7 @@ |
60 | 60 | asm volatile("mrc p15, 0, %0, c9, c14, 0" : "=r" (i)); |
61 | 61 | printf("User enable regr: %x\n", i); |
62 | 62 | |
63 | - for(i = 0; i < 1000; i=i++){ | |
63 | + for(i = 0; i < 100; i=i++){ | |
64 | 64 | asm volatile("mrc p15, 0, %0, c9, c13, 0" : "=r" (s_t)); |
65 | 65 | c += (addr1[i*4*KB] + 1); // read at multiple of page size, so every read causes a page fault |
66 | 66 | //c = c+1; |
... | ... | @@ -69,7 +69,7 @@ |
69 | 69 | // printf("Time required to service a page faut is %u %u %u \n",e_t, s_t, (e_t-s_t)); |
70 | 70 | fflush(NULL); |
71 | 71 | } |
72 | - printf("\nAverage time required to service a page fault is %f \n", (t/1000)/CPU_FREQ); | |
72 | + printf("\nAverage time required to service a page fault is %u \n", t); | |
73 | 73 | |
74 | 74 | munmap(addr1, SIZE_OF_MEMORY); |
75 | 75 | munmap(addr2, SIZE_OF_MEMORY); |
memory/pagefault.o
View file @
f55c9ca