summaryrefslogtreecommitdiffstats
path: root/vm/mmap.h
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2012-06-21 18:14:58 +0200
committermanuel <manuel@mausz.at>2012-06-21 18:14:58 +0200
commite61e868b265efe2f6d51079373588d639fc54d59 (patch)
tree035fa9afef57c88ed156909d73cd8c4a91fe4435 /vm/mmap.h
parente11b2ef0c606ab516a4344aeea1dbba22cb1fe5d (diff)
downloadprogos-e61e868b265efe2f6d51079373588d639fc54d59.tar.gz
progos-e61e868b265efe2f6d51079373588d639fc54d59.tar.bz2
progos-e61e868b265efe2f6d51079373588d639fc54d59.zip
full mmap implementation
Diffstat (limited to 'vm/mmap.h')
-rw-r--r--vm/mmap.h13
1 files changed, 7 insertions, 6 deletions
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 @@
10struct mmap_table 10struct mmap_table
11{ 11{
12 struct mmap_table_entry **ids; 12 struct mmap_table_entry **ids;
13 int id_free; /* lowest-index free */ 13 int id_free; /* lowest-index free */
14 int id_max; /* highest-index used */ 14 int id_max; /* highest-index used */
15 int id_cap; /* mmap table capacity */ 15 int id_cap; /* mmap table capacity */
16}; 16};
17 17
18/* a single entry in the mmap table */ 18/* a single entry in the mmap table */
19struct mmap_table_entry 19struct mmap_table_entry
20{ 20{
21 void *addr; 21 uint8_t *upage; /* virtual address of first page of mmapped file */
22 struct file *file; 22 struct file *file; /* file handle */
23 int pages; /* number of pages the mapping needs */
23}; 24};
24 25
25bool mmap_table_init (struct mmap_table *table); 26bool mmap_table_init (struct mmap_table *table);
26void mmap_table_free (struct mmap_table *table); 27void mmap_table_free (struct mmap_table *table);
27mapid_t mmap_table_insert (struct mmap_table *table, void *addr, 28mapid_t mmap_table_insert (struct mmap_table *table, uint8_t *upage,
28 struct file *file, off_t len); 29 struct file *file, off_t len);
29bool mmap_table_remove (struct mmap_table *table, mapid_t mapping); 30bool mmap_table_remove (struct mmap_table *table, mapid_t mapping);
30 31