Deleted Added
full compact
mmu_oea64.c (323968) mmu_oea64.c (327785)
1/*-
2 * Copyright (c) 2008-2015 Nathan Whitehorn
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *

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

20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2008-2015 Nathan Whitehorn
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *

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

20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: stable/11/sys/powerpc/aim/mmu_oea64.c 323968 2017-09-24 12:53:33Z markj $");
28__FBSDID("$FreeBSD: stable/11/sys/powerpc/aim/mmu_oea64.c 327785 2018-01-10 20:39:26Z markj $");
29
30/*
31 * Manages physical address maps.
32 *
33 * Since the information managed by this module is also stored by the
34 * logical address mapping module, this module may throw away valid virtual
35 * to physical mappings at almost any time. However, invalidations of
36 * mappings must be done as requested.

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

1510
1511static void *
1512moea64_uma_page_alloc(uma_zone_t zone, vm_size_t bytes, uint8_t *flags,
1513 int wait)
1514{
1515 struct pvo_entry *pvo;
1516 vm_offset_t va;
1517 vm_page_t m;
29
30/*
31 * Manages physical address maps.
32 *
33 * Since the information managed by this module is also stored by the
34 * logical address mapping module, this module may throw away valid virtual
35 * to physical mappings at almost any time. However, invalidations of
36 * mappings must be done as requested.

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

1510
1511static void *
1512moea64_uma_page_alloc(uma_zone_t zone, vm_size_t bytes, uint8_t *flags,
1513 int wait)
1514{
1515 struct pvo_entry *pvo;
1516 vm_offset_t va;
1517 vm_page_t m;
1518 int pflags, needed_lock;
1518 int needed_lock;
1519
1520 /*
1521 * This entire routine is a horrible hack to avoid bothering kmem
1522 * for new KVA addresses. Because this can get called from inside
1523 * kmem allocation routines, calling kmem for a new address here
1524 * can lead to multiply locking non-recursive mutexes.
1525 */
1526
1527 *flags = UMA_SLAB_PRIV;
1528 needed_lock = !PMAP_LOCKED(kernel_pmap);
1519
1520 /*
1521 * This entire routine is a horrible hack to avoid bothering kmem
1522 * for new KVA addresses. Because this can get called from inside
1523 * kmem allocation routines, calling kmem for a new address here
1524 * can lead to multiply locking non-recursive mutexes.
1525 */
1526
1527 *flags = UMA_SLAB_PRIV;
1528 needed_lock = !PMAP_LOCKED(kernel_pmap);
1529 pflags = malloc2vm_flags(wait) | VM_ALLOC_WIRED;
1530
1529
1531 for (;;) {
1532 m = vm_page_alloc(NULL, 0, pflags | VM_ALLOC_NOOBJ);
1533 if (m == NULL) {
1534 if (wait & M_NOWAIT)
1535 return (NULL);
1536 VM_WAIT;
1537 } else
1538 break;
1539 }
1530 m = vm_page_alloc(NULL, 0,
1531 malloc2vm_flags(wait) | VM_ALLOC_WIRED | VM_ALLOC_NOOBJ);
1532 if (m == NULL)
1533 return (NULL);
1540
1541 va = VM_PAGE_TO_PHYS(m);
1542
1543 pvo = alloc_pvo_entry(1 /* bootstrap */);
1544
1545 pvo->pvo_pte.prot = VM_PROT_READ | VM_PROT_WRITE;
1546 pvo->pvo_pte.pa = VM_PAGE_TO_PHYS(m) | LPTE_M;
1547

--- 1191 unchanged lines hidden ---
1534
1535 va = VM_PAGE_TO_PHYS(m);
1536
1537 pvo = alloc_pvo_entry(1 /* bootstrap */);
1538
1539 pvo->pvo_pte.prot = VM_PROT_READ | VM_PROT_WRITE;
1540 pvo->pvo_pte.pa = VM_PAGE_TO_PHYS(m) | LPTE_M;
1541

--- 1191 unchanged lines hidden ---