vm_map.h (117047) | vm_map.h (118771) |
---|---|
1/* 2 * Copyright (c) 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * The Mach Operating System project at Carnegie-Mellon University. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 47 unchanged lines hidden (view full) --- 56 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU 57 * School of Computer Science 58 * Carnegie Mellon University 59 * Pittsburgh PA 15213-3890 60 * 61 * any improvements or extensions that they make and grant Carnegie the 62 * rights to redistribute these changes. 63 * | 1/* 2 * Copyright (c) 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * The Mach Operating System project at Carnegie-Mellon University. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 47 unchanged lines hidden (view full) --- 56 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU 57 * School of Computer Science 58 * Carnegie Mellon University 59 * Pittsburgh PA 15213-3890 60 * 61 * any improvements or extensions that they make and grant Carnegie the 62 * rights to redistribute these changes. 63 * |
64 * $FreeBSD: head/sys/vm/vm_map.h 117047 2003-06-29 23:32:55Z alc $ | 64 * $FreeBSD: head/sys/vm/vm_map.h 118771 2003-08-11 07:14:08Z bms $ |
65 */ 66 67/* 68 * Virtual memory map module definitions. 69 */ 70#ifndef _VM_MAP_ 71#define _VM_MAP_ 72 73#include <sys/lock.h> 74#include <sys/lockmgr.h> 75#include <sys/_mutex.h> 76 77/* 78 * Types defined: 79 * 80 * vm_map_t the high-level address map data structure. 81 * vm_map_entry_t an entry in an address map. 82 */ 83 | 65 */ 66 67/* 68 * Virtual memory map module definitions. 69 */ 70#ifndef _VM_MAP_ 71#define _VM_MAP_ 72 73#include <sys/lock.h> 74#include <sys/lockmgr.h> 75#include <sys/_mutex.h> 76 77/* 78 * Types defined: 79 * 80 * vm_map_t the high-level address map data structure. 81 * vm_map_entry_t an entry in an address map. 82 */ 83 |
84typedef u_char vm_flags_t; |
|
84typedef u_int vm_eflags_t; 85 86/* 87 * Objects which live in maps may be either VM objects, or 88 * another map (called a "sharing map") which denotes read-write 89 * sharing with other maps. 90 */ 91union vm_map_object { --- 74 unchanged lines hidden (view full) --- 166 struct vm_map_entry header; /* List of entries */ 167 struct lock lock; /* Lock for map data */ 168 struct mtx system_mtx; 169 int nentries; /* Number of entries */ 170 vm_size_t size; /* virtual size */ 171 u_char needs_wakeup; 172 u_char system_map; /* Am I a system map? */ 173 u_char infork; /* Am I in fork processing? */ | 85typedef u_int vm_eflags_t; 86 87/* 88 * Objects which live in maps may be either VM objects, or 89 * another map (called a "sharing map") which denotes read-write 90 * sharing with other maps. 91 */ 92union vm_map_object { --- 74 unchanged lines hidden (view full) --- 167 struct vm_map_entry header; /* List of entries */ 168 struct lock lock; /* Lock for map data */ 169 struct mtx system_mtx; 170 int nentries; /* Number of entries */ 171 vm_size_t size; /* virtual size */ 172 u_char needs_wakeup; 173 u_char system_map; /* Am I a system map? */ 174 u_char infork; /* Am I in fork processing? */ |
175 vm_flags_t flags; /* flags for this vm_map */ |
|
174 vm_map_entry_t root; /* Root of a binary search tree */ 175 unsigned int timestamp; /* Version number */ 176 vm_map_entry_t first_free; /* First free space hint */ 177 pmap_t pmap; /* (c) Physical map */ 178#define min_offset header.start /* (c) */ 179#define max_offset header.end /* (c) */ 180}; 181 | 176 vm_map_entry_t root; /* Root of a binary search tree */ 177 unsigned int timestamp; /* Version number */ 178 vm_map_entry_t first_free; /* First free space hint */ 179 pmap_t pmap; /* (c) Physical map */ 180#define min_offset header.start /* (c) */ 181#define max_offset header.end /* (c) */ 182}; 183 |
184/* 185 * vm_flags_t values 186 */ 187#define MAP_WIREFUTURE 0x01 /* wire all future pages */ 188 |
|
182#ifdef _KERNEL 183static __inline vm_offset_t 184vm_map_max(vm_map_t map) 185{ 186 return (map->max_offset); 187} 188 189static __inline vm_offset_t 190vm_map_min(vm_map_t map) 191{ 192 return (map->min_offset); 193} 194 195static __inline pmap_t 196vm_map_pmap(vm_map_t map) 197{ 198 return (map->pmap); 199} | 189#ifdef _KERNEL 190static __inline vm_offset_t 191vm_map_max(vm_map_t map) 192{ 193 return (map->max_offset); 194} 195 196static __inline vm_offset_t 197vm_map_min(vm_map_t map) 198{ 199 return (map->min_offset); 200} 201 202static __inline pmap_t 203vm_map_pmap(vm_map_t map) 204{ 205 return (map->pmap); 206} |
207 208static __inline void 209vm_map_modflags(vm_map_t map, vm_flags_t set, vm_flags_t clear) 210{ 211 map->flags = (map->flags | set) & ~clear; 212} |
|
200#endif /* _KERNEL */ 201 202/* 203 * Shareable process virtual address space. 204 * 205 * List of locks 206 * (c) const until freed 207 */ --- 83 unchanged lines hidden (view full) --- 291 * vm_fault option flags 292 */ 293#define VM_FAULT_NORMAL 0 /* Nothing special */ 294#define VM_FAULT_CHANGE_WIRING 1 /* Change the wiring as appropriate */ 295#define VM_FAULT_USER_WIRE 2 /* Likewise, but for user purposes */ 296#define VM_FAULT_WIRE_MASK (VM_FAULT_CHANGE_WIRING|VM_FAULT_USER_WIRE) 297#define VM_FAULT_DIRTY 8 /* Dirty the page */ 298 | 213#endif /* _KERNEL */ 214 215/* 216 * Shareable process virtual address space. 217 * 218 * List of locks 219 * (c) const until freed 220 */ --- 83 unchanged lines hidden (view full) --- 304 * vm_fault option flags 305 */ 306#define VM_FAULT_NORMAL 0 /* Nothing special */ 307#define VM_FAULT_CHANGE_WIRING 1 /* Change the wiring as appropriate */ 308#define VM_FAULT_USER_WIRE 2 /* Likewise, but for user purposes */ 309#define VM_FAULT_WIRE_MASK (VM_FAULT_CHANGE_WIRING|VM_FAULT_USER_WIRE) 310#define VM_FAULT_DIRTY 8 /* Dirty the page */ 311 |
312/* 313 * vm_map_wire and vm_map_unwire option flags 314 */ 315#define VM_MAP_WIRE_SYSTEM 0 /* wiring in a kernel map */ 316#define VM_MAP_WIRE_USER 1 /* wiring in a user map */ 317 318#define VM_MAP_WIRE_NOHOLES 0 /* region must not have holes */ 319#define VM_MAP_WIRE_HOLESOK 2 /* region may have holes */ 320 |
|
299#ifdef _KERNEL 300boolean_t vm_map_check_protection (vm_map_t, vm_offset_t, vm_offset_t, vm_prot_t); 301vm_map_t vm_map_create(pmap_t, vm_offset_t, vm_offset_t); 302int vm_map_delete (vm_map_t, vm_offset_t, vm_offset_t); 303int vm_map_find (vm_map_t, vm_object_t, vm_ooffset_t, vm_offset_t *, vm_size_t, boolean_t, vm_prot_t, vm_prot_t, int); 304int vm_map_findspace (vm_map_t, vm_offset_t, vm_size_t, vm_offset_t *); 305int vm_map_inherit (vm_map_t, vm_offset_t, vm_offset_t, vm_inherit_t); 306void vm_map_init (struct vm_map *, vm_offset_t, vm_offset_t); --- 10 unchanged lines hidden (view full) --- 317void vm_map_startup (void); 318int vm_map_submap (vm_map_t, vm_offset_t, vm_offset_t, vm_map_t); 319int vm_map_madvise (vm_map_t, vm_offset_t, vm_offset_t, int); 320void vm_map_simplify_entry (vm_map_t, vm_map_entry_t); 321void vm_init2 (void); 322int vm_map_stack (vm_map_t, vm_offset_t, vm_size_t, vm_prot_t, vm_prot_t, int); 323int vm_map_growstack (struct proc *p, vm_offset_t addr); 324int vm_map_unwire(vm_map_t map, vm_offset_t start, vm_offset_t end, | 321#ifdef _KERNEL 322boolean_t vm_map_check_protection (vm_map_t, vm_offset_t, vm_offset_t, vm_prot_t); 323vm_map_t vm_map_create(pmap_t, vm_offset_t, vm_offset_t); 324int vm_map_delete (vm_map_t, vm_offset_t, vm_offset_t); 325int vm_map_find (vm_map_t, vm_object_t, vm_ooffset_t, vm_offset_t *, vm_size_t, boolean_t, vm_prot_t, vm_prot_t, int); 326int vm_map_findspace (vm_map_t, vm_offset_t, vm_size_t, vm_offset_t *); 327int vm_map_inherit (vm_map_t, vm_offset_t, vm_offset_t, vm_inherit_t); 328void vm_map_init (struct vm_map *, vm_offset_t, vm_offset_t); --- 10 unchanged lines hidden (view full) --- 339void vm_map_startup (void); 340int vm_map_submap (vm_map_t, vm_offset_t, vm_offset_t, vm_map_t); 341int vm_map_madvise (vm_map_t, vm_offset_t, vm_offset_t, int); 342void vm_map_simplify_entry (vm_map_t, vm_map_entry_t); 343void vm_init2 (void); 344int vm_map_stack (vm_map_t, vm_offset_t, vm_size_t, vm_prot_t, vm_prot_t, int); 345int vm_map_growstack (struct proc *p, vm_offset_t addr); 346int vm_map_unwire(vm_map_t map, vm_offset_t start, vm_offset_t end, |
325 boolean_t user_unwire); | 347 int flags); |
326int vm_map_wire(vm_map_t map, vm_offset_t start, vm_offset_t end, | 348int vm_map_wire(vm_map_t map, vm_offset_t start, vm_offset_t end, |
327 boolean_t user_wire); | 349 int flags); |
328int vmspace_swap_count (struct vmspace *vmspace); 329#endif /* _KERNEL */ 330#endif /* _VM_MAP_ */ | 350int vmspace_swap_count (struct vmspace *vmspace); 351#endif /* _KERNEL */ 352#endif /* _VM_MAP_ */ |