pmap.c (270835) | pmap.c (270920) |
---|---|
1/*- 2 * Copyright (c) 1991 Regents of the University of California. 3 * All rights reserved. 4 * Copyright (c) 1994 John S. Dyson 5 * All rights reserved. 6 * Copyright (c) 1994 David Greenman 7 * All rights reserved. 8 * Copyright (c) 1998,2000 Doug Rabson --- 32 unchanged lines hidden (view full) --- 41 * SUCH DAMAGE. 42 * 43 * from: @(#)pmap.c 7.7 (Berkeley) 5/12/91 44 * from: i386 Id: pmap.c,v 1.193 1998/04/19 15:22:48 bde Exp 45 * with some ideas from NetBSD's alpha pmap 46 */ 47 48#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1991 Regents of the University of California. 3 * All rights reserved. 4 * Copyright (c) 1994 John S. Dyson 5 * All rights reserved. 6 * Copyright (c) 1994 David Greenman 7 * All rights reserved. 8 * Copyright (c) 1998,2000 Doug Rabson --- 32 unchanged lines hidden (view full) --- 41 * SUCH DAMAGE. 42 * 43 * from: @(#)pmap.c 7.7 (Berkeley) 5/12/91 44 * from: i386 Id: pmap.c,v 1.193 1998/04/19 15:22:48 bde Exp 45 * with some ideas from NetBSD's alpha pmap 46 */ 47 48#include <sys/cdefs.h> |
49__FBSDID("$FreeBSD: stable/10/sys/ia64/ia64/pmap.c 270835 2014-08-30 03:41:47Z alc $"); | 49__FBSDID("$FreeBSD: stable/10/sys/ia64/ia64/pmap.c 270920 2014-09-01 07:58:15Z kib $"); |
50 51#include "opt_pmap.h" 52 53#include <sys/param.h> 54#include <sys/efi.h> 55#include <sys/kernel.h> 56#include <sys/ktr.h> 57#include <sys/lock.h> --- 1883 unchanged lines hidden (view full) --- 1941 __func__, pmap, addr, object, pindex, size); 1942 1943 VM_OBJECT_ASSERT_WLOCKED(object); 1944 KASSERT(object->type == OBJT_DEVICE || object->type == OBJT_SG, 1945 ("pmap_object_init_pt: non-device object")); 1946} 1947 1948/* | 50 51#include "opt_pmap.h" 52 53#include <sys/param.h> 54#include <sys/efi.h> 55#include <sys/kernel.h> 56#include <sys/ktr.h> 57#include <sys/lock.h> --- 1883 unchanged lines hidden (view full) --- 1941 __func__, pmap, addr, object, pindex, size); 1942 1943 VM_OBJECT_ASSERT_WLOCKED(object); 1944 KASSERT(object->type == OBJT_DEVICE || object->type == OBJT_SG, 1945 ("pmap_object_init_pt: non-device object")); 1946} 1947 1948/* |
1949 * Routine: pmap_change_wiring 1950 * Function: Change the wiring attribute for a map/virtual-address 1951 * pair. 1952 * In/out conditions: 1953 * The mapping must already exist in the pmap. | 1949 * Clear the wired attribute from the mappings for the specified range of 1950 * addresses in the given pmap. Every valid mapping within that range 1951 * must have the wired attribute set. In contrast, invalid mappings 1952 * cannot have the wired attribute set, so they are ignored. 1953 * 1954 * The wired attribute of the page table entry is not a hardware feature, 1955 * so there is no need to invalidate any TLB entries. |
1954 */ 1955void | 1956 */ 1957void |
1956pmap_change_wiring(pmap_t pmap, vm_offset_t va, boolean_t wired) | 1958pmap_unwire(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) |
1957{ 1958 pmap_t oldpmap; 1959 struct ia64_lpte *pte; 1960 | 1959{ 1960 pmap_t oldpmap; 1961 struct ia64_lpte *pte; 1962 |
1961 CTR4(KTR_PMAP, "%s(pm=%p, va=%#lx, wired=%u)", __func__, pmap, va, 1962 wired); | 1963 CTR4(KTR_PMAP, "%s(%p, %#x, %#x)", __func__, pmap, sva, eva); |
1963 1964 PMAP_LOCK(pmap); 1965 oldpmap = pmap_switch(pmap); | 1964 1965 PMAP_LOCK(pmap); 1966 oldpmap = pmap_switch(pmap); |
1966 1967 pte = pmap_find_vhpt(va); 1968 KASSERT(pte != NULL, ("pte")); 1969 if (wired && !pmap_wired(pte)) { 1970 pmap->pm_stats.wired_count++; 1971 pmap_set_wired(pte); 1972 } else if (!wired && pmap_wired(pte)) { | 1967 for (; sva < eva; sva += PAGE_SIZE) { 1968 pte = pmap_find_vhpt(sva); 1969 if (pte == NULL) 1970 continue; 1971 if (!pmap_wired(pte)) 1972 panic("pmap_unwire: pte %p isn't wired", pte); |
1973 pmap->pm_stats.wired_count--; 1974 pmap_clear_wired(pte); 1975 } | 1973 pmap->pm_stats.wired_count--; 1974 pmap_clear_wired(pte); 1975 } |
1976 | |
1977 pmap_switch(oldpmap); 1978 PMAP_UNLOCK(pmap); 1979} 1980 1981/* 1982 * Copy the range specified by src_addr/len 1983 * from the source map to the range dst_addr/len 1984 * in the destination map. --- 912 unchanged lines hidden --- | 1976 pmap_switch(oldpmap); 1977 PMAP_UNLOCK(pmap); 1978} 1979 1980/* 1981 * Copy the range specified by src_addr/len 1982 * from the source map to the range dst_addr/len 1983 * in the destination map. --- 912 unchanged lines hidden --- |