diff options
| author | manuel <manuel@mausz.at> | 2012-06-21 18:14:58 +0200 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2012-06-21 18:14:58 +0200 |
| commit | e61e868b265efe2f6d51079373588d639fc54d59 (patch) | |
| tree | 035fa9afef57c88ed156909d73cd8c4a91fe4435 /vm/mmap.h | |
| parent | e11b2ef0c606ab516a4344aeea1dbba22cb1fe5d (diff) | |
| download | progos-e61e868b265efe2f6d51079373588d639fc54d59.tar.gz progos-e61e868b265efe2f6d51079373588d639fc54d59.tar.bz2 progos-e61e868b265efe2f6d51079373588d639fc54d59.zip | |
full mmap implementation
Diffstat (limited to 'vm/mmap.h')
| -rw-r--r-- | vm/mmap.h | 13 |
1 files changed, 7 insertions, 6 deletions
| @@ -10,21 +10,22 @@ | |||
| 10 | struct mmap_table | 10 | struct 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 */ |
| 19 | struct mmap_table_entry | 19 | struct 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 | ||
| 25 | bool mmap_table_init (struct mmap_table *table); | 26 | bool mmap_table_init (struct mmap_table *table); |
| 26 | void mmap_table_free (struct mmap_table *table); | 27 | void mmap_table_free (struct mmap_table *table); |
| 27 | mapid_t mmap_table_insert (struct mmap_table *table, void *addr, | 28 | mapid_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); |
| 29 | bool mmap_table_remove (struct mmap_table *table, mapid_t mapping); | 30 | bool mmap_table_remove (struct mmap_table *table, mapid_t mapping); |
| 30 | 31 | ||
