Deleted Added
full compact
vm_map.h (92246) vm_map.h (92588)
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 92246 2002-03-13 23:48:08Z green $
64 * $FreeBSD: head/sys/vm/vm_map.h 92588 2002-03-18 15:08:09Z green $
65 */
66
67/*
68 * Virtual memory map module definitions.
69 */
70#ifndef _VM_MAP_
71#define _VM_MAP_
72
65 */
66
67/*
68 * Virtual memory map module definitions.
69 */
70#ifndef _VM_MAP_
71#define _VM_MAP_
72
73#include
74#include <sys/sx.h>
73#include <sys/lockmgr.h>
75
76#ifdef MAP_LOCK_DIAGNOSTIC
77#include <sys/systm.h>
78#define vm_map_printf(str, arg) printf(str,arg)
79#else
80#define vm_map_printf(str, arg)
81#endif
82

--- 65 unchanged lines hidden (view full) ---

148 * because this can result in a running lockup between two or more
149 * system processes trying to kmem_alloc_wait() due to kmem_alloc_wait()
150 * and free tsleep/waking up 'map' and the underlying lockmgr also
151 * sleeping and waking up on 'map'. The lockup occurs when the map fills
152 * up. The 'exec' map, for example.
153 */
154struct vm_map {
155 struct vm_map_entry header; /* List of entries */
74
75#ifdef MAP_LOCK_DIAGNOSTIC
76#include <sys/systm.h>
77#define vm_map_printf(str, arg) printf(str,arg)
78#else
79#define vm_map_printf(str, arg)
80#endif
81

--- 65 unchanged lines hidden (view full) ---

147 * because this can result in a running lockup between two or more
148 * system processes trying to kmem_alloc_wait() due to kmem_alloc_wait()
149 * and free tsleep/waking up 'map' and the underlying lockmgr also
150 * sleeping and waking up on 'map'. The lockup occurs when the map fills
151 * up. The 'exec' map, for example.
152 */
153struct vm_map {
154 struct vm_map_entry header; /* List of entries */
156 struct sx lock; /* Lock for map data */
155 struct lock lock; /* Lock for map data */
157 int nentries; /* Number of entries */
158 vm_size_t size; /* virtual size */
159 u_char system_map; /* Am I a system map? */
160 u_char infork; /* Am I in fork processing? */
161 vm_map_entry_t hint; /* hint for quick lookups */
162 unsigned int timestamp; /* Version number */
163 vm_map_entry_t first_free; /* First free space hint */
164 struct pmap *pmap; /* Physical map */

--- 45 unchanged lines hidden (view full) ---

210#define vm_map_lock_drain_interlock(map) \
211 do { \
212 lockmgr(&(map)->lock, LK_DRAIN|LK_INTERLOCK, \
213 &(map)->ref_lock, curthread); \
214 (map)->timestamp++; \
215 } while (0)
216#endif
217
156 int nentries; /* Number of entries */
157 vm_size_t size; /* virtual size */
158 u_char system_map; /* Am I a system map? */
159 u_char infork; /* Am I in fork processing? */
160 vm_map_entry_t hint; /* hint for quick lookups */
161 unsigned int timestamp; /* Version number */
162 vm_map_entry_t first_free; /* First free space hint */
163 struct pmap *pmap; /* Physical map */

--- 45 unchanged lines hidden (view full) ---

209#define vm_map_lock_drain_interlock(map) \
210 do { \
211 lockmgr(&(map)->lock, LK_DRAIN|LK_INTERLOCK, \
212 &(map)->ref_lock, curthread); \
213 (map)->timestamp++; \
214 } while (0)
215#endif
216
218void _vm_map_lock(vm_map_t map, const char *file, int line);
219int _vm_map_try_lock(vm_map_t map, const char *file, int line);
220void _vm_map_unlock(vm_map_t map, const char *file, int line);
221void _vm_map_lock_read(vm_map_t map, const char *file, int line);
222void _vm_map_unlock_read(vm_map_t map, const char *file, int line);
223int _vm_map_lock_upgrade(vm_map_t map, const char *file, int line);
224void _vm_map_lock_downgrade(vm_map_t map, const char *file, int line);
225
226#define vm_map_lock(map) _vm_map_lock(map, LOCK_FILE, LOCK_LINE)
227#define vm_map_try_lock(map) _vm_map_try_lock(map, LOCK_FILE, LOCK_LINE)
228#define vm_map_unlock(map) _vm_map_unlock(map, LOCK_FILE, LOCK_LINE)
229#define vm_map_lock_read(map) _vm_map_lock_read(map, LOCK_FILE, LOCK_LINE)
230#define vm_map_unlock_read(map) _vm_map_unlock_read(map, LOCK_FILE, LOCK_LINE)
231#define vm_map_lock_upgrade(map) _vm_map_lock_upgrade(map, LOCK_FILE, LOCK_LINE)
232#define vm_map_lock_downgrade(map) _vm_map_lock_downgrade(map, LOCK_FILE, \
233 LOCK_LINE)
234
217void vm_map_lock(vm_map_t map);
218void vm_map_unlock(vm_map_t map);
219void vm_map_lock_read(vm_map_t map);
220void vm_map_unlock_read(vm_map_t map);
221int vm_map_lock_upgrade(vm_map_t map);
222void vm_map_lock_downgrade(vm_map_t map);
223void vm_map_set_recursive(vm_map_t map);
224void vm_map_clear_recursive(vm_map_t map);
235vm_offset_t vm_map_min(vm_map_t map);
236vm_offset_t vm_map_max(vm_map_t map);
237struct pmap *vm_map_pmap(vm_map_t map);
238
239struct pmap *vmspace_pmap(struct vmspace *vmspace);
240long vmspace_resident_count(struct vmspace *vmspace);
241#endif /* _KERNEL */
242

--- 61 unchanged lines hidden ---
225vm_offset_t vm_map_min(vm_map_t map);
226vm_offset_t vm_map_max(vm_map_t map);
227struct pmap *vm_map_pmap(vm_map_t map);
228
229struct pmap *vmspace_pmap(struct vmspace *vmspace);
230long vmspace_resident_count(struct vmspace *vmspace);
231#endif /* _KERNEL */
232

--- 61 unchanged lines hidden ---