Deleted Added
full compact
vm_page.h (33936) vm_page.h (34206)
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 * $Id: vm_page.h,v 1.36 1998/02/05 03:32:47 dyson Exp $
64 * $Id: vm_page.h,v 1.37 1998/03/01 04:18:26 dyson Exp $
65 */
66
67/*
68 * Resident memory system definitions.
69 */
70
71#ifndef _VM_PAGE_
72#define _VM_PAGE_

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

271#define PAGE_WAKEUP(m) { \
272 (m)->flags &= ~PG_BUSY; \
273 if (((m)->flags & PG_WANTED) && ((m)->busy == 0)) { \
274 (m)->flags &= ~PG_WANTED; \
275 wakeup((m)); \
276 } \
277}
278
65 */
66
67/*
68 * Resident memory system definitions.
69 */
70
71#ifndef _VM_PAGE_
72#define _VM_PAGE_

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

271#define PAGE_WAKEUP(m) { \
272 (m)->flags &= ~PG_BUSY; \
273 if (((m)->flags & PG_WANTED) && ((m)->busy == 0)) { \
274 (m)->flags &= ~PG_WANTED; \
275 wakeup((m)); \
276 } \
277}
278
279#define PAGE_BWAKEUP(m) { \
280 (m)->busy--; \
281 if ((((m)->flags & (PG_WANTED | PG_BUSY)) == PG_WANTED) && \
282 ((m)->busy == 0)) { \
283 (m)->flags &= ~PG_WANTED; \
284 wakeup((m)); \
285 } \
286}
287
288
279#if PAGE_SIZE == 4096
280#define VM_PAGE_BITS_ALL 0xff
281#endif
282
283#if PAGE_SIZE == 8192
284#define VM_PAGE_BITS_ALL 0xffff
285#endif
286

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

345#endif
346}
347
348static __inline void
349vm_page_protect(vm_page_t mem, int prot)
350{
351 if (prot == VM_PROT_NONE) {
352 if (mem->flags & (PG_WRITEABLE|PG_MAPPED)) {
289#if PAGE_SIZE == 4096
290#define VM_PAGE_BITS_ALL 0xff
291#endif
292
293#if PAGE_SIZE == 8192
294#define VM_PAGE_BITS_ALL 0xffff
295#endif
296

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

355#endif
356}
357
358static __inline void
359vm_page_protect(vm_page_t mem, int prot)
360{
361 if (prot == VM_PROT_NONE) {
362 if (mem->flags & (PG_WRITEABLE|PG_MAPPED)) {
353 pmap_page_protect(VM_PAGE_TO_PHYS(mem), prot);
363 pmap_page_protect(VM_PAGE_TO_PHYS(mem), VM_PROT_NONE);
354 mem->flags &= ~(PG_WRITEABLE|PG_MAPPED);
355 }
356 } else if ((prot == VM_PROT_READ) && (mem->flags & PG_WRITEABLE)) {
364 mem->flags &= ~(PG_WRITEABLE|PG_MAPPED);
365 }
366 } else if ((prot == VM_PROT_READ) && (mem->flags & PG_WRITEABLE)) {
357 pmap_page_protect(VM_PAGE_TO_PHYS(mem), prot);
367 pmap_page_protect(VM_PAGE_TO_PHYS(mem), VM_PROT_READ);
358 mem->flags &= ~PG_WRITEABLE;
359 }
360}
361
362/*
363 * vm_page_zero_fill:
364 *
365 * Zero-fill the specified page.

--- 27 unchanged lines hidden ---
368 mem->flags &= ~PG_WRITEABLE;
369 }
370}
371
372/*
373 * vm_page_zero_fill:
374 *
375 * Zero-fill the specified page.

--- 27 unchanged lines hidden ---