Deleted Added
full compact
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 * $Id: vm_page.h,v 1.18 1995/04/23 08:05:49 bde Exp $
65 */
66
67/*
68 * Resident memory system definitions.
69 */
70
71#ifndef _VM_PAGE_
72#define _VM_PAGE_

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

131#define PG_COPYONWRITE 0x0080 /* must copy page before changing (O) */
132#define PG_FICTITIOUS 0x0100 /* physical page doesn't exist (O) */
133#define PG_WRITEABLE 0x0200 /* page is mapped writeable */
134#define PG_MAPPED 0x0400 /* page is mapped */
135#define PG_REFERENCED 0x1000 /* page has been referenced */
136#define PG_CACHE 0x4000 /* On VMIO cache */
137#define PG_FREE 0x8000 /* page is in free list */
138
139/*
140 * Misc constants.
141 */
142
143#define ACT_DECLINE 1
144#define ACT_ADVANCE 3
145#define ACT_MAX 100
146#define PFCLUSTER_BEHIND 3
147#define PFCLUSTER_AHEAD 3
148
149#ifdef KERNEL
150/*
151 * Each pageable resident page falls into one of four lists:
152 *
153 * free
154 * Available for allocation now.
155 *
156 * The following are all LRU sorted:
157 *
158 * cache
159 * Almost available for allocation. Still in an
160 * object, but clean and immediately freeable at
161 * non-interrupt times.
162 *
163 * inactive
164 * Low activity, candidates for reclaimation.
165 * This is the list of pages that should be
166 * paged out next.
167 *
168 * active
169 * Pages that are "active" i.e. they have been
170 * recently referenced.
171 */
172
173extern struct pglist vm_page_queue_free; /* memory free queue */
174extern struct pglist vm_page_queue_active; /* active memory queue */
175extern struct pglist vm_page_queue_inactive; /* inactive memory queue */
176extern struct pglist vm_page_queue_cache; /* cache memory queue */
177
178extern vm_page_t vm_page_array; /* First resident page in table */

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

189#define VM_PAGE_TO_PHYS(entry) ((entry)->phys_addr)
190
191#define IS_VM_PHYSADDR(pa) \
192 ((pa) >= first_phys_addr && (pa) <= last_phys_addr)
193
194#define PHYS_TO_VM_PAGE(pa) \
195 (&vm_page_array[atop(pa) - first_page ])
196
197/*
198 * Functions implemented as macros
199 */
200
201#define PAGE_ASSERT_WAIT(m, interruptible) { \
202 (m)->flags |= PG_WANTED; \
203 assert_wait((int) (m), (interruptible)); \
204 }
205
206#define PAGE_WAKEUP(m) { \
207 (m)->flags &= ~PG_BUSY; \
208 if ((m)->flags & PG_WANTED) { \
209 (m)->flags &= ~PG_WANTED; \
210 wakeup((caddr_t) (m)); \
211 } \
212 }
213
214#if PAGE_SIZE == 4096
215#define VM_PAGE_BITS_ALL 0xff
216#endif
217
218#if PAGE_SIZE == 8192
219#define VM_PAGE_BITS_ALL 0xffff
220#endif
221

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

286 } else if ((prot == VM_PROT_READ) && (mem->flags & PG_WRITEABLE)) {
287 pmap_page_protect(VM_PAGE_TO_PHYS(mem), prot);
288 mem->flags &= ~PG_WRITEABLE;
289 }
290}
291
292
293#endif /* KERNEL */
294#endif /* !_VM_PAGE_ */