Deleted Added
full compact
pmap-v4.c (160537) pmap-v4.c (160889)
1/* From: $NetBSD: pmap.c,v 1.148 2004/04/03 04:35:48 bsh Exp $ */
2/*-
3 * Copyright 2004 Olivier Houchard.
4 * Copyright 2003 Wasabi Systems, Inc.
5 * All rights reserved.
6 *
7 * Written by Steve C. Woodford for Wasabi Systems, Inc.
8 *

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

142 * Special compilation symbols
143 * PMAP_DEBUG - Build in pmap_debug_level code
144 */
145/* Include header files */
146
147#include "opt_vm.h"
148
149#include <sys/cdefs.h>
1/* From: $NetBSD: pmap.c,v 1.148 2004/04/03 04:35:48 bsh Exp $ */
2/*-
3 * Copyright 2004 Olivier Houchard.
4 * Copyright 2003 Wasabi Systems, Inc.
5 * All rights reserved.
6 *
7 * Written by Steve C. Woodford for Wasabi Systems, Inc.
8 *

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

142 * Special compilation symbols
143 * PMAP_DEBUG - Build in pmap_debug_level code
144 */
145/* Include header files */
146
147#include "opt_vm.h"
148
149#include <sys/cdefs.h>
150__FBSDID("$FreeBSD: head/sys/arm/arm/pmap.c 160537 2006-07-20 23:26:22Z alc $");
150__FBSDID("$FreeBSD: head/sys/arm/arm/pmap.c 160889 2006-08-01 19:06:06Z alc $");
151#include <sys/param.h>
152#include <sys/systm.h>
153#include <sys/kernel.h>
154#include <sys/proc.h>
155#include <sys/malloc.h>
156#include <sys/msgbuf.h>
157#include <sys/vmmeter.h>
158#include <sys/mman.h>

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

2754 cpu_tlb_flushD();
2755 cpu_cpwait();
2756 kernel_vm_end = pmap_curmaxkvaddr;
2757
2758}
2759
2760
2761/*
151#include <sys/param.h>
152#include <sys/systm.h>
153#include <sys/kernel.h>
154#include <sys/proc.h>
155#include <sys/malloc.h>
156#include <sys/msgbuf.h>
157#include <sys/vmmeter.h>
158#include <sys/mman.h>

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

2754 cpu_tlb_flushD();
2755 cpu_cpwait();
2756 kernel_vm_end = pmap_curmaxkvaddr;
2757
2758}
2759
2760
2761/*
2762 * pmap_page_protect:
2763 *
2764 * Lower the permission for all mappings to a given page.
2765 */
2766void
2767pmap_page_protect(vm_page_t m, vm_prot_t prot)
2768{
2769 switch(prot) {
2770 case VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE:
2771 case VM_PROT_READ|VM_PROT_WRITE:
2772 return;
2773
2774 case VM_PROT_READ:
2775 case VM_PROT_READ|VM_PROT_EXECUTE:
2776 pmap_clearbit(m, PVF_WRITE);
2777 break;
2778
2779 default:
2780 pmap_remove_all(m);
2781 break;
2782 }
2783
2784}
2785
2786
2787/*
2788 * Remove all pages from specified address space
2789 * this aids process exit speeds. Also, this code
2790 * is special cased for current process only, but
2791 * can have the more generic (and slightly slower)
2792 * mode enabled. This is much faster than pmap_remove
2793 * in the case of running down an entire address space.
2794 */
2795void

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

4459 pmap_clearbit(m, PVF_REF);
4460}
4461
4462
4463/*
4464 * Clear the write and modified bits in each of the given page's mappings.
4465 */
4466void
2762 * Remove all pages from specified address space
2763 * this aids process exit speeds. Also, this code
2764 * is special cased for current process only, but
2765 * can have the more generic (and slightly slower)
2766 * mode enabled. This is much faster than pmap_remove
2767 * in the case of running down an entire address space.
2768 */
2769void

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

4433 pmap_clearbit(m, PVF_REF);
4434}
4435
4436
4437/*
4438 * Clear the write and modified bits in each of the given page's mappings.
4439 */
4440void
4467pmap_clear_write(vm_page_t m)
4441pmap_remove_write(vm_page_t m)
4468{
4469
4470 if (m->md.pvh_attrs & PVF_WRITE)
4471 pmap_clearbit(m, PVF_WRITE);
4472 else
4473 KASSERT((m->flags & PG_WRITEABLE) == 0,
4474 ("pmap_clear_write: page %p has PG_WRITEABLE set", m));
4475}

--- 346 unchanged lines hidden ---
4442{
4443
4444 if (m->md.pvh_attrs & PVF_WRITE)
4445 pmap_clearbit(m, PVF_WRITE);
4446 else
4447 KASSERT((m->flags & PG_WRITEABLE) == 0,
4448 ("pmap_clear_write: page %p has PG_WRITEABLE set", m));
4449}

--- 346 unchanged lines hidden ---