mmu_oea.c (7c2779715ca7661187d824ecd0a4f79104510b9e) mmu_oea.c (4daf20b2f1ac85f9d2c1c35cca7047876b97a2f7)
1/*
2 * Copyright (c) 2001 The NetBSD Foundation, Inc.
3 * All rights reserved.
4 *
5 * This code is derived from software contributed to The NetBSD Foundation
6 * by Matt Thomas <matt@3am-software.com> of Allegro Networks, Inc.
7 *
8 * Redistribution and use in source and binary forms, with or without

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

693 |= 1 << (KERNEL_VSIDBITS % VSID_NBPW);
694 pmap_vsid_bitmap[0] |= 1;
695
696 /*
697 * Set up the OpenFirmware pmap and add it's mappings.
698 */
699 pmap_pinit(&ofw_pmap);
700 ofw_pmap.pm_sr[KERNEL_SR] = KERNEL_SEGMENT;
1/*
2 * Copyright (c) 2001 The NetBSD Foundation, Inc.
3 * All rights reserved.
4 *
5 * This code is derived from software contributed to The NetBSD Foundation
6 * by Matt Thomas <matt@3am-software.com> of Allegro Networks, Inc.
7 *
8 * Redistribution and use in source and binary forms, with or without

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

693 |= 1 << (KERNEL_VSIDBITS % VSID_NBPW);
694 pmap_vsid_bitmap[0] |= 1;
695
696 /*
697 * Set up the OpenFirmware pmap and add it's mappings.
698 */
699 pmap_pinit(&ofw_pmap);
700 ofw_pmap.pm_sr[KERNEL_SR] = KERNEL_SEGMENT;
701 ofw_pmap.pm_sr[KERNEL2_SR] = KERNEL2_SEGMENT;
701 if ((chosen = OF_finddevice("/chosen")) == -1)
702 panic("pmap_bootstrap: can't find /chosen");
703 OF_getprop(chosen, "mmu", &mmui, 4);
704 if ((mmu = OF_instance_to_package(mmui)) == -1)
705 panic("pmap_bootstrap: can't get mmu package");
706 if ((sz = OF_getproplen(mmu, "translations")) == -1)
707 panic("pmap_bootstrap: can't get ofw translation count");
708 translations = NULL;

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

746
747 /*
748 * Initialize the kernel pmap (which is statically allocated).
749 */
750 for (i = 0; i < 16; i++) {
751 kernel_pmap->pm_sr[i] = EMPTY_SEGMENT;
752 }
753 kernel_pmap->pm_sr[KERNEL_SR] = KERNEL_SEGMENT;
702 if ((chosen = OF_finddevice("/chosen")) == -1)
703 panic("pmap_bootstrap: can't find /chosen");
704 OF_getprop(chosen, "mmu", &mmui, 4);
705 if ((mmu = OF_instance_to_package(mmui)) == -1)
706 panic("pmap_bootstrap: can't get mmu package");
707 if ((sz = OF_getproplen(mmu, "translations")) == -1)
708 panic("pmap_bootstrap: can't get ofw translation count");
709 translations = NULL;

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

747
748 /*
749 * Initialize the kernel pmap (which is statically allocated).
750 */
751 for (i = 0; i < 16; i++) {
752 kernel_pmap->pm_sr[i] = EMPTY_SEGMENT;
753 }
754 kernel_pmap->pm_sr[KERNEL_SR] = KERNEL_SEGMENT;
755 kernel_pmap->pm_sr[KERNEL2_SR] = KERNEL_SEGMENT;
754 kernel_pmap->pm_active = ~0;
755
756 /*
757 * Allocate a kernel stack with a guard page for thread0 and map it
758 * into the kernel page map.
759 */
760 pa = pmap_bootstrap_alloc(KSTACK_PAGES * PAGE_SIZE, 0);
761 kstack0_phys = pa;

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

1380static u_int pmap_vsidcontext;
1381
1382void
1383pmap_pinit(pmap_t pmap)
1384{
1385 int i, mask;
1386 u_int entropy;
1387
756 kernel_pmap->pm_active = ~0;
757
758 /*
759 * Allocate a kernel stack with a guard page for thread0 and map it
760 * into the kernel page map.
761 */
762 pa = pmap_bootstrap_alloc(KSTACK_PAGES * PAGE_SIZE, 0);
763 kstack0_phys = pa;

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

1382static u_int pmap_vsidcontext;
1383
1384void
1385pmap_pinit(pmap_t pmap)
1386{
1387 int i, mask;
1388 u_int entropy;
1389
1390 KASSERT((int)pmap < VM_MIN_KERNEL_ADDRESS, ("pmap_pinit: virt pmap"));
1391
1388 entropy = 0;
1389 __asm __volatile("mftb %0" : "=r"(entropy));
1390
1391 /*
1392 * Allocate some segment registers for this pmap.
1393 */
1394 for (i = 0; i < NPMAPS; i += VSID_NBPW) {
1395 u_int hash, n;

--- 967 unchanged lines hidden ---
1392 entropy = 0;
1393 __asm __volatile("mftb %0" : "=r"(entropy));
1394
1395 /*
1396 * Allocate some segment registers for this pmap.
1397 */
1398 for (i = 0; i < NPMAPS; i += VSID_NBPW) {
1399 u_int hash, n;

--- 967 unchanged lines hidden ---