mmu_oea.c (253978) | mmu_oea.c (254025) |
---|---|
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 --- 77 unchanged lines hidden (view full) --- 86 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 87 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 88 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 89 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 90 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 91 */ 92 93#include <sys/cdefs.h> | 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 --- 77 unchanged lines hidden (view full) --- 86 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 87 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 88 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 89 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 90 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 91 */ 92 93#include <sys/cdefs.h> |
94__FBSDID("$FreeBSD: head/sys/powerpc/aim/mmu_oea.c 253978 2013-08-06 02:58:16Z jhibbits $"); | 94__FBSDID("$FreeBSD: head/sys/powerpc/aim/mmu_oea.c 254025 2013-08-07 06:21:20Z jeff $"); |
95 96/* 97 * Manages physical address maps. 98 * 99 * Since the information managed by this module is also stored by the 100 * logical address mapping module, this module may throw away valid virtual 101 * to physical mappings at almost any time. However, invalidations of 102 * mappings must be done as requested. --- 2483 unchanged lines hidden (view full) --- 2586 * return the 1:1 mapping. This currently doesn't work 2587 * for regions that overlap 256M BAT segments. 2588 */ 2589 for (i = 0; i < 16; i++) { 2590 if (moea_bat_mapped(i, pa, size) == 0) 2591 return ((void *) pa); 2592 } 2593 | 95 96/* 97 * Manages physical address maps. 98 * 99 * Since the information managed by this module is also stored by the 100 * logical address mapping module, this module may throw away valid virtual 101 * to physical mappings at almost any time. However, invalidations of 102 * mappings must be done as requested. --- 2483 unchanged lines hidden (view full) --- 2586 * return the 1:1 mapping. This currently doesn't work 2587 * for regions that overlap 256M BAT segments. 2588 */ 2589 for (i = 0; i < 16; i++) { 2590 if (moea_bat_mapped(i, pa, size) == 0) 2591 return ((void *) pa); 2592 } 2593 |
2594 va = kmem_alloc_nofault(kernel_map, size); | 2594 va = kva_alloc(size); |
2595 if (!va) 2596 panic("moea_mapdev: Couldn't alloc kernel virtual memory"); 2597 2598 for (tmpva = va; size > 0;) { 2599 moea_kenter_attr(mmu, tmpva, ppa, ma); 2600 tlbie(tmpva); 2601 size -= PAGE_SIZE; 2602 tmpva += PAGE_SIZE; --- 11 unchanged lines hidden (view full) --- 2614 /* 2615 * If this is outside kernel virtual space, then it's a 2616 * battable entry and doesn't require unmapping 2617 */ 2618 if ((va >= VM_MIN_KERNEL_ADDRESS) && (va <= virtual_end)) { 2619 base = trunc_page(va); 2620 offset = va & PAGE_MASK; 2621 size = roundup(offset + size, PAGE_SIZE); | 2595 if (!va) 2596 panic("moea_mapdev: Couldn't alloc kernel virtual memory"); 2597 2598 for (tmpva = va; size > 0;) { 2599 moea_kenter_attr(mmu, tmpva, ppa, ma); 2600 tlbie(tmpva); 2601 size -= PAGE_SIZE; 2602 tmpva += PAGE_SIZE; --- 11 unchanged lines hidden (view full) --- 2614 /* 2615 * If this is outside kernel virtual space, then it's a 2616 * battable entry and doesn't require unmapping 2617 */ 2618 if ((va >= VM_MIN_KERNEL_ADDRESS) && (va <= virtual_end)) { 2619 base = trunc_page(va); 2620 offset = va & PAGE_MASK; 2621 size = roundup(offset + size, PAGE_SIZE); |
2622 kmem_free(kernel_map, base, size); | 2622 kva_free(base, size); |
2623 } 2624} 2625 2626static void 2627moea_sync_icache(mmu_t mmu, pmap_t pm, vm_offset_t va, vm_size_t sz) 2628{ 2629 struct pvo_entry *pvo; 2630 vm_offset_t lim; --- 116 unchanged lines hidden --- | 2623 } 2624} 2625 2626static void 2627moea_sync_icache(mmu_t mmu, pmap_t pm, vm_offset_t va, vm_size_t sz) 2628{ 2629 struct pvo_entry *pvo; 2630 vm_offset_t lim; --- 116 unchanged lines hidden --- |