add system time measurement
This commit is contained in:
parent
06cd3a04a5
commit
6078c70649
|
@ -13,9 +13,13 @@ struct RunQ *runq;
|
|||
struct PhysPage *first_free_page;
|
||||
struct PhysPage *first_busy_page;
|
||||
|
||||
size_t system_time;
|
||||
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
system_time = 0;
|
||||
|
||||
first_busy_page = NULL;
|
||||
|
||||
first_free_page = malloc(sizeof(struct PhysPage));
|
||||
|
|
|
@ -2,6 +2,10 @@
|
|||
|
||||
#include "kernel.h"
|
||||
|
||||
|
||||
extern size_t system_time;
|
||||
|
||||
|
||||
void MMU_read(struct PageTableEntry *pt, size_t page_no)
|
||||
{
|
||||
if (!pt[page_no].p)
|
||||
|
@ -9,6 +13,8 @@ void MMU_read(struct PageTableEntry *pt, size_t page_no)
|
|||
|
||||
printf("[mmu:read] pt[%d] -> ppn %d\n", page_no, pt[page_no].ppn);
|
||||
pt[page_no].r = 1;
|
||||
|
||||
system_time++;
|
||||
}
|
||||
|
||||
void MMU_write(struct PageTableEntry *pt, size_t page_no)
|
||||
|
@ -19,4 +25,6 @@ void MMU_write(struct PageTableEntry *pt, size_t page_no)
|
|||
printf("[mmu:write] pt[%d] -> ppn %d\n", page_no, pt[page_no].ppn);
|
||||
pt[page_no].r = 1;
|
||||
pt[page_no].m = 1;
|
||||
|
||||
system_time++;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue