diff options
Diffstat (limited to 'vm')
-rw-r--r-- | vm/vm_anon.c | 9 | ||||
-rw-r--r-- | vm/vm_map.c | 10 | ||||
-rw-r--r-- | vm/vm_map.h | 7 | ||||
-rw-r--r-- | vm/vm_object.h | 5 |
4 files changed, 25 insertions, 6 deletions
diff --git a/vm/vm_anon.c b/vm/vm_anon.c index fac7528c..e923ff31 100644 --- a/vm/vm_anon.c +++ b/vm/vm_anon.c @@ -26,6 +26,7 @@ #include <kern/stdint.h> #include <vm/vm_anon.h> #include <vm/vm_object.h> +#include <vm/vm_page.h> /* * Anonymous memory container. @@ -42,7 +43,7 @@ struct vm_anon { static void vm_anon_ref(struct vm_object *object); static void vm_anon_unref(struct vm_object *object); static int vm_anon_get(struct vm_object *object, uint64_t offset, - struct list *pages, int access_prot, int advice); + struct vm_page **pagep, int access_prot, int advice); static struct vm_object_pager vm_anon_pager = { .ref = vm_anon_ref, @@ -106,12 +107,12 @@ vm_anon_unref(struct vm_object *object) } static int -vm_anon_get(struct vm_object *object, uint64_t offset, struct list *pages, - int access_prot, int advice) +vm_anon_get(struct vm_object *object, uint64_t offset, + struct vm_page **pagep, int access_prot, int advice) { (void)object; (void)offset; - (void)pages; + (void)pagep; (void)access_prot; (void)advice; diff --git a/vm/vm_map.c b/vm/vm_map.c index 4ff86904..0a94b351 100644 --- a/vm/vm_map.c +++ b/vm/vm_map.c @@ -900,6 +900,16 @@ out: mutex_unlock(&map->lock); } +int +vm_map_fault(struct vm_map *map, unsigned long addr, int access) +{ + (void)map; + (void)addr; + (void)access; + + return ERROR_AGAIN; +} + static void vm_map_init(struct vm_map *map, struct pmap *pmap, unsigned long start, unsigned long end) diff --git a/vm/vm_map.h b/vm/vm_map.h index 7a2bc44c..d686cb93 100644 --- a/vm/vm_map.h +++ b/vm/vm_map.h @@ -103,6 +103,13 @@ int vm_map_enter(struct vm_map *map, struct vm_object *object, uint64_t offset, void vm_map_remove(struct vm_map *map, unsigned long start, unsigned long end); /* + * Page fault handling. + * + * Access is one of VM_PROT_READ, VM_PROT_WRITE or VM_PROT_EXECUTE. + */ +int vm_map_fault(struct vm_map *map, unsigned long addr, int access); + +/* * Set up the vm_map module. */ void vm_map_setup(void); diff --git a/vm/vm_object.h b/vm/vm_object.h index 5de636ab..86bd12f5 100644 --- a/vm/vm_object.h +++ b/vm/vm_object.h @@ -31,6 +31,7 @@ #include <kern/mutex.h> #include <kern/rdxtree.h> #include <kern/stdint.h> +#include <vm/vm_page.h> struct vm_object_pager; @@ -50,8 +51,8 @@ struct vm_object { struct vm_object_pager { void (*ref)(struct vm_object *object); void (*unref)(struct vm_object *object); - int (*get)(struct vm_object *object, uint64_t offset, struct list *pages, - int access_prot, int advice); + int (*get)(struct vm_object *object, uint64_t offset, + struct vm_page **pagep, int access_type, int advice); }; static inline void |