1 /* 2 * Copyright (c) 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * %sccs.include.redist.c% 6 * 7 * @(#)vm.h 8.1 (Berkeley) 06/11/93 8 */ 9 10 #ifndef VM_H 11 #define VM_H 12 13 typedef int vm_inherit_t; /* XXX: inheritance codes */ 14 15 union vm_map_object; 16 typedef union vm_map_object vm_map_object_t; 17 18 struct vm_map_entry; 19 typedef struct vm_map_entry *vm_map_entry_t; 20 21 struct vm_map; 22 typedef struct vm_map *vm_map_t; 23 24 struct vm_object; 25 typedef struct vm_object *vm_object_t; 26 27 struct vm_page; 28 typedef struct vm_page *vm_page_t; 29 30 struct pager_struct; 31 typedef struct pager_struct *vm_pager_t; 32 33 #include <sys/vmmeter.h> 34 #include <sys/queue.h> 35 36 /* 37 * Compatibility with old MACH queue.h 38 */ 39 typedef struct queue_entry *queue_t; 40 typedef struct queue_entry queue_head_t; 41 typedef struct queue_entry queue_chain_t; 42 typedef struct queue_entry *queue_entry_t; 43 44 #define queue_first(head) ((head)->qe_next) 45 #define queue_next(elm) ((elm)->qe_next) 46 #define queue_empty(head) ((head)->qe_next == 0) 47 #define queue_end(head, elm) ((elm) == 0) 48 49 #define queue_enter(head, elt, type, field) \ 50 queue_enter_tail(head, elt, type, field) 51 52 #define queue_remove_first(head, elt, type, field) { \ 53 elt = queue_first(head); \ 54 queue_remove(head, elt, type, field) \ 55 } 56 57 #include <vm/vm_param.h> 58 #include <vm/lock.h> 59 #include <vm/vm_prot.h> 60 #include <vm/vm_inherit.h> 61 #include <vm/vm_map.h> 62 #include <vm/vm_object.h> 63 #include <vm/pmap.h> 64 #include <vm/vm_extern.h> 65 66 /* 67 * Shareable process virtual address space. 68 * May eventually be merged with vm_map. 69 * Several fields are temporary (text, data stuff). 70 */ 71 struct vmspace { 72 struct vm_map vm_map; /* VM address map */ 73 struct pmap vm_pmap; /* private physical map */ 74 int vm_refcnt; /* number of references */ 75 caddr_t vm_shm; /* SYS5 shared memory private data XXX */ 76 /* we copy from vm_startcopy to the end of the structure on fork */ 77 #define vm_startcopy vm_rssize 78 segsz_t vm_rssize; /* current resident set size in pages */ 79 segsz_t vm_swrss; /* resident set size before last swap */ 80 segsz_t vm_tsize; /* text size (pages) XXX */ 81 segsz_t vm_dsize; /* data size (pages) XXX */ 82 segsz_t vm_ssize; /* stack size (pages) */ 83 caddr_t vm_taddr; /* user virtual address of text XXX */ 84 caddr_t vm_daddr; /* user virtual address of data XXX */ 85 caddr_t vm_maxsaddr; /* user VA at max stack growth */ 86 }; 87 #endif /* VM_H */ 88