From e61e868b265efe2f6d51079373588d639fc54d59 Mon Sep 17 00:00:00 2001 From: manuel Date: Thu, 21 Jun 2012 18:14:58 +0200 Subject: full mmap implementation --- vm/mmap.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'vm/mmap.h') diff --git a/vm/mmap.h b/vm/mmap.h index bee364e..09276a7 100644 --- a/vm/mmap.h +++ b/vm/mmap.h @@ -10,21 +10,22 @@ struct mmap_table { struct mmap_table_entry **ids; - int id_free; /* lowest-index free */ - int id_max; /* highest-index used */ - int id_cap; /* mmap table capacity */ + int id_free; /* lowest-index free */ + int id_max; /* highest-index used */ + int id_cap; /* mmap table capacity */ }; /* a single entry in the mmap table */ struct mmap_table_entry { - void *addr; - struct file *file; + uint8_t *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, void *addr, +mapid_t mmap_table_insert (struct mmap_table *table, uint8_t *upage, struct file *file, off_t len); bool mmap_table_remove (struct mmap_table *table, mapid_t mapping); -- cgit v1.2.3