Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
script3r
GitHub Repository: script3r/os161
Path: blob/master/kern/include/vm/region.h
2093 views
1
#ifndef _VM_REGION_H
2
#define _VM_REGION_H
3
4
#include <array.h>
5
#include <spinlock.h>
6
7
struct addrspace; /* opaque */
8
9
/**
10
* using the built-in array data-structure instead of a linked list
11
* to hold each vm_page that belongs to a vm_region
12
*/
13
DECLARRAY_BYTYPE( vm_page_array, struct vm_page );
14
15
struct vm_region {
16
struct vm_page_array *vmr_pages;
17
vaddr_t vmr_base;
18
};
19
20
DECLARRAY_BYTYPE( vm_region_array, struct vm_region );
21
22
struct vm_region *vm_region_create( size_t );
23
void vm_region_destroy( struct vm_region * );
24
int vm_region_clone( struct vm_region *, struct vm_region ** );
25
int vm_region_resize( struct vm_region *, unsigned );
26
struct vm_region *vm_region_find_responsible( struct addrspace *, vaddr_t );
27
#endif
28
29