Deleted Added
full compact
pmap.c (92465) pmap.c (92654)
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 *

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

34 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
35 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
36 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
37 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
38 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
39 * SUCH DAMAGE.
40 *
41 * from: @(#)pmap.c 7.7 (Berkeley) 5/12/91
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 *

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

34 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
35 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
36 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
37 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
38 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
39 * SUCH DAMAGE.
40 *
41 * from: @(#)pmap.c 7.7 (Berkeley) 5/12/91
42 * $FreeBSD: head/sys/sparc64/sparc64/pmap.c 92465 2002-03-17 01:53:51Z jake $
42 * $FreeBSD: head/sys/sparc64/sparc64/pmap.c 92654 2002-03-19 09:11:49Z jeff $
43 */
44
45/*
46 * Manages physical address maps.
47 *
48 * In addition to hardware address maps, this module is called upon to
49 * provide software-use-only maps which may or may not be stored in the
50 * same form as hardware maps. These pseudo-maps are used to store

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

538 if (addr < 0xf0000000) /* XXX */
539 continue;
540 result = vm_map_find(kernel_map, NULL, 0, &addr, size, TRUE,
541 VM_PROT_ALL, VM_PROT_ALL, 0);
542 if (result != KERN_SUCCESS || addr != translations[i].om_start)
543 panic("pmap_init: vm_map_find");
544 }
545
43 */
44
45/*
46 * Manages physical address maps.
47 *
48 * In addition to hardware address maps, this module is called upon to
49 * provide software-use-only maps which may or may not be stored in the
50 * same form as hardware maps. These pseudo-maps are used to store

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

538 if (addr < 0xf0000000) /* XXX */
539 continue;
540 result = vm_map_find(kernel_map, NULL, 0, &addr, size, TRUE,
541 VM_PROT_ALL, VM_PROT_ALL, 0);
542 if (result != KERN_SUCCESS || addr != translations[i].om_start)
543 panic("pmap_init: vm_map_find");
544 }
545
546#if 0
546 pvzone = &pvzone_store;
547 pvinit = (struct pv_entry *)kmem_alloc(kernel_map,
548 vm_page_array_size * sizeof (struct pv_entry));
549 zbootinit(pvzone, "PV ENTRY", sizeof (struct pv_entry), pvinit,
550 vm_page_array_size);
547 pvzone = &pvzone_store;
548 pvinit = (struct pv_entry *)kmem_alloc(kernel_map,
549 vm_page_array_size * sizeof (struct pv_entry));
550 zbootinit(pvzone, "PV ENTRY", sizeof (struct pv_entry), pvinit,
551 vm_page_array_size);
552#else
553 pvzone = zinit("PV ENTRY", sizeof (struct pv_entry), 0, 0, 0);
554 uma_zone_set_allocf(pvzone, pv_allocf);
555 uma_prealloc(pvzone, vm_page_array_size);
556#endif
551 pmap_initialized = TRUE;
552}
553
554/*
555 * Initialize the address space (zone) for the pv_entries. Set a
556 * high water mark so that the system can recover from excessive
557 * numbers of pv entries.
558 */
559void
560pmap_init2(void)
561{
562 int shpgperproc;
563
564 shpgperproc = PMAP_SHPGPERPROC;
565 TUNABLE_INT_FETCH("vm.pmap.shpgperproc", &shpgperproc);
566 pv_entry_max = shpgperproc * maxproc + vm_page_array_size;
567 pv_entry_high_water = 9 * (pv_entry_max / 10);
557 pmap_initialized = TRUE;
558}
559
560/*
561 * Initialize the address space (zone) for the pv_entries. Set a
562 * high water mark so that the system can recover from excessive
563 * numbers of pv entries.
564 */
565void
566pmap_init2(void)
567{
568 int shpgperproc;
569
570 shpgperproc = PMAP_SHPGPERPROC;
571 TUNABLE_INT_FETCH("vm.pmap.shpgperproc", &shpgperproc);
572 pv_entry_max = shpgperproc * maxproc + vm_page_array_size;
573 pv_entry_high_water = 9 * (pv_entry_max / 10);
574#if 0
568 zinitna(pvzone, &pvzone_obj, NULL, 0, pv_entry_max, ZONE_INTERRUPT, 1);
575 zinitna(pvzone, &pvzone_obj, NULL, 0, pv_entry_max, ZONE_INTERRUPT, 1);
576#else
577 uma_zone_set_obj(pvzone, &pvzone_obj, pv_entry_max);
578#endif
569}
570
571/*
572 * Extract the physical page address associated with the given
573 * map/virtual_address pair.
574 */
575vm_offset_t
576pmap_extract(pmap_t pm, vm_offset_t va)

--- 1259 unchanged lines hidden ---
579}
580
581/*
582 * Extract the physical page address associated with the given
583 * map/virtual_address pair.
584 */
585vm_offset_t
586pmap_extract(pmap_t pm, vm_offset_t va)

--- 1259 unchanged lines hidden ---