From f442c3fbe203752f0a751317d3e833fe0b660ae1 Mon Sep 17 00:00:00 2001 From: manuel Date: Thu, 21 Jun 2012 19:07:57 +0200 Subject: use void* instead of uint8_t* in mmap/page table and fill in more of proj2 --- vm/mmap.c | 2 +- vm/mmap.h | 4 ++-- vm/page.c | 2 +- vm/page.h | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) (limited to 'vm') diff --git a/vm/mmap.c b/vm/mmap.c index 55ee91b..0dc9190 100644 --- a/vm/mmap.c +++ b/vm/mmap.c @@ -38,7 +38,7 @@ mmap_table_free (struct mmap_table *table) /* inserts a new mmap entry in the mmap table. returns -1 if entry is invalid or already in the table */ mapid_t -mmap_table_insert (struct mmap_table *table, uint8_t *upage, struct file *file, +mmap_table_insert (struct mmap_table *table, void *upage, struct file *file, off_t len) { off_t ofs = 0; diff --git a/vm/mmap.h b/vm/mmap.h index 09276a7..159e61a 100644 --- a/vm/mmap.h +++ b/vm/mmap.h @@ -18,14 +18,14 @@ struct mmap_table /* a single entry in the mmap table */ struct mmap_table_entry { - uint8_t *upage; /* virtual address of first page of mmapped file */ + void *upage; /* virtual address of first page of mmapped file */ struct file *file; /* file handle */ int pages; /* number of pages the mapping needs */ }; bool mmap_table_init (struct mmap_table *table); void mmap_table_free (struct mmap_table *table); -mapid_t mmap_table_insert (struct mmap_table *table, uint8_t *upage, +mapid_t mmap_table_insert (struct mmap_table *table, void *upage, struct file *file, off_t len); bool mmap_table_remove (struct mmap_table *table, mapid_t mapping); diff --git a/vm/page.c b/vm/page.c index 98120e5..b40382f 100644 --- a/vm/page.c +++ b/vm/page.c @@ -69,7 +69,7 @@ page_table_insert (struct hash *ht, struct page_table_entry *pte) returns false if entry is invalid or already in the table */ bool page_table_insert_segment (struct hash *ht, struct file *file, off_t ofs, - uint8_t *upage, uint32_t read_bytes, bool writable) + void *upage, uint32_t read_bytes, bool writable) { struct page_table_entry *pte = malloc (sizeof *pte); if (pte == NULL) diff --git a/vm/page.h b/vm/page.h index c78ab65..b7997fe 100644 --- a/vm/page.h +++ b/vm/page.h @@ -28,7 +28,7 @@ void page_table_free (struct hash *ht); struct page_table_entry *page_table_fetch (struct hash *ht, void *upage); struct page_table_entry *page_table_remove (struct hash *ht, void *upage); bool page_table_insert_segment (struct hash *ht, struct file *file, off_t ofs, - uint8_t *upage, uint32_t read_bytes, bool writable); + void *upage, uint32_t read_bytes, bool writable); bool page_load (struct page_table_entry *pte); #endif -- cgit v1.2.3